X2 RL Training and Deployment
AgiBot X2 Humanoid Locomotion Reinforcement Learning Module — The Complete Pipeline from Training to Real-Robot Deployment
This chapter gives a complete walkthrough of the reinforcement-learning training and simulation-validation pipeline for the AgiBot X2 (lx2501 / T2.5, 29-DoF humanoid) locomotion module, together with the real-robot deployment workflow. Following it, developers can set up the environment from scratch, train and export their own policy model, validate it across physics engines, and deploy it to the real robot.
X2 URDF → Isaac Lab training (PPO) → ONNX export → MuJoCo Sim2Sim validation → real-robot deployment
Pipeline overview
Environment Setup — Setting up and self-checking the two environments: the training machine (conda / Isaac Lab) and the deployment machine (system Python / ROS2).
Training and Export — PPO training, the training recipe, checkpoint selection, and ONNX / JIT model export.
Sim2Sim Validation — Using MuJoCo to validate policy transferability across physics engines and to isolate the sim2real gap dimension by dimension.
Sim2Real Deployment — Step-by-step real-robot deployment, the state machine (FSM) and safety mechanisms, and fallback paths.
Code and assets are provided with the SDK package: the RL training and validation code lives under extra/mc-rl/ (a git submodule) in the SDK main repo; for the directory layout, see “Getting the Code” in Environment Setup. Throughout the following, code root directory refers to the root of the SDK main repo, and unless otherwise noted, commands are executed in that directory.
If extra/mc-rl/ is empty or missing, run the following command from the code root directory to fetch it:
git submodule update --init --recursive extra/mc-rl
The training framework is based on Unitree’s unitree_rl_lab (X2 reuses its mdp); the X2 code is packaged separately as agibot_rl_lab.
Warning
The examples and scripts in this chapter are for reference only and require your own parameter adaptation before they can be used on a real robot.
The default in-repo model (
extra/mc-rl/x2_deploy_pkg/models/policy.onnx) has passed real-robot validation across the full velocity range: forward / backward (cmd_vx −0.3 ~ 0.5 m/s), lateral (±0.3 m/s), and turning (±0.2 rad/s), and stays stable under composite commands and long-duration operation.The motor KP/KD values are a simulation recipe, not real-robot measured values; once real-robot system-identification values are obtained, they should be updated and the policy retrained accordingly.