Low Level (RL Policy) Python — Quick Start
Source: rbq_sdk/python/example/sport/rbq_low_level.py
Python port of the C++ rbq_low_level example. Loads an RL policy (info.json + policy.onnx) and drives leg joints via low-level joint control at 10 Hz.
Install
bash
cd RBQ/rbq_sdk/python
pip install -e .
pip install onnxruntimeRun
bash
cd RBQ/rbq_sdk/python/example/low_level
python3 rbq_low_level.py -p <policyDir> [networkInterface]bash
# Simulation (loopback — networkInterface can be omitted)
python3 rbq_low_level.py -p ../../../../rbq_simulator/rbq_gym/policy/rbq10/
# Real robot
python3 rbq_low_level.py -p ../../../../rbq_simulator/rbq_gym/policy/rbq10/ eth0-p is required — pass a directory containing info.json and policy.onnx.
Unlike the C++ version, no
sudois needed (Python does not use a real-time thread).
Run with simulation
- From
RBQ/root, start the simulator:bashbash scripts/sim.bash - In RBQGUI: Connect → Auto Start Robot → Stance (key
2). - Run the example (network interface optional for loopback):bash
python3 rbq_low_level.py -p ../../../../rbq_simulator/rbq_gym/policy/rbq10/
Keyboard controls
| Key | Action |
|---|---|
x | Stand up (ready posture) |
z | Sit down (ground posture) |
c | Start walking (loads and runs policy) |
q | Quit |
Policy directory
Pre-trained policies are included in the repository:
rbq_simulator/rbq_gym/policy/rbq10/
├── info.json
└── policy.onnxSupported policy names (from info.json): rbq10, rbq10_trot, rbq10_trot_run.
Trained your own policy with Isaac Gym or Isaac Lab?
Point -p at the exported directory (policy.onnx + info.json).
State machine
| State | How to enter | What happens |
|---|---|---|
| Idle | (default) | Mirrors the stack's final joint reference |
| Motion | x or z | Cosine-interpolates to ready / ground posture |
| Control | c | Runs ONNX policy at 10 Hz, publishes joint references |
→ C++ version: Low Level (C++)
