Minimal API for controlling Unitree robots in sim or on hardware using discrete actions.
The only intended entrypoint is examples/minimal_policy.py.
cd ~
git clone https://github.com/eclipse-cyclonedds/cyclonedds -b releases/0.10.x
cd cyclonedds && mkdir build install && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=../install
cmake --build . --target installgit clone https://github.com/Nabla7/brain-robot-interface.git
cd brain-robot-interface
uv sync
source .venv/bin/activateCYCLONEDDS_HOME="$HOME/cyclonedds/install" uv run mjpython examples/minimal_policy.pyCYCLONEDDS_HOME="$HOME/cyclonedds/install" uv run python examples/minimal_policy.pySet backend="robot" in the example script and run it normally:
CYCLONEDDS_HOME="$HOME/cyclonedds/install" uv run python examples/minimal_policy.pyfrom bri import Action, Controller
ctrl = Controller(
backend="sim",
hold_s=0.3,
forward_speed=0.6,
yaw_rate=1.5,
smooth_alpha=0.2,
)
ctrl.start()
ctrl.set_action(Action.FORWARD)backend:"sim"or"robot"hold_s: seconds to keep last action before auto-STOPforward_speed: forward velocityyaw_rate: rotation speedsmooth_alpha: smoothing factor (0–1)ctrl_hz: internal control loop rateinterface,domain_id: DDS settings for real robotmirror: whenbackend="robot", mirror view is enabled by default
- On macOS, use
mjpythonfor any MuJoCo window. - Robot mode requires DDS deps (e.g.,
cyclonedds) from Unitree SDK.