Metadata-Version: 2.4
Name: chromapi
Version: 1.1.0
Summary: High-level software for the Chromapi 12-DOF quadruped robot
Author-email: Mowibox <ousmane.thiongane@outlook.com>
License-Expression: Apache-2.0 AND CC-BY-NC-SA-4.0
Project-URL: Homepage, https://mowibox.github.io/chroma/en/chromapi/
Project-URL: Documentation, https://mowibox.github.io/chroma/en/chromapi/
Project-URL: Source, https://github.com/Mowibox/chromapi
Project-URL: Issues, https://github.com/Mowibox/chromapi/issues
Project-URL: Firmware, https://github.com/Mowibox/chromapi_motherboard
Project-URL: Discord, https://discord.gg/SUQTs6QV3M
Keywords: robotics,quadruped,robot,raspberry-pi,mujoco,sdk
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: src/chromapi/model/LICENSE
Requires-Dist: numpy>=2.2.5
Requires-Dist: pyserial>=3.5
Requires-Dist: scipy<2.0.0,>=1.15.3
Requires-Dist: pyyaml>=6.0
Requires-Dist: opencv-contrib-python-headless>=4.13.0.92
Requires-Dist: waitress>=3.0.2
Requires-Dist: flask>=3.1.3
Requires-Dist: flask-socketio>=5.3.0
Requires-Dist: placo<1.0,>=0.9.25
Provides-Extra: audio
Requires-Dist: sounddevice>=0.4; extra == "audio"
Provides-Extra: sim
Requires-Dist: mujoco>=3.0; extra == "sim"
Provides-Extra: rl
Requires-Dist: onnxruntime>=1.16; extra == "rl"
Provides-Extra: hub
Requires-Dist: huggingface_hub>=0.25; extra == "hub"
Provides-Extra: all
Requires-Dist: chromapi[audio]; extra == "all"
Requires-Dist: chromapi[sim]; extra == "all"
Requires-Dist: chromapi[rl]; extra == "all"
Requires-Dist: chromapi[hub]; extra == "all"
Dynamic: license-file

<p align="center">
  <img alt="Chromapi logo" src="https://media.githubusercontent.com/media/Mowibox/chromapi/main/assets/chromapi_logo.png" width="220">
</p>

<h1 align="center">Chromapi</h1>

<p align="center">
  <em>An open-source 12-DoF quadruped robot that I design and build on my own.</em>
</p>

<p align="center">
  <a href="https://mowibox.github.io/chroma/en/chromapi/">Documentation</a> ·
  <a href="https://github.com/Mowibox/chromapi/tree/main/examples">Examples</a> ·
  <a href="https://discord.gg/SUQTs6QV3M">Discord</a> ·
  <a href="#contributions">Contributing</a>
</p>

<p align="center">
  <img alt="Chromapi software" src="https://custom-icon-badges.demolab.com/badge/Chromapi-software-a957f9?logo=chromapi">
  <img alt="Python 3.12+" src="https://img.shields.io/badge/Python-3.12+-blue?logo=python">
  <a href="https://github.com/Mowibox/chromapi/actions/workflows/lint.yml"><img alt="CI: Linters" src="https://github.com/Mowibox/chromapi/actions/workflows/lint.yml/badge.svg"></a>
  <a href="https://github.com/Mowibox/chromapi/actions/workflows/pytest.yml"><img alt="CI: Unit Tests" src="https://github.com/Mowibox/chromapi/actions/workflows/pytest.yml/badge.svg"></a>
  <img alt="Issues" src="https://img.shields.io/github/issues/Mowibox/chromapi">
  <a href="https://doi.org/10.5281/zenodo.24356978"><img alt="DOI" src="https://zenodo.org/badge/DOI/10.5281/zenodo.24356978.svg"></a>
  <img alt="Stars" src="https://img.shields.io/github/stars/Mowibox/chromapi?style=social">
</p>

<p align="center">
  <img alt="Chromapi dancing" src="https://media.githubusercontent.com/media/Mowibox/chromapi/main/assets/chromapi.gif"/>
</p>

## Getting started

