Skip to content

pollen-robotics/reachy2-sdk

Repository files navigation

Python SDK for Reachy 2

Licence Code style: black linter pytest coverage Docs

Install

You can install the library either from Pypi, or by cloning the entire repository :

From PyPi
pip install reachy2-sdk -e .
From the source
git clone https://github.com/pollen-robotics/reachy2-sdk.git
cd reachy2-sdk
pip install -e .[dev]

The [dev] option includes tools for developers.

Usage

Check out the examples folder for jupyter notebooks and example scripts. You can also take a look on the Reachy2 Documentation, which provides a more detailed overview of the SDK's various functions.

Documentation

SDK Documentation is generated via pdoc, and it's available at https://pollen-robotics.github.io/reachy2-sdk/reachy2_sdk.html

It can be generated locally with:

pdoc reachy2_sdk --output-dir docs --logo "https://pollen-robotics.github.io/reachy2-sdk/pollen_logo.png" --logo-link "https://www.pollen-robotics.com" --docformat google

You maybe have to install pdoc first by running pip install pdoc.

The documentation relies on the provided docstrings with the google style. pydocstyle is used to enforced this style.

pydocstyle src/ --convention google --count

Unit tests

To ensure everything is functioning correctly, run the unit tests. There are two groups of tests: offline and online. Offline tests check internal functions using mock objects. Online tests require a connection to a simulated robot (e.g., in rviz), and the virtual robot should exhibit movement during these tests.

To execute the tests, use pytest with an optional category:

$ pytest [-m offline|online]

Note that only offline tests are executed by the Continuous Integration/Continuous Deployment (CI/CD) pipeline, as they don't require a gRPC connection.

Camera tests

Camera tests have their own marks because it requires the cameras to be plugged to the sdk server

$ pytest -m cameras

Logs

The SDK relies on the python logging system. Set the desired debug level to see messages from the SDK.

import logging
logging.basicConfig(level=logging.DEBUG)