Overview#
This page takes you through getting started with RP1 from scratch. Choose one of three paths based on what you have available:
| Path | What you need | What you will achieve |
|---|---|---|
| A. Explore RP1 in simulation | A computer that can run Python | Open the RP1 model in MuJoCo and make it move with a Python script |
| B. Train your first policy | A Linux or Windows workstation with an NVIDIA GPU | Train a walking policy in Isaac Lab and validate it in MuJoCo |
| C. Run the real robot for the first time | An RP1 with the 24-axis configuration, a gamepad, and a safety suspension rig | Make RP1 walk under gamepad control using the policy included in the deployment repository |
The three paths are independent, so you can start with any of them. They ultimately connect to the same development workflow: model → training → export → Sim2Sim → real robot.
A. Explore RP1 in simulation#
This path requires neither a robot nor a GPU. You will open the RP1 model in MuJoCo, then run a script to swing its arms while it is held by a simulated "suspension rig."
Prerequisites#
- Python 3 (3.10 or later recommended)
- Internet access to install pip packages
- macOS, Linux, or Windows
A1. Install MuJoCo#
pip install mujocoA2. Get the RP1 model#
RP1_description is a public repository containing URDF, MJCF, and mesh files:
git clone https://github.com/Roboparty/RP1_description.git
cd RP1_descriptionThe repository contains these MuJoCo models:
| File | Contents |
|---|---|
mjcf/rp1_flat.xml |
28-axis robot with a flat-ground scene |
mjcf/rp1_rough.xml |
28-axis robot with a rough-terrain scene |
mjcf/robot.xml |
28-axis robot only |
mjcf/robot_24dof.xml |
24-axis robot only, without a ground plane |
A3. Open the viewer#
python -m mujoco.viewer --mjcf=mjcf/rp1_flat.xmlRP1 will appear standing on flat ground, then fall over. This is normal: all joint actuators in the model are torque motors. Without a controller sending commands, the robot goes limp as though its power were off.
In the viewer, you can:
- Press Space to pause or resume the simulation;
- Double-click a part to select it, then hold Ctrl + right mouse button and drag to apply a force;
- Inspect joint angles in the Joint panel on the right and actuators in the Control panel.
To view the 24-axis model, change the file to mjcf/robot_24dof.xml. This file contains only the robot, without a ground plane, so it will keep falling. It is suitable for inspecting the structure while paused.
A4. Make it move#
The following script simulates a suspension rig: it fixes the robot's base at its initial height, then uses PD control to swing both shoulder joints back and forth. Save it as rp1_hold_demo.py in the root of the RP1_description repository:
"""RP1 MuJoCo 演示:把机身固定在初始位置(相当于吊架),用 PD 控制让手臂摆动。
仅用于查看模型和关节运动,增益是仿真演示值,不是实机参数。"""
import math
import sys
import time
import mujoco
import mujoco.viewer
SCENE = sys.argv[1] if len(sys.argv) > 1 else "mjcf/rp1_flat.xml"
KP, KD = 80.0, 2.0 # 仿真演示用增益
m = mujoco.MjModel.from_xml_path(SCENE)
d = mujoco.MjData(m)
mujoco.mj_forward(m, d)
base_qpos = d.qpos[:7].copy() # 自由关节:位置 xyz + 四元数 wxyz
# 每个执行器驱动的关节在 qpos / qvel 中的位置
joint_ids = m.actuator_trnid[:, 0]
qadr = m.jnt_qposadr[joint_ids]
vadr = m.jnt_dofadr[joint_ids]
names = [m.actuator(i).name for i in range(m.nu)]
print(f"{SCENE}: {m.nu} 个执行器")
def target(name: str, t: float) -> float:
"""肩部 pitch 做正弦摆动,其余关节保持零位。"""
if name.endswith("shoulder_pitch_joint"):
return 0.6 * math.sin(2 * math.pi * 0.5 * t)
return 0.0
def step() -> None:
q = d.qpos[qadr]
dq = d.qvel[vadr]
q_ref = [target(n, d.time) for n in names]
d.ctrl[:] = [KP * (r - qi) - KD * dqi for r, qi, dqi in zip(q_ref, q, dq)]
mujoco.mj_step(m, d)
d.qpos[:7] = base_qpos # 固定机身
d.qvel[:6] = 0.0
if "--headless" in sys.argv:
while d.time < 2.0:
step()
i = names.index("left_shoulder_pitch_joint")
print(f"t={d.time:.2f}s left_shoulder_pitch q={d.qpos[qadr[i]]:+.3f} rad, 目标 {target(names[i], d.time):+.3f} rad")
else:
with mujoco.viewer.launch_passive(m, d) as viewer:
while viewer.is_running():
start = time.time()
step()
viewer.sync()
time.sleep(max(0.0, m.opt.timestep - (time.time() - start)))Run it:
python rp1_hold_demo.py mjcf/rp1_flat.xmlTip On macOS, run this script with
mjpythoninstead ofpython. This is a requirement of MuJoCo's passive viewer on macOS.
You will see RP1's base held at its initial position, its legs straight, and both arms swinging back and forth at 0.5 Hz with an amplitude of about ±0.6 rad. To use the 24-axis model, change the argument to mjcf/robot_24dof.xml.
Without a graphical interface, add --headless to run for just 2 seconds and print the result:
mjcf/rp1_flat.xml: 28 个执行器
t=2.00s left_shoulder_pitch q=-0.040 rad, 目标 +0.009 radThe actual value in the last line lags behind the target because of PD tracking lag with the demo gains. This is normal. Modify the target() function to make any joint follow a trajectory of your choice.
B. Train your first policy#
This path trains a flat-ground walking policy for RP1 in Isaac Lab, then exports it to MuJoCo to check whether it also works in another physics engine.
Prerequisites#
| Item | Requirement |
|---|---|
| Operating system | Ubuntu 22.04 x64 or Windows x64 |
| Graphics card | NVIDIA GPU, with drivers and CUDA that meet Isaac Sim's requirements |
| Python | 3.11 |
| Simulation | Isaac Sim 5.1.0, Isaac Lab 2.3.2 |
First install Isaac Sim and Isaac Lab using the official Isaac Lab installation guide. Run all commands below in the Python environment used by Isaac Lab.
B1. Get the training code#
Clone the repository outside the Isaac Lab source directory:
git clone https://github.com/Roboparty/roboparty_train.git
cd roboparty_trainThe repository contains two directories: robolab (RoboParty's Isaac Lab extension, tasks, and robot assets) and rsl_rl (the reinforcement learning library).
B2. Install#
pip install -e ./robolab
pip install -e ./rsl_rlConfirm that the RP1 tasks are registered (on Linux):
grep -rn 'id="RP1.3' robolab/robolab/tasksYou should see RP1.3-Flat, RP1.3-Rough, RP1.3-AMP, RP1.3-AMP-Play, and RP1.3-BeyondMimic.
Note The repository's
list_envs.pyonly lists tasks with "RPO" in their names. RP1 tasks will not appear there; this does not mean the installation failed.
B3. Run a workflow check first#
Use 1 environment and 1 iteration to confirm that Isaac Sim starts, the task loads, and training runs:
python robolab/scripts/rsl_rl/train.py --task=RP1.3-Flat --headless \
--logger=tensorboard --num_envs=1 --max_iterations=1Expected result: the program exits normally and creates a timestamped run directory under logs/rsl_rl/rp1.3_flat/. This run only checks the environment and is not intended for deployment.
B4. Run the full training#
Remove the two parameters used for the workflow check to use the task's default configuration:
python robolab/scripts/rsl_rl/train.py --task=RP1.3-Flat --headless --logger=tensorboardThe defaults are 4096 parallel environments and 9001 iterations, with a checkpoint saved every 1000 iterations. If GPU memory is insufficient, reduce the number of parallel environments with --num_envs; adjust the training length with --max_iterations.
During training, use TensorBoard to monitor reward curves:
tensorboard --logdir logs/rsl_rl/rp1.3_flatEach run directory contains checkpoints, along with params/env.yaml and params/agent.yaml, which record the configuration for that training run.
Tip To train on rough terrain, switch the task to
RP1.3-Rough. Logs will be written tologs/rsl_rl/rp1.3_rough/.
B5. Play back and export the policy#
After training, choose a checkpoint to play back:
python robolab/scripts/rsl_rl/play.py --task=RP1.3-Flat --num_envs=1 \
--checkpoint logs/rsl_rl/rp1.3_flat/<run 目录>/model_<迭代数>.ptThe Isaac Sim window will show RP1 walking according to velocity commands. play.py also automatically exports two files to exported/ under the checkpoint's directory:
| File | Format | Purpose |
|---|---|---|
policy.pt |
TorchScript | MuJoCo Sim2Sim |
policy.onnx |
ONNX | Deployment on the real robot |
Observation normalization parameters are bundled into both files and do not need to be saved separately.
B6. Run Sim2Sim in MuJoCo#
Run this from the repository root:
python robolab/scripts/mujoco/sim2sim_rp1.3.py \
--load_model logs/rsl_rl/rp1.3_flat/<run 目录>/exported/policy.ptReplace --load_model with the actual path to exported/policy.pt from the previous step. The script opens a MuJoCo window and lets your trained policy control the 24-axis RP1.
A few notes:
- The default command is to turn in place. In
robolab/scripts/mujoco/sim2sim_rpo.py, velocity commands are defined in thecmdclass, with defaults ofvx = 0.0,vy = 0.0, anddyaw = 0.8. The robot will rotate in place at 0.8 rad/s. Change these values to make it walk forward. - Output files. The script runs according to its configuration, with a default simulation duration of 1000 seconds. When it finishes, it saves
joint_positions.pngandbase_velocities.pngin the current working directory. Adding--headlessdisables the window and records the rendered video tosimulation.mp4in that directory. - Rough terrain. Add
--terrainto use the rough-terrain scene. - Missing dependencies. If
mujoco_viewerorcv2cannot be found, installmujoco-python-vieweroropencv-python, respectively.
Note The
rp1_flat.xmlused by Sim2Sim comes from roboparty_train and references the 24-axis model. The file with the same name in RP1_description references the 28-axis model. Do not interchange them.
Stable walking in Sim2Sim shows that the policy can tolerate some differences between physics engines. This is a necessary step before running it on the real robot. Moving from simulation to hardware also requires checking joint directions, zero positions, IMU mounting orientation, feedback latency, and other factors. Passing Sim2Sim does not guarantee that the real robot will walk.
C. Run the real robot for the first time#
This path uses the 24-axis policy included in the roboparty_deploy repository to make RP1 stand and walk under gamepad control.
Caution: read this section before powering on
- Zero calibration, reset, and the first inference run can all cause motors to apply torque suddenly. Perform these operations on a load-bearing safety suspension rig, with the robot suspended, the area clear, and someone supervising.
- If you notice abnormal shaking, an unexpected gait, or mechanical interference during operation, press X on the gamepad immediately to disable the motors. If the software does not respond, press the physical emergency stop immediately to cut power.
- The gamepad's X button and the
stop_inferenceservice are software stops and cannot replace a physical emergency stop. Before starting, confirm that the emergency stop is within reach and works properly.- RoboParty's published Safety Operation Guide covers the previous-generation Roboto Origin, which shares RP1's deployment software and gamepad controls. Read it as well.
Prerequisites#
| Item | Requirement |
|---|---|
| Robot | Fully assembled RP1 in the 24-axis configuration, with 5-DOF arms |
| Main controller operating system | Ubuntu 22.04 + ROS 2 Humble |
| Gamepad | An XInput-compatible gamepad, with its receiver plugged into a USB port on the main controller |
| Test area | A load-bearing safety suspension rig, a level floor, and a physical emergency stop within easy reach |
| Connection | SSH access to the main controller over Ethernet or Wi-Fi |
C1. Install dependencies#
Install the build and runtime dependencies on the main controller:
sudo apt update
sudo apt install -y ccache libfmt-dev libspdlog-dev libeigen3-dev screen
sudo apt install -y ros-humble-joy
sudo apt install -y python3-yaml python3-numpyThe second installation line installs the gamepad driver; the third installs dependencies for Python scripts such as zero calibration.
Allow real-time priority for the current user. Edit /etc/security/limits.conf and append these two lines, replacing <用户名> with the username you use to log in to the main controller:
<用户名> - rtprio 98
<用户名> - memlock unlimitedReboot the main controller, then check:
ulimit -rAn output of 98 confirms the configuration is successful.
C2. Get and build the deployment code#
git clone https://github.com/Roboparty/roboparty_deploy.git
cd roboparty_deploy
source /opt/ros/humble/setup.bash
colcon build --symlink-install
source install/setup.bashinstall/setup.bash is generated by the build and will only exist after the first successful compilation. Whenever you open a new terminal, run both source commands again:
source /opt/ros/humble/setup.bash
source install/setup.bashC3. Check the device interfaces#
RP1's motors connect to 4 CAN-FD buses, while the IMU uses a separate CAN interface. The 24-axis configuration (src/inference/robots/rp1_24dof/robot.yaml) uses the following interfaces:
| Interface | Connected devices |
|---|---|
can1 |
6 left-leg motors + waist Yaw |
can2 |
6 right-leg motors + waist Roll |
can0 |
5 left-arm motors |
can3 |
5 right-arm motors |
can_hipnuc |
IMU (HiPNUC) |
After powering on, list the network interfaces and confirm that all 5 interfaces above are present:
ip -brief linkThen inspect the detailed status and transmit/receive statistics of an interface, replacing can0 with the interface you want to check:
ip -details -statistics link show can0These two commands only read status and do not send any commands to the motors.
C4. Confirm the zero positions#
Motor zero positions define which physical pose corresponds to "0 degrees" in software. Incorrect zero positions will offset every movement commanded by the policy. Skip this step if the robot's zero positions have already been calibrated. Recalibrate after the initial assembly, motor replacement or servicing, or loss of the stored zero positions.
To calibrate each motor individually, suspend the robot on the rig, then run:
python3 scripts/set_zero.pyThe script processes the motors in the order specified in scripts/config/set_zero.yaml, which already matches the RP1 24-axis bus and motor IDs. It switches the motors to damping mode so you can position them by hand. Follow the prompts to move the current motor to its zero position, press Enter to save it, or press Space to skip it.
Note In
robot.yaml,motor_zero_offsetrecords each motor's offset relative to its zero-calibration pose. These offsets correspond directly to how the joints are positioned during calibration. Before recalibrating, confirm that your calibration poses match these offsets; otherwise, the robot will assume an incorrect pose after reset.
C5. Start the deployment software#
Confirm that the robot is suspended on the rig and its motors are disabled, then run this from the repository root:
./tools/start_robot.sh --robot rp1_24dof --policy defaultNote Always specify
--robot rp1_24dof. Both the script and the launch file default torpo, the previous-generation robot. Omitting this option loads the wrong configuration.
The script first builds the workspace, then starts two screen sessions in the background:
| Session | Contents |
|---|---|
inference_session |
Inference node: reads sensors, runs the policy, and sends joint commands |
joy_session |
Gamepad node |
Finally, it prints a message that all components have started successfully in the background, followed by the gamepad controls. View the inference node's output:
screen -r inference_sessionAfter confirming that there are no errors, press Ctrl + A, then D to detach. The node continues running in the background.
C6. Make RP1 stand and walk with the gamepad#
| Button | Function |
|---|---|
| X | Enable / disable motors |
| A | Reset: smoothly move joints to the default standing pose |
| B | Start / pause inference |
| Right stick | Move forward, backward, left, or right |
| LT / RT | Turn left / right |
| Y | Switch between gamepad control and the /cmd_vel topic |
Follow these steps in order:
- Enable. With the robot still suspended on the rig, press X to enable the motors. After confirming everything is normal, you can press X again to test disabling them, then re-enable them.
- Reset. First position the robot approximately in a standing pose by hand, then press A. The joints will move smoothly to their default standing angles. The farther the starting pose is from the default, the more pronounced the reset movement will be.
- Lower to the floor. After reset completes, lower the robot steadily from the rig. Confirm that both feet are firmly on the ground and its center of gravity is centered. Keep the rig's support line within reach.
- Clear the gamepad inputs. Before pressing B, move each stick fully in all four directions and release it, then press LT and RT several times. This clears stick drift to prevent residual commands when inference starts.
- Start inference. Press B. RP1 will balance while standing in place.
- Walk. Gently move the right stick to walk forward, backward, or sideways, and use LT / RT to turn. The default policy's command limits are: forward 0.6 m/s, backward 0.4 m/s, sideways 0.4 m/s, and turning 0.8 rad/s.
- Stop. Press B to pause inference, then support or suspend the robot before pressing X to disable the motors.
C7. Shut down the software#
screen -S inference_session -X quit
screen -S joy_session -X quitThis only ends the software sessions. Before shutting them down, confirm that the motors are disabled and the robot is supported.
If the robot suddenly disables its motors and goes limp during inference, leave the setup as it is and inspect the errors with screen -r inference_session. Common causes include software limits, such as joint position or velocity limits, and hardware protection, such as overload, overheating, or undervoltage. Save the error logs before cutting power to help diagnose the issue.
C8. Control without a gamepad: use ROS 2 services#
The deployment software also provides ROS 2 services for scripting or remote debugging. Load the environment in a new terminal, then call them:
source /opt/ros/humble/setup.bash
source install/setup.bash
ros2 service call /init_motors std_srvs/srv/Trigger # 初始化电机
ros2 service call /start_inference std_srvs/srv/Trigger # 开始推理
ros2 service call /stop_inference std_srvs/srv/Trigger # 停止推理
ros2 service call /deinit_motors std_srvs/srv/Trigger # 电机去初始化After pressing Y to switch to /cmd_vel control, you can send velocity commands through the /cmd_vel topic using geometry_msgs/msg/Twist. To inspect the current joint states:
ros2 topic echo /joint_statesC9. Try the dance#
The deployment repository also includes a 24-axis motion-tracking policy and a dance motion. Start it in the same way:
./tools/start_robot.sh --robot rp1_24dof --policy beyondmimicThis configuration loads both the default walking policy and the dance policy. Once inference has started, press LB to switch between walking and motion tracking, and RB to switch motion sequences. Use the suspension rig for the first dance run as well, and check the range of motion before lowering the robot to the floor.