Skip to content

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 onnxruntime

Run

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 sudo is needed (Python does not use a real-time thread).

Run with simulation

  1. From RBQ/ root, start the simulator:
    bash
    bash scripts/sim.bash
  2. In RBQGUI: ConnectAuto Start RobotStance (key 2).
  3. Run the example (network interface optional for loopback):
    bash
    python3 rbq_low_level.py -p ../../../../rbq_simulator/rbq_gym/policy/rbq10/

Keyboard controls

KeyAction
xStand up (ready posture)
zSit down (ground posture)
cStart walking (loads and runs policy)
qQuit

Policy directory

Pre-trained policies are included in the repository:

rbq_simulator/rbq_gym/policy/rbq10/
├── info.json
└── policy.onnx

Supported 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

StateHow to enterWhat happens
Idle(default)Mirrors the stack's final joint reference
Motionx or zCosine-interpolates to ready / ground posture
ControlcRuns ONNX policy at 10 Hz, publishes joint references

C++ version: Low Level (C++)

This user manual is intended for RBQ users.