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)

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

aitk.robots A lightweight Python robot simulator for JupyterLab, Notebooks, and other Python environments. Goals A lightweight mobile robotics simulat

3 Oct 22, 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
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

100 Jan 03, 2023
Algorithm and Structured Programming course project for the first semester of the Internet Systems course at IFPB

Algorithm and Structured Programming course project for the first semester of the Internet Systems course at IFPB

Gabriel Macaúbas 3 May 21, 2022
Pathfinding algorithm based on A*

Pathfinding V1 What is pathfindingV1 ? This program is my very first path finding program, using python and turtle for graphic rendering. How is it wo

Yan'D 6 May 26, 2022
This application solves sudoku puzzles using a backtracking recursive algorithm

This application solves sudoku puzzles using a backtracking recursive algorithm. The user interface is coded with Pygame to allow users to easily input puzzles.

Glenda T 0 May 17, 2022
A Python project for optimizing the 8 Queens Puzzle using the Genetic Algorithm implemented in PyGAD.

8QueensGenetic A Python project for optimizing the 8 Queens Puzzle using the Genetic Algorithm implemented in PyGAD. The project uses the Kivy cross-p

Ahmed Gad 16 Nov 13, 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 02, 2022
PickMush - A mini study/project on boosting algorithm

PickMush A mini project implementing Boosting Author Shashwat Vaibhav What does it do? Classifies whether Mushroom is edible or is non-edible (binary

Shashwat Vaibahav 3 Nov 08, 2022
BCI datasets and algorithms

Brainda Welcome! First and foremost, Welcome! Thank you for visiting the Brainda repository which was initially released at this repo and reorganized

52 Jan 04, 2023
So far implements A* will add more later

Pathfinding_Visualization Finds the shortest path between two nodes. The light blue path is the shortest path. The black nodes are barriers. Created i

Lukas DeLoach 1 Jan 18, 2022
A Python Package for Portfolio Optimization using the Critical Line Algorithm

A Python Package for Portfolio Optimization using the Critical Line Algorithm

19 Oct 11, 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
An open source algorithm and dataset for finding poop in pictures.

The shitspotter module is where I will be work on the "shitspotter" poop-detection algorithm and dataset. The primary goal of this work is to allow for the creation of a phone app that finds where yo

Jon Crall 29 Nov 29, 2022
Implemented page rank program

Page Rank Implemented page rank program based on fact that a website is more important if it is linked to by other important websites using recursive

Vaibhaw 6 Aug 24, 2022
Genius Square puzzle solver in Python

Genius Square puzzle solver in Python

James 3 Dec 15, 2022
Implementation for Evolution of Strategies for Cooperation

Moraliser Implementation for Evolution of Strategies for Cooperation Dependencies You will need a python3 (= 3.8) environment to run the code. Before

1 Dec 21, 2021
Data Model built using Logistic Regression Algorithm on Python.

Logistic-Regression Problem Statement: Your client is a retail banking institution. Term deposits are a major source of income for a bank. A term depo

Hemanth Babu Muthineni 0 Dec 25, 2021
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
Sorting-Algorithms - All information about sorting algorithm you need and you can visualize the code tracer

Sorting-Algorithms - All information about sorting algorithm you need and you can visualize the code tracer

Ahmed Hossam 15 Oct 16, 2022