Skip to main content

Python SDK for iRobot Edu robots

Project description

iRobot® Education Python® SDK

This is an installable Python SDK for the iRobot Education robots. It supports the iRobot® Root® rt0, Root® rt1 and Create® 3 educational robots.

This SDK uses a similar format as Learning Level 3 of the iRobot® Coding App (code.irobot.com) and the iRobot® Python Web Playground (python.irobot.com). As such, it uses async execution and is compatible with Python® 3.9 or greater. MicroPython may work, but it is not tested.

This SDK is designed to communicate with robots via Bluetooth® Low Energy on Windows®, macOS®, and Linux® systems. Experimental backends are provided for communicating over USB serial and USB on MicroPython boards with native USB ports. These are not currently supported.

Disclaimer: this is a BETA release.

The BETA version of the iRobot® Python SDK is provided “as is” to conduct testing and gather user feedback. There is no guarantee on its performance or compatibility, continued availability, or on a timeline for improvements.

Please do file issues as they are found, so that the team (or the community) can address them.

Installation using pip

pip3 install irobot_edu_sdk

Optional: Installation from Source

git clone https://github.com/iRobotEducation/irobot-edu-python-sdk.git

From the newly cloned SDK's directory, run:

pip3 install .

Usage

A robot object is created from one of the communication backends. This robot object has a number of event callbacks that can be registered and commands that can be sent to the robot. After a program is setup, the play() method will start execution and block until the robot's nose or power button is pressed, the robot is disconnected, or Ctrl-C is pressed.

Examples

A good way of getting started is by looking at the examples provided here.

These examples mirror the iRobot Education Python Web Playground.

Backend

Bluetooth

iRobot Education's robots communicate using a common Bluetooth Low Energy serial protocol, the details of which can be found here.

from irobot_edu_sdk.backend.bluetooth import Bluetooth

# Connect to robot over Bluetooth Low Energy.
backend0 = Bluetooth('') # Connects to the first BLE robot detected.
backend1 = Bluetooth('ROOT') # Use robot named 'ROOT'

ALPHA features

The features detailed below are included as ALPHA versions, which provide limited functionality and are likely to contain several known or unknown bugs. Support is not provided for ALPHA features at this time.

Serial

Some Root® robots support a serial port over USB.

from irobot_edu_sdk.backend.serial import Serial

# Connect to robot over USB-C cable.
backend = Serial('COM1')                          # Windows
backend = Serial('/dev/cu.usbmodemRT0123F456789') # macOS
backend = Serial('/dev/ttyACM0')                  # Linux

MicroPython

This SDK requires MicroPython firmware that includes the uasyncio library -- version 1.13 or greater. Download the latest release for your board from http://micropython.org/download. Then, copy the irobot_edu_sdk directory and all contents to the PYBFLASH drive.

from irobot_edu_sdk.backend.usb import USB

# Connect to robot from MicroPython-compatible board over USB.
backend = USB() # MicroPython-compatible board is powered from USB-C port

NOTE: You may need to use a USB-C to USB-A adapter or a USB-C to micro USB cable.

© 2022 iRobot Corporation. All rights reserved.

Attributions

  • Python® 3 is governed by and a trademark of the Python Software Foundation.
  • The Bluetooth® word mark and logos are registered trademarks owned by Bluetooth SIG, Inc. and any use of such marks by iRobot is under license.
  • Windows® is a trademark of Microsoft Corporation, registered in the U.S. and other countries and regions.
  • macOS® is a trademark of Apple Inc., registered in the U.S. and other countries and regions.
  • Linux® is a trademark of Linus Torvalds, registered in the U.S. and other countries and regions.
  • USB-C™ is a trademark of USB Implementers Forum.
  • All other trademarks mentioned are the property of their respective owners.

This library is made possible thanks to other community software. The following are direct required dependencies:

To build, the following is recommended:

  • Poetry, licensed under the MIT license, available here

The iRobot Education Python SDK provided is licensed under the 3-Clause BSD license, found here

Project details


Download files

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

Source Distribution

irobot_edu_sdk-0.1.2.tar.gz (19.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

irobot_edu_sdk-0.1.2-py3-none-any.whl (24.3 kB view details)

Uploaded Python 3

File details

Details for the file irobot_edu_sdk-0.1.2.tar.gz.

File metadata

  • Download URL: irobot_edu_sdk-0.1.2.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.9.7 Linux/5.15.0-56-generic

File hashes

Hashes for irobot_edu_sdk-0.1.2.tar.gz
Algorithm Hash digest
SHA256 73a8c7c079e66f31282e9993d6c277f7fecbfa52c9cea70c3f712bb08be571f2
MD5 2b3790cf989e11e346b01e231cca9ec7
BLAKE2b-256 922276539fb5eefbf2be5bb8741b50610b9225d9cd0286a414010a8157adfa5a

See more details on using hashes here.

File details

Details for the file irobot_edu_sdk-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: irobot_edu_sdk-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 24.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.9.7 Linux/5.15.0-56-generic

File hashes

Hashes for irobot_edu_sdk-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 505947e4a58ff5e6b65dfc110b06e18123f96117934727632cdbbb1e6813612b
MD5 b1608b006dd4ed8d85efb426edff6aff
BLAKE2b-256 a0563acc40573f7bb95337f272f73cc3d7047b764f14c460e409621e1d43d582

See more details on using hashes here.

Supported by

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