Prerequisites
Python 3.13+
rfx requires Python 3.13 or later
Rust toolchain
Install via rustup.rs
For development or source installation, see the Installation guide.
import torch
import rfx
@rfx.policy
def hold_position(obs):
"""Hold the robot still."""
return torch.zeros(1, 64) # 64-dim action space
@rfx.policy
def grasp(obs):
return rfx.MotorCommands(
{"gripper": 0.8, "wrist_pitch": -0.2},
config=rfx.SO101_CONFIG,
).to_tensor()
The mock robot runs a simple physics simulation with the same
observe(), act(), reset() interface as real hardware.# From a local checkpoint
rfx deploy runs/my-policy --robot so101
# From HuggingFace Hub
rfx deploy hf://rfx-community/go2-walk-v1 --robot go2
# Control the duration
rfx deploy runs/my-policy --robot so101 --duration 30
Always test with
--mock first to validate policy outputs and control loop timing before deploying to real hardware.Complete example
Here’s a full workflow from policy definition to deployment:deploy_example.py
The robot interface
Every robot in rfx implements the same three methods:rfx.RealRobot- Hardware via serial/ethernetrfx.SimRobot- Genesis, MJX, or other backendsrfx.MockRobot- Zero-dependency physics model
Next steps
Installation
Learn about all installation methods and optional dependencies
Python SDK
Explore the full Python API reference
SO-101 Setup
Configure and calibrate your SO-101 arm
Simulation
Set up Genesis, MJX, or other sim backends
