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)

zoofs is a Python library for performing feature selection using an variety of nature inspired wrapper algorithms. The algorithms range from swarm-intelligence to physics based to Evolutionary. It's easy to use ,flexible and powerful tool to reduce your feature size.

zoofs is a Python library for performing feature selection using a variety of nature-inspired wrapper algorithms. The algorithms range from swarm-intelligence to physics-based to Evolutionary. It's easy to use , flexible and powerful tool to reduce your feature size.

Jaswinder Singh 168 Dec 30, 2022
FingerPy is a algorithm to measure, analyse and monitor heart-beat using only a video of the user's finger on a mobile cellphone camera.

FingerPy is a algorithm using python, scipy and fft to measure, analyse and monitor heart-beat using only a video of the user's finger on a m

Thiago S. Brasil 37 Oct 21, 2022
This repository is an individual project made at BME with the topic of self-driving car simulator and control algorithm.

BME individual project - NEAT based self-driving car This repository is an individual project made at BME with the topic of self-driving car simulator

NGO ANH TUAN 1 Dec 13, 2021
Resilient Adaptive Parallel sImulator for griD (rapid)

Rapid is an open-source software library that implements a novel “parallel-in-time” (Parareal) algorithm and semi-analytical solutions for co-simulation of integrated transmission and distribution systems.

Richard Lincoln 7 Sep 7, 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 1, 2022
A fast, pure python implementation of the MuyGPs Gaussian process realization and training algorithm.

Fast implementation of the MuyGPs Gaussian process hyperparameter estimation algorithm MuyGPs is a GP estimation method that affords fast hyperparamet

Lawrence Livermore National Laboratory 13 Dec 2, 2022
Minimal pure Python library for working with little-endian list representation of bit strings.

bitlist Minimal Python library for working with bit vectors natively. Purpose This library allows programmers to work with a native representation of

Andrei Lapets 0 Jul 25, 2022
Distributed Grid Descent: an algorithm for hyperparameter tuning guided by Bayesian inference, designed to run on multiple processes and potentially many machines with no central point of control

Distributed Grid Descent: an algorithm for hyperparameter tuning guided by Bayesian inference, designed to run on multiple processes and potentially many machines with no central point of control.

Martin 1 Jan 1, 2022
There are some basic arithmatic in Pattern Recognization and Machine Learning writed in Python in this repository

There are some basic arithmatic in Pattern Recognization and Machine Learning writed in Python in this repository

null 1 Nov 19, 2021
Machine Learning algorithms implementation.

Machine Learning Algorithms Machine Learning algorithms implementation. What can I find here? ML Algorithms KNN K-Means-Clustering SVM (MultiClass) Pe

David Levin 1 Dec 10, 2021
Apriori - An algorithm for frequent item set mining and association rule learning over relational databases

Apriori Apriori is an algorithm for frequent item set mining and association rul

Mohammad Nazari 8 Jan 10, 2022
PICO is an algorithm for exploiting Reinforcement Learning (RL) on Multi-agent Path Finding tasks.

PICO is an algorithm for exploiting Reinforcement Learning (RL) on Multi-agent Path Finding tasks. It is developed by the Multi-Agent Artificial Intel

null 21 Dec 20, 2022
Algorithms-in-Python - Programs related to DSA in Python for placement practice

Algorithms-in-Python Programs related to DSA in Python for placement practice CO

MAINAK CHAUDHURI 2 Feb 2, 2022
Minimal examples of data structures and algorithms in Python

Pythonic Data Structures and Algorithms Minimal and clean example implementations of data structures and algorithms in Python 3. Contributing Thanks f

Keon 22k Jan 9, 2023
Repository for data structure and algorithms in Python for coding interviews

Python Data Structures and Algorithms This repository contains questions requiring implementation of data structures and algorithms concepts. It is us

Prabhu Pant 1.9k Jan 1, 2023
Python Sorted Container Types: Sorted List, Sorted Dict, and Sorted Set

Python Sorted Containers Sorted Containers is an Apache2 licensed sorted collections library, written in pure-Python, and fast as C-extensions. Python

Grant Jenks 2.8k Jan 4, 2023
:computer: Data Structures and Algorithms in Python

Algorithms in Python Implementations of a few algorithms and datastructures for fun and profit! Completed Karatsuba Multiplication Basic Sorting Rabin

Prakhar Srivastav 2.9k Jan 1, 2023
Python based framework providing a simple and intuitive framework for algorithmic trading

Harvest is a Python based framework providing a simple and intuitive framework for algorithmic trading. Visit Harvest's website for details, tutorials

null 100 Jan 3, 2023
Python Package for Reflection Ultrasound Computed Tomography (RUCT) Delay And Sum (DAS) Algorithm

pyruct Python Package for Reflection Ultrasound Computed Tomography (RUCT) Delay And Sum (DAS) Algorithm The imaging setup is explained in these paper

Berkan Lafci 21 Dec 12, 2022