A lightweight, pure-Python mobile robot simulator designed for experiments in Artificial Intelligence (AI) and Machine Learning, especially for Jupyter Notebooks

Overview

aitk.robots

PyPI version CI build status

A lightweight Python robot simulator for JupyterLab, Notebooks, and other Python environments.

Goals

  1. A lightweight mobile robotics simulator
  2. Usable in the classroom, research, or exploration
  3. Explore wheeled robots with range, cameras, smell, and light sensors
  4. Operate quickly without a huge amount of resources
  5. Create reproducible experiments
  6. Designed for exposition, experimentation, and analysis
  7. Sensors designed for somewhat realistic problems (such as image recognition)
  8. Especially designed to work easily with Machine Learning and Artificial Intelligence systems

Installation

For the core operations, you will need to install just aitk.robots:

pip install aitk.robots

To use the Jupyter enhancements, you'll also need the browser-based extensions. You can install those with:

jupyter labextension install @jupyter-widgets/jupyterlab-manager

If not in a conda environment, then you will also need to:

jupyter nbextension enable --py widgetsnbextension

For additional information, please see:

Comments
  • View of camera's width in watched world does not change when width is changed

    View of camera's width in watched world does not change when width is changed

    I'm not sure if this is an important issue, but when you change a robot's camera width from 256 to 64, for example, the view of the robot in a watched world (the lines that trace the camera's view) don't change.

    opened by lmeeden1 2
  • Update robot.py

    Update robot.py

    Minor wording changes for clarity to robot movement commands "amount" -> "speed". Also added clarity to robot constructor parameter color.

    opened by lmeeden1 1
  • watching a recorder generates a new error

    watching a recorder generates a new error

    recorder.watch()

    generates an error


    TypeError Traceback (most recent call last) ~/opt/miniconda3/envs/py38/lib/python3.8/site-packages/aitk/robots/watchers.py in (widget) 540 layout=Layout(width="100%"), 541 ) --> 542 controls.on_displayed(lambda widget: self.initialize()) 543 return controls 544

    ~/opt/miniconda3/envs/py38/lib/python3.8/site-packages/aitk/robots/watchers.py in initialize(self) 547 Setup the displayer ids to map results to the areas. 548 """ --> 549 results = self.function(self.control_slider.value) 550 if not isinstance(results, (list, tuple)): 551 results = [results]

    ~/opt/miniconda3/envs/py38/lib/python3.8/site-packages/aitk/robots/watchers.py in goto(self, time) 380 self.world._reset_ground_image() 381 self.world.update() --> 382 picture = self.world.display(format="image") 383 return picture 384

    TypeError: display() got an unexpected keyword argument 'format' ​

    opened by lmeeden1 1
  • problem with watching and saving a recorder

    problem with watching and saving a recorder

    The following code generates the error message below. The save_as method also has the same issue.

    recorder = world.record()
    world.seconds(120,[wander_ir, wander_laser, search_light],real_time=False)
    recorder.watch()
    

    AttributeError Traceback (most recent call last) ~/opt/miniconda3/envs/py38/lib/python3.8/site-packages/aitk/robots/watchers.py in (widget) 540 layout=Layout(width="100%"), 541 ) --> 542 controls.on_displayed(lambda widget: self.initialize()) 543 return controls 544

    ~/opt/miniconda3/envs/py38/lib/python3.8/site-packages/aitk/robots/watchers.py in initialize(self) 547 Setup the displayer ids to map results to the areas. 548 """ --> 549 results = self.function(self.control_slider.value) 550 if not isinstance(results, (list, tuple)): 551 results = [results]

    ~/opt/miniconda3/envs/py38/lib/python3.8/site-packages/aitk/robots/watchers.py in goto(self, time) 378 if self.world.time == 0: 379 # In case it changed: --> 380 self.world.reset_ground_image() 381 self.world.update() 382 picture = self.world.display(format="image")

    AttributeError: 'World' object has no attribute 'reset_ground_image'

    opened by lmeeden1 1
  • Checklist for 1.0 release

    Checklist for 1.0 release

    • [x] robot's camera can see a bulb through a wall
    • [x] smell sensors and light sensors both show up as small circles on the robot; makes it hard to distinguish between the two. Perhaps the smell sensors could be squares?
    • [x] As a robot equipped with a camera approaches food, when it is quite close to the food it becomes invisible (not showing up in the image).
    • [x] device constructors should raise exception when given an unknown parameter
    • [x] single-line wall issues: don't block smell, don't save with config
    • [x] watched views should have a blue border
    • [x] need to test GroundCamera, pen_up() and pen_down()
    • [x] draw light in world (top-down view) so that it hits walls rather than drawing under them
    • [x] bring docs up to date
    • [ ] Colab issues
      • [x] no-joystick button grid is overlapping
      • [ ] joystick control in colab
    • [x] Recorder issues
      • [x] recording should use max_trace_length
      • [x] might be an issue with recorder.get_trace() to get a long trace
      • [x] smells/food and bulb on/off aren't integrated with recorder
      • [x] recorder doesn't play last step
    • [ ] why does "Resetting seed" show an increasing number of times?
    opened by dsblank 0