Three ways in, each detailed on the [Chroma website](https://mowibox.github.io/chroma/en/chromapi/):

* **Build the robot:** print the parts and order the components from the [Bill of Materials](https://mowibox.github.io/chroma/en/chromapi/build/robot-bom/), then follow the [build guide](https://mowibox.github.io/chroma/en/chromapi/build/).
* **Set up a robot you have built:** flash the Chromapi OS image on a microSD card with Raspberry Pi Imager ([installation](https://mowibox.github.io/chroma/en/chromapi/getting-started/installation/)), then follow the [first start steps](https://mowibox.github.io/chroma/en/chromapi/getting-started/first-start/) and drive it from your phone with the [web app](https://mowibox.github.io/chroma/en/chromapi/getting-started/web-app/).
* **Program it, with or without a robot:** install the SDK below and start in [simulation](https://mowibox.github.io/chroma/en/chromapi/developing/simulation/).

### Installation

Requires Python 3.12 or later.

```bash
pip install "chromapi[all]"    # or, in a uv project: uv add "chromapi[all]"
```

Extras: `audio` enables sounds on the robot, `sim` installs MuJoCo for simulation, `rl` installs ONNX Runtime to run trained policies *(coming soon!)*, and `hub` downloads moves from Hugging Face datasets.

To contribute or run the examples, install from source instead:

```bash
git clone https://github.com/Mowibox/chromapi
cd chromapi
uv sync --all-extras    # or: pip install -e ".[all]"
```

### In simulation

```python
from chromapi.chromapi import Chromapi

with Chromapi(sim=True) as robot:  # starts the simulation if none runs
    robot.wake_up(wait=True)
    robot.walk_distance(0.3)  # [m]
    robot.rest()
```

`Chromapi()` drives the simulation open on your PC (`chromapi sim`), else the robot on your network: the same script runs on both.

More demos are in [`examples/`](https://github.com/Mowibox/chromapi/tree/main/examples) (run `chromapi sim` first to stay in simulation).

### On the real robot

On the Raspberry Pi, once the [motherboard firmware](https://github.com/Mowibox/chromapi_motherboard) is flashed:

```bash
chromapi motors setup             # interactive: set each servo's ID, one servo at a time
chromapi calibrate servos --all   # find each servo's center from its mechanical stops (lift the robot first)
chromapi calibrate imu            # measure the IMU board tilt, robot still on a level floor
chromapi health                   # what is wrong with the robot, and what to do about it
chromapi version                  # SDK, firmware and bridge protocol versions
chromapi update                   # install the latest release of the SDK, then restart Chromapi
chromapi flash                    # flash the motherboard firmware (lay the robot down first)
chromapi report                   # support report to attach to a message on Discord
```

`chromapi --help` lists every command (`python -m chromapi` works too).

At boot, `chromapid` (the daemon that owns the robot) and `chromapi run` (the web app, at `https://<robot-name>.local:5000`) start. Your scripts run with the app on, from the robot or a PC of its network. `chromapi run --sim` serves the web app on your PC, on the simulation.

## Project overview

| Resource | Description | Location | Status |
| :--- | :--- | :--- | :--- |
| **📋 Bill of Materials** | Complete hardware, electronics, and 3D-printed parts list to build Chromapi from scratch. | [Chroma Website](https://mowibox.github.io/chroma/en/chromapi/build/robot-bom/) | **Available** |
| **💻 Software API** | Python control framework, hardware interfaces, and kinematic solvers. | [`/src/chromapi`](https://github.com/Mowibox/chromapi/tree/main/src/chromapi) | **v1 Available** |
| **📐 CAD Model** | 3D mechanical design and robot assembly workspace. | [Onshape Document](https://cad.onshape.com/documents/3b2f6609101a115f427bb3a2/w/dda5699ddfe216cfbe74c22b/e/50bb405a7750d04ab1c412db?renderMode=0&uiState=6a7266a5caff22fc791d5f8b) | **Available** |
| **📖 Documentation** | Getting started, build guide, SDK tutorials, hardware specifications and communication protocol. | [Chroma Website](https://mowibox.github.io/chroma/en/chromapi/) | **Available** |
| **🛠️ Hardware Utilities** | `chromapi` command: health check, servo setup and calibration tools. | [`/src/chromapi/utils`](https://github.com/Mowibox/chromapi/tree/main/src/chromapi/utils) | **Available** |
| **🤖 Simulation Models** | URDF and MJCF models for MuJoCo simulation. | [`/src/chromapi/model`](https://github.com/Mowibox/chromapi/tree/main/src/chromapi/model) | **Available** |
| **⚡ Electronics** | Custom PCB files, schematics, and low-level firmware. | [`chromapi_motherboard` repository](https://github.com/Mowibox/chromapi_motherboard) | **Available** |

## Authors

| |
| :---: |
| <img src="https://github.com/Mowibox.png" width="100"> |
| [**Ousmane THIONGANE**](https://mowibox.github.io) |

## Sponsors & Acknowledgements

This project has been made possible thanks to the sponsors listed below. Their contributions in manufacturing, assembly, and prototyping have greatly accelerated the development of Chromapi.

<div align="center">

| | |
| :---: | :---: |
| <a href="https://www.pcbway.com"><img src="https://media.githubusercontent.com/media/Mowibox/chromapi/main/assets/pcbway.jpg" width="150" alt="PCBWay"></a> | <a href="https://www.ensea.fr"><img src="https://media.githubusercontent.com/media/Mowibox/chromapi/main/assets/ensea.jpg" width="150" alt="ENSEA"></a> |
| [**PCBWay**](https://www.pcbway.com) | [**ENSEA**](https://www.ensea.fr) |
| PCB Manufacturing & Assembly | 3D Printing & Prototyping |

</div>

---

> Huge thanks to everyone who gave me feedback on Chromapi's design, shared ideas, or simply took the time to brainstorm with me. This project wouldn't be where it is today without your help!

## Contributions

Contributions are always welcome!

* **Report Issues:** Found an error or have a feature request? Create a new issue [here](https://github.com/Mowibox/chromapi/issues/new/choose).
* **Fix Bugs & Add Features:** Find out where you can lend a hand by checking out [existing issues](https://github.com/Mowibox/chromapi/issues).

Before opening a pull request, don't forget to run the linters and unit tests: `uv run ruff check . && uv run mypy && uv run pytest`.

_By submitting a contribution, you agree that it is published under the license of the part it belongs to._

## Citation

If you use Chromapi in your research, please cite it as below:

```bibtex
@software{othiongane_chromapi,
  author  = {Thiongane, Ousmane},
  title   = {Chromapi: an open-source 12-DoF quadruped robot},
  month = nov,
  year    = {2026},
  version = {1.0.0},
  url     = {https://github.com/Mowibox/chromapi},
  doi     = {10.5281/zenodo.24356978}
  howpublished = "\url{https://github.com/Mowibox/chromapi}",
}
```

## License

This repository is multi-licensed:

| Part | Path | License |
| :--- | :--- | :--- |
| Software (Python SDK, tools, tests, Raspberry Pi setup) | [`/src`](https://github.com/Mowibox/chromapi/tree/main/src), [`/tests`](https://github.com/Mowibox/chromapi/tree/main/tests), [`/deploy`](https://github.com/Mowibox/chromapi/tree/main/deploy) | [Apache 2.0](https://github.com/Mowibox/chromapi/blob/main/LICENSE) |
| Robot description (URDF, MJCF, configuration files) | [`/src/chromapi/model`](https://github.com/Mowibox/chromapi/tree/main/src/chromapi/model) | [Apache 2.0](https://github.com/Mowibox/chromapi/blob/main/LICENSE) |
| 3D meshes (`.stl`, `.part`) | [`/src/chromapi/model/*/assets`](https://github.com/Mowibox/chromapi/tree/main/src/chromapi/model) | [CC BY-NC-SA 4.0](https://github.com/Mowibox/chromapi/blob/main/src/chromapi/model/LICENSE) |
| Documentation and media (README, images, GIFs) | [`/assets`](https://github.com/Mowibox/chromapi/tree/main/assets), this README | [CC BY-NC-SA 4.0](https://github.com/Mowibox/chromapi/blob/main/src/chromapi/model/LICENSE) |

**Third-party content keeps its own license:** meshes of off-the-shelf parts (Raspberry Pi 4, IMX219 camera, Noctua NF-A4x10 fan, WS2812B ring, 18650 battery, speaker, microswitch, power switch, connectors, screws) come from their respective manufacturers. The ENSEA and PCBWay logos in [`/assets`](https://github.com/Mowibox/chromapi/tree/main/assets) are trademarks of their respective owners.
