Skip to main content

A lightweight Python Robot simulator

Project description

aitk.robots

PyPI version CI build status

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

Goals

  1. A lightweight mobile robotics simulator
  2. Usable in the classroom, research, or exploration
  3. Explore wheeled robots with range, cameras, 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

A duck robot

Examples

There are pre-designed simulations ready to run, like this:

import aitk.robots
import random

world = aitk.robots.load("two-scribblers")

for robot in world.robots:
    # Give each robot a desired speed:
    robot.forward(1)

def control(world):
    for robot in world.robots:
        if robot.stalled:
	    # If stuck, just reverse:
            robot.reverse()
	# Turn randomly:
        robot.turn(1 - random.random() * 2)

# Watch the robots move in real time, or faster:
world.watch()
world.run(control, show=True, real_time=False)
# Press Control+C or interrupt the kernel to stop

You can also easily assemble your own simulations, robots, and sensors.

import aitk.robots

world = aitk.robots.World(width=100, height=100)
world.watch()

robot = aitk.robots.Scribbler()

world.add_robot(robot)

robot.add_device(aitk.robots.RangeSensor())
robot.add_device(aitk.robots.Camera())

world.save_as("world-1")

Installation

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

pip install aitk.robots

For just image processing on top of of the core, you will need:

  • Pillow - Python Image Library (PIL)

For the full set of options, you will need:

  • Pillow - Python Image Library (PIL)
  • ipywidgets
  • IPython

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 ipycanvas

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

jupyter nbextension enable --py widgetsnbextension

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

aitk.robots-0.8.11-py3-none-any.whl (98.6 kB view details)

Uploaded Python 3

File details

Details for the file aitk.robots-0.8.11-py3-none-any.whl.

File metadata

  • Download URL: aitk.robots-0.8.11-py3-none-any.whl
  • Upload date:
  • Size: 98.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.8.5

File hashes

Hashes for aitk.robots-0.8.11-py3-none-any.whl
Algorithm Hash digest
SHA256 a496ab306fd4757ccb39e38e41e7f67f6a29400d4813f69686e7d1659d659c0a
MD5 382d5940d18afe42bb05deef8547d547
BLAKE2b-256 ac8c1b2e3c8087e60d67d3dd91d4d38c89bad2bf9a584c2c79d24b437dd04e53

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page