Releases(v0.9.21)
  • v0.9.21(May 26, 2021)

    Major changes:

    • Fixed bug in not showing full last recorder step
    • Don't call attr on backend (error from colab)
    • Fixes traces in recorder
    • Added recorder.watch(width)
    • Fixed issues with recorder and food
    • Added bulb.flip(), bulb.on()/off()
    • Added world.get_food()
    Source code(tar.gz)
    Source code(zip)
  • v0.9.17(May 19, 2021)

    Major changes:

    • Added bulb on/off and eat food to events
    • Updated docs
    • Added color_sensitivity to LightSensor
    • Reset target and velocities to zero when set_pose
    • Fix get smell typo
    Source code(tar.gz)
    Source code(zip)
  • 0.9.9(Apr 29, 2021)

  • v0.9.6(Apr 18, 2021)

    Major changes:

    • Camera food and bulb fixes (bug when min/max wrapped around unit circle)
    • Camera food and bulbs no alpha
    • Camera food is rectangle; bulb is circle
    • Add a ground image automatically with robot.pen_down() if there is None
    • Renamed Robot.info() and World.info() to .summary()
    • Light sensors are yellow; food sensors are white
    • Raise exception for invalid device config
    • Draw single wall lines with thickness
    • Get walls from config correctly
    • Fixed single wall config save
    • Fixed WHITE changing
    Source code(tar.gz)
    Source code(zip)
  • v0.9.5(Apr 8, 2021)

    Major changes:

    • Only recompute spread of food smell when food or walls change
    • Automatically compute smell_cell_size based on world size
    • Added robot.eat() - returns True if successful; must be close enough to food (20 pixels, robot.eat_food_distance), increases robot.food_eaten
    Source code(tar.gz)
    Source code(zip)
  • v0.9.4(Apr 7, 2021)

  • v0.9.3(Apr 7, 2021)

    Majors changes:

    * default for blub brightness is now 50
    * change bulb state will update the world
    * food is visible in camera and in world view (food is white)
    * added new World(smell_cell_size) size of smell grid, in pixels (larger is more coarse)
    * improved World.info()
    
    Source code(tar.gz)
    Source code(zip)
  • v0.9.2(Apr 6, 2021)

  • v0.9.1(Apr 1, 2021)

  • v0.8.12(Apr 1, 2021)

  • v0.8.11(Mar 31, 2021)

  • v0.8.10(Mar 25, 2021)

    Major changes:

    • Added Bulb device for robots
    • Added bulb.on() and bulb.off() for all bulbs
    • See bulbs in camera view (under development to make look better)
    • Robot's LightSensor device can sense bulbs on robots
    Source code(tar.gz)
    Source code(zip)
  • v0.8.9(Mar 25, 2021)

    Major changes:

    • Bulbs now have names
    • Added world.bulbs, world.get_bulb(name or index)
    • Added robot.add_device_ring()
    • Removed bqplot from setup
    • Added world.add_wall(color, x1, y1, x2, y2, box=False)
    • Added Vehicle robot type
    Source code(tar.gz)
    Source code(zip)
  • v0.8.8(Mar 24, 2021)

    Major changes:

    • Add light with transparency to camera image (in progress)
    • Fixed bug in seeing obstacles in camera
    • Made robots height bigger in camera image
    Source code(tar.gz)
    Source code(zip)
  • v0.8.7(Mar 18, 2021)

    Major changes:

    • Draft of seeing light in camera view
    • Give warning if not enough robot control functions
    • LightSensors show as white
    • removed robot.turn()
    • 0 to 1 only values: robot.forward(), robot.backward()
    • Renamed world.step to _step
    • Changed robot.move() to require two values
    • Added robot.motors(l, r)
    • Renamed camera.a to camera.fov
    • Removed the display from recorder.save_as()
    • Renamed LightSensor.get_reading() to get_brightness()

    This version will need an updated aitk.utils so Joystick will match Robot.move

    Source code(tar.gz)
    Source code(zip)
  • v0.8.6(Mar 17, 2021)

  • v0.8.5(Mar 17, 2021)

  • v0.8.4(Mar 15, 2021)

  • v0.8.3(Mar 14, 2021)

  • v0.8.2(Mar 13, 2021)

  • v0.8.1(Mar 13, 2021)

    Major changes:

    • made many attributes "private" (renamed with leading underscore)
    • removed camera viewport; set defaults
    • don't allow extra keywords for world and robot
    • updated worlds with direction -> a
    Source code(tar.gz)
    Source code(zip)
  • v0.8.0(Mar 12, 2021)

    Major changes:

    • Added Robot.get_velocity(target=False)
    • Don't color entire robot when stalled; now just border is white
    • Robot.reverse() flips all velocities (vx, va)
    • Added Robot.rotate() and Robot.translate(); same as Robot.turn() and Robot.forward()
    • Renamed all take_picture() to get_image(), returning a PIL Image
    • Renamed all direct to a (in robot and devices)
    • You can draw on world with world.canvas.draw_line(), draw_circle(), etc.
    • Camera images are less curved than before
    Source code(tar.gz)
    Source code(zip)
  • v0.7.7(Mar 9, 2021)

  • v0.7.6(Mar 9, 2021)

    Major changes:

    • Fixed Robot direction coords in constructor and JSON in/out
    • Added Camera.orthographic (distance is to camera plane) vs. perspective mode (distance is to camera point)
    Source code(tar.gz)
    Source code(zip)
  • v0.7.5(Mar 6, 2021)

    Major changes:

    • requires aitk.utils
    • Adjust Playback buttons
    • Always inject CSS; clean up watchers
    • CameraWatcher takes layout kwargs; move(t, r, quiet)
    • Added world.run(background=True)
    • world.stop()
    • world.status
    • display(format)
    • get_widget()
    Source code(tar.gz)
    Source code(zip)
  • v0.7.4(Mar 5, 2021)

  • v0.7.3(Mar 5, 2021)

    Major changes:

    • Allow robot.move(T, R) to ignore None values (to control one or the other)
    • Changed World.add_bulb() to take args, not Bulb object
    Source code(tar.gz)
    Source code(zip)
  • v0.7.2(Mar 4, 2021)

    Major changes:

    • Changed camera angle from 60 to 30
    • Changed colorsFadeWithDistance 0.5 to 0.9
    • Changed cameraShape from [256, 128] to [64, 32]
    • Changed robot.get_pose(), set_pose() and repr to be counter-clockwise positive
    • Renamed world.take_picture() to world.display()
    Source code(tar.gz)
    Source code(zip)
  • v0.7.1(Mar 3, 2021)

  • v0.7.0(Mar 2, 2021)

