|
| 1 | +# Reachy Mini OpenShell Research |
| 2 | + |
| 3 | +Minimal research scaffold for running a Reachy Mini backend inside an OpenShell sandbox while starting against the Reachy Mini MuJoCo simulator. |
| 4 | + |
| 5 | +## Current Shape |
| 6 | + |
| 7 | +- Host process: runs `reachy-mini-daemon --sim`, which starts the simulator and exposes the daemon API on port `8000`. |
| 8 | +- OpenShell process: runs this backend in a sandbox and connects to the host daemon through `host.openshell.internal:8000`. |
| 9 | +- First backend surface: `GET /health` for daemon reachability and `POST /moves/smoke` for a small head/antenna motion. |
| 10 | + |
| 11 | +## Local Simulator Quickstart |
| 12 | + |
| 13 | +On Linux, install the Reachy Mini GStreamer prerequisites before installing the SDK. The upstream guide lists the full package set and notes that Ubuntu 22.04 needs newer GStreamer packages. |
| 14 | + |
| 15 | +```bash |
| 16 | +cd projects/reachy-mini-openshell |
| 17 | +uv venv --python 3.12 |
| 18 | +source .venv/bin/activate |
| 19 | +uv pip install -e ".[backend,sim]" |
| 20 | +``` |
| 21 | + |
| 22 | +Start the simulator: |
| 23 | + |
| 24 | +```bash |
| 25 | +reachy-mini-daemon --sim --scene minimal |
| 26 | +``` |
| 27 | + |
| 28 | +In another terminal: |
| 29 | + |
| 30 | +```bash |
| 31 | +source .venv/bin/activate |
| 32 | +python -m reachy_openshell.smoke |
| 33 | +python -m reachy_openshell.backend |
| 34 | +``` |
| 35 | + |
| 36 | +Then probe the backend: |
| 37 | + |
| 38 | +```bash |
| 39 | +curl http://127.0.0.1:8080/health |
| 40 | +curl -X POST http://127.0.0.1:8080/moves/smoke |
| 41 | +``` |
| 42 | + |
| 43 | +On macOS, the Reachy docs recommend launching the simulator with `mjpython` instead: |
| 44 | + |
| 45 | +```bash |
| 46 | +mjpython -m reachy_mini.daemon.app.main --sim |
| 47 | +``` |
| 48 | + |
| 49 | +## OpenShell Sandbox Path |
| 50 | + |
| 51 | +For the sandboxed backend to reach a host-level simulator, bind the Reachy daemon to an interface visible from containers: |
| 52 | + |
| 53 | +```bash |
| 54 | +reachy-mini-daemon --sim --scene minimal --fastapi-host 0.0.0.0 --fastapi-port 8000 |
| 55 | +``` |
| 56 | + |
| 57 | +If your installed daemon exposes different flag names, check `reachy-mini-daemon --help`; the important part is that the daemon is reachable from the sandbox at `host.openshell.internal:8000`. |
| 58 | + |
| 59 | +Build and run the backend in OpenShell: |
| 60 | + |
| 61 | +```bash |
| 62 | +openshell status |
| 63 | +openshell sandbox create \ |
| 64 | + --name reachy-mini-backend \ |
| 65 | + --from . \ |
| 66 | + --policy openshell/policy.local-sim.yaml \ |
| 67 | + --env REACHY_HOST=host.openshell.internal \ |
| 68 | + --env REACHY_PORT=8000 \ |
| 69 | + --env REACHY_CONNECTION_MODE=network \ |
| 70 | + -- python3 -m reachy_openshell.backend --host 0.0.0.0 --port 8080 |
| 71 | +``` |
| 72 | + |
| 73 | +Expose the backend service: |
| 74 | + |
| 75 | +```bash |
| 76 | +openshell service expose reachy-mini-backend 8080 |
| 77 | +``` |
| 78 | + |
| 79 | +The sandbox image installs the Linux system packages needed by the Reachy SDK before installing the Python package. |
| 80 | + |
| 81 | +## Layout |
| 82 | + |
| 83 | +- `src/reachy_openshell/smoke.py`: SDK smoke motion for the simulator or a real robot daemon. |
| 84 | +- `src/reachy_openshell/backend.py`: small FastAPI backend for health checks and the smoke motion. |
| 85 | +- `openshell/policy.local-sim.yaml`: starter OpenShell policy allowing Python to reach the host simulator daemon. |
| 86 | +- `Dockerfile`: OpenShell sandbox image for the backend, based on the OpenShell community base sandbox. |
| 87 | + |
| 88 | +## References |
| 89 | + |
| 90 | +- Reachy Mini simulator setup: https://huggingface.co/docs/reachy_mini/en/platforms/simulation/get_started |
| 91 | +- Reachy Mini Linux GStreamer prerequisites: https://huggingface.co/docs/reachy_mini/en/SDK/gstreamer-installation |
| 92 | +- Reachy Mini SDK API: https://huggingface.co/docs/reachy_mini/en/API/reachymini |
| 93 | +- OpenShell overview: https://docs.nvidia.com/openshell/about/overview |
| 94 | +- OpenShell sandbox management: https://docs.nvidia.com/openshell/sandboxes/manage-sandboxes |
| 95 | +- OpenShell policy reference: https://docs.nvidia.com/openshell/reference/policy-schema |
0 commit comments