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)

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
Wordle-solver - A program that solves a Wordle using a simple algorithm

Wordle Solver A program that solves a Wordle using a simple algorithm. To see it

Luc Bouchard 3 Feb 13, 2022
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
A litle algorithm that i made for transform a picture in a spreadsheet.

PicsToSheets How it works? It is an algorithm designed to transform an image into a spreadsheet file. this converts image pixels to color cells of she

Guilherme de Oliveira 1 Nov 12, 2021
Better control of your asyncio tasks

quattro: task control for asyncio quattro is an Apache 2 licensed library, written in Python, for task control in asyncio applications. quattro is inf

Tin Tvrtković 37 Dec 28, 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
CLI Eight Puzzle mini-game featuring BFS, DFS, Greedy and A* searches as solver algorithms.

🕹 Eight Puzzle CLI Jogo do quebra-cabeças de 8 peças em linha de comando desenvolvido para a disciplina de Inteligência Artificial. Escrito em python

Lucas Nakahara 1 Jun 30, 2021
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

21 Dec 20, 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
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
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
Algorithms implemented in Python

Python Algorithms Library Laurent Luce Description The purpose of this library is to help you with common algorithms like: A* path finding. String Mat

Laurent Luce 264 Dec 06, 2022
This repository provides some codes to demonstrate several variants of Markov-Chain-Monte-Carlo (MCMC) Algorithms.

Demo-of-MCMC These files are based on the class materials of AEROSP 567 taught by Prof. Alex Gorodetsky at University of Michigan. Author: Hung-Hsiang

Sean 1 Feb 05, 2022
Gnat - GNAT is NOT Algorithmic Trading

GNAT GNAT is NOT Algorithmic Trading! GNAT is a financial tool with two goals in

Sher Shah 2 Jan 09, 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
HashDB is a community-sourced library of hashing algorithms used in malware.

HashDB HashDB is a community-sourced library of hashing algorithms used in malware. How To Use HashDB HashDB can be used as a stand alone hashing libr

OALabs 216 Jan 06, 2023
sudoku solver using CSP forward-tracking algorithms.

Sudoku sudoku solver using CSP forward-tracking algorithms. Description Sudoku is a logic-based game that consists of 9 3x3 grids that create one larg

Cindy 0 Dec 27, 2021
Python implementation of Aho-Corasick algorithm for string searching

Python implementation of Aho-Corasick algorithm for string searching

Daniel O'Sullivan 1 Dec 31, 2021
Esse repositório tem como finalidade expor os trabalhos feitos para disciplina de Algoritmos computacionais e estruturais do CEFET-RJ no ano letivo de 2021.

Exercícios de Python 🐍 Esse repositório tem como finalidade expor os trabalhos feitos para disciplina de Algoritmos computacionais e estruturais do C

Rafaela Bezerra de Figueiredo 1 Nov 20, 2021
A simple library for implementing common design patterns.

PyPattyrn from pypattyrn.creational.singleton import Singleton class DummyClass(object, metaclass=Singleton): # DummyClass is now a Singleton!

1.7k Jan 01, 2023