Multiple Imputation with Random Forests in Python

miceforest: Fast, Memory Efficient Imputation with lightgbm Fast, memory efficient Multiple Imputation by Chained Equations (MICE) with lightgbm. The

Samuel Wilson 202 Dec 31, 2022
Visualisation for sorting algorithms. Version 2.0

Visualisation for sorting algorithms v2. Upped a notch from version 1. This program provides animates simple, common and popular sorting algorithms, t

Ben Woo 7 Nov 08, 2022
This project is an implementation of a simple K-means algorithm

Simple-Kmeans-Clustering-Algorithm Abstract K-means is a centroid-based algorithm, or a distance-based algorithm, where we calculate the distances to

Saman Khamesian 7 Aug 09, 2022
Sign data using symmetric-key algorithm encryption.

Sign data using symmetric-key algorithm encryption. Validate signed data and identify possible validation errors. Uses sha-(1, 224, 256, 385 and 512)/hmac for signature encryption. Custom hash algori

Artur Barseghyan 39 Jun 10, 2022
Search algorithm implementations meant for teaching

Search-py A collection of search algorithms for teaching and experimenting. Non-adversarial Search There’s a heavy separation of concerns which leads

Dietrich Daroch 5 Mar 07, 2022
Tic-tac-toe with minmax algorithm.

