A pure-Python communication library, alternative SDK, and application for the Cozmo robot.
MIT License
PyCozmo
is a pure-Python communication library, alternative SDK, and application for the
Cozmo robot . It allows controlling a Cozmo robot directly, without
having to go through a mobile device, running the Cozmo app.
The library is loosely based on the Anki Cozmo Python SDK and the cozmoclad ("C-Like Abstract Data") library.
This project is a tool for exploring the hardware and software of the Digital Dream Labs (originally Anki) Cozmo robot. It is unstable and heavily under development.
Basic:
import time
import pycozmo
with pycozmo.connect() as cli:
cli.set_head_angle(angle=0.6)
time.sleep(1)
Advanced:
import pycozmo
cli = pycozmo.Client()
cli.start()
cli.connect()
cli.wait_for_robot()
cli.drive_wheels(lwheel_speed=50.0, rwheel_speed=50.0, duration=2.0)
cli.disconnect()
cli.stop()
https://pycozmo.readthedocs.io/
Sensors:
Actuators:
On-board functions (see docs/functions.md for details:
Off-board functions (see docs/offboard_functions.md for details:
Extra off-board functions:
If you have ideas for other functionality share them via GitHub.
Note: PyCozmo and pycozmo_protocol_generator.py
in particular could be used as a base for creating a Cozmo protocol
encoder code generator for languages other than Python (C/C++, Java, etc.).
Basic:
Advanced:
A Wi-Fi connection needs to be established with Cozmo before using PyCozmo applications.
This video summarizes the connection process.
A Cozmo SDK application (aka "game") acts as a client to the Cozmo app (aka "engine") that runs on a mobile device.
The low-level communication happens over USB and is handled by the cozmoclad
library.
In contrast, an application using PyCozmo basically replaces the Cozmo app and acts as the "engine". PyCozmo handles the low-level UDP communication with Cozmo.
+------------------+ +------------------+ +------------------+
| SDK app | Cozmo SDK | Cozmo app | Cozmo | Cozmo |
| "game" | cozmoclad | "engine" | protocol | "robot" |
| | ----------------> | Wi-Fi client | ----------------> | Wi-Fi AP |
| | USB | UDP client | UDP/Wi-Fi | UDP Server |
+------------------+ +------------------+ +------------------+
Using pip:
pip install --user pycozmo
pycozmo_resources.py download
From source:
git clone https://github.com/zayfod/pycozmo.git
cd pycozmo
python setup.py install --user
pycozmo_resources.py download
From source, for development:
git clone [email protected]:zayfod/pycozmo.git
cd pycozmo
python setup.py develop --user
pip install --user -r requirements-dev.txt
pycozmo_resources.py download
Bug reports and changes should be sent via GitHub:
https://github.com/zayfod/pycozmo
DDL Robot Discord server, channel #development-cozmo:
This project is not affiliated with Digital Dream Labs or Anki.