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)

Policy Gradient Algorithms (One Step Actor Critic & PPO) from scratch using Numpy

Policy Gradient Algorithms From Scratch (NumPy) This repository showcases two policy gradient algorithms (One Step Actor Critic and Proximal Policy Op

1 Jan 17, 2022
Python-Strongest-Encrypter - Transform your text into encrypted symbols using their dictionary

How does the encrypter works? Transform your text into encrypted symbols using t

1 Jul 10, 2022
How on earth can I ever think of a solution like that in an interview?!

fuck-coding-interviews This repository is created by an awkward programmer who always struggles with coding problems on LeetCode, even with some Easy

Vinta Chen 613 Jan 08, 2023
This repository explores an implementation of Grover's Algorithm for knights on a chessboard.

Grover Knights Welcome to my Knights project! Project Description: I explore an implementation of a quantum oracle for knights on a chessboard.

Will Sun 8 Feb 22, 2022
This is a Python implementation of the HMRF algorithm on networks with categorial variables.

Salad Salad is an Open Source Python library to segment tissues into different biologically relevant regions based on Hidden Markov Random Fields. The

1 Nov 16, 2021
Fedlearn algorithm toolkit for researchers

Fedlearn algorithm toolkit for researchers

89 Nov 14, 2022
Programming Foundations Algorithms With Python

Programming-Foundations-Algorithms Algorithms purpose to solve a specific proplem with a sequential sets of steps for instance : if you need to add di

omar nafea 1 Nov 01, 2021
Official implementation of "Path Planning using Neural A* Search" (ICML-21)

Path Planning using Neural A* Search (ICML 2021) This is a repository for the following paper: Ryo Yonetani*, Tatsunori Taniai*, Mohammadamin Barekata

OMRON SINIC X 82 Jan 07, 2023
iAWE is a wonderful dataset for those of us who work on Non-Intrusive Load Monitoring (NILM) algorithms.

iAWE is a wonderful dataset for those of us who work on Non-Intrusive Load Monitoring (NILM) algorithms. You can find its main page and description via this link. If you are familiar with NILM-TK API

Mozaffar Etezadifar 3 Mar 19, 2022
Sorting Algorithm Visualiser using pygame

SortingVisualiser Sorting Algorithm Visualiser using pygame Features Visualisation of some traditional sorting algorithms like quicksort and bubblesor

4 Sep 05, 2021
Planning Algorithms in AI and Robotics. MSc course at Skoltech Data Science program

Planning Algorithms in AI and Robotics course T2 2021-22 The Planning Algorithms in AI and Robotics course at Skoltech, MS in Data Science, during T2,

Mobile Robotics Lab. at Skoltech 6 Sep 21, 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
A* (with 2 heuristic functions), BFS , DFS and DFS iterativeA* (with 2 heuristic functions), BFS , DFS and DFS iterative

Descpritpion This project solves the Taquin game (jeu de taquin) problem using different algorithms : A* (with 2 heuristic functions), BFS , DFS and D

Ayari Ahmed 3 May 09, 2022
A GUI visualization of QuickSort algorithm

QQuickSort A simple GUI visualization of QuickSort algorithm. It only uses PySide6, it does not have any other external dependency. How to run Install

Jaime R. 2 Dec 24, 2021
A Python library for simulating finite automata, pushdown automata, and Turing machines

Automata Copyright 2016-2021 Caleb Evans Released under the MIT license Automata is a Python 3 library which implements the structures and algorithms

Caleb Evans 219 Dec 12, 2022
A library for benchmarking, developing and deploying deep learning anomaly detection algorithms

A library for benchmarking, developing and deploying deep learning anomaly detection algorithms Key Features • Getting Started • Docs • License Introd

OpenVINO Toolkit 1.5k Jan 04, 2023
All algorithms implemented in Python for education

The Algorithms - Python All algorithms implemented in Python - for education Implementations are for learning purposes only. As they may be less effic

1 Oct 20, 2021
A priority of preferences for teacher assignment problem

Genetic-Algorithm-for-Assignment-Problem A priority of preferences for teacher assignment problem Keywords k-partition; clustering; education 4.0 Abst

hades 2 Oct 31, 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
RRT algorithm and its optimization

RRT-Algorithm-Visualisation This is a project that aims to develop upon the RRT

Sarannya Bhattacharya 7 Mar 06, 2022