Tic-tac-toe Tic-tac-toe game with minmax algorithm which is a research algorithm his objective is to find the best move to play by going through all t

5 Jan 27, 2022
Pathfinding visualizer in pygame: A*

Pathfinding Visualizer A* What is this A* algorithm ? Simply put, it is an algorithm that aims to find the shortest possible path between two location

0 Feb 26, 2022
Genetic Algorithm for Robby Robot based on Complexity a Guided Tour by Melanie Mitchell

Robby Robot Genetic Algorithm A Genetic Algorithm based Robby the Robot in Chapter 9 of Melanie Mitchell's book Complexity: A Guided Tour Description

Matthew 2 Dec 01, 2022
implementation of the KNN algorithm on crab biometrics dataset for CS16

crab-knn implementation of the KNN algorithm in Python applied to biometrics data of purple rock crabs (leptograpsus variegatus) to classify the sex o

Andrew W. Chen 1 Nov 18, 2021
marching Squares algorithm in python with clean code.

Marching Squares marching Squares algorithm in python with clean code. Tools Python 3 EasyDraw Creators Mohammad Dori Run the Code Installation Requir

Mohammad Dori 3 Jul 15, 2022
Given a list of tickers, this algorithm generates a recommended portfolio for high-risk investors.

RiskyPortfolioGenerator Given a list of tickers, this algorithm generates a recommended portfolio for high-risk investors. Working in a group, we crea

Victoria Zhao 2 Jan 13, 2022
This is a demo for AAD algorithm.

Asynchronous-Anisotropic-Diffusion-Algorithm This is a demo for AAD algorithm. The subroutine of the anisotropic diffusion algorithm is modified from

3 Mar 21, 2022
Using A * search algorithm and GBFS search algorithm to solve the Romanian problem

Romanian-problem-using-Astar-and-GBFS Using A * search algorithm and GBFS search algorithm to solve the Romanian problem Romanian problem: The agent i

Mahdi Hassanzadeh 6 Nov 22, 2022
A tictactoe where you never win, implemented using minimax algorithm

Unbeatable_TicTacToe A tictactoe where you never win, implemented using minimax algorithm Requirements Make sure you have the pygame module along with

Jessica Jolly 3 Jul 28, 2022
causal-learn: Causal Discovery for Python

causal-learn: Causal Discovery for Python Causal-learn is a python package for causal discovery that implements both classical and state-of-the-art ca

589 Dec 29, 2022
A selection of a few algorithms used to sort or search an array

Sort and search algorithms This repository has some common search / sort algorithms written in python, I also included the pseudocode of each algorith

0 Apr 02, 2022
Robotic Path Planner for a 2D Sphere World

Robotic Path Planner for a 2D Sphere World This repository contains code implementing a robotic path planner in a 2D sphere world with obstacles. The

Matthew Miceli 1 Nov 19, 2021
Using Bayesian, KNN, Logistic Regression to classify spam and non-spam.

Make Sure the dataset file "spamData.mat" is in the folder spam\src Environment: Python --version = 3.7 Third Party: numpy, matplotlib, math, scipy

0 Dec 26, 2021
Silver Trading Algorithm

Silver Trading Algorithm This project was done in the context of the Applied Algorithm Trading Course (FINM 35910) at the University of Chicago. Motiv

Laurent Lanteigne 1 Jan 29, 2022
Genetic algorithms are heuristic search algorithms inspired by the process that supports the evolution of life.

Genetic algorithms are heuristic search algorithms inspired by the process that supports the evolution of life. The algorithm is designed to replicate the natural selection process to carry generatio

Mahdi Hassanzadeh 4 Dec 24, 2022