Results Showcase
This document briefly introduces how to use Leju's two open-source repositories, LejuLab-Train and LejuLab-Deploy, to conduct reinforcement learning training and deployment for Roban and Kuavo robots.
Results Showcase
| tasks | Isaac Lab | Mujoco | sim2real |
|---|---|---|---|
| roban_dance | ![]() | ![]() | ![]() |
| kuavo_dance | ![]() | ![]() | ![]() |
| roban_standup | ![]() | ![]() | ![]() |
| roban_rl_walk | ![]() | ![]() | ![]() |
📚 Table of Contents
- 📝 Case Description
- 🧩 Framework Diagram
- 🔧 Hardware Configuration
- 🤖 Full Workflow of Robot Reinforcement Learning Training
- 🔗 Full Workflow of Robot Model Deployment
📝 Case Description
This case introduces how to use Leju's two open-source repositories, LejuLab-Train and LejuLab-Deploy, to train and deploy Roban and Kuavo robots.
(1) LejuLab-Train is a comprehensive robot simulation and reinforcement learning framework built on Isaac Lab. The framework provides a complete development toolchain for Roban2 and Kuavo 5 humanoid robots, including motion data processing, reinforcement learning training, and simulation environment management. It includes two types of tasks: tracking tasks (motion imitation) and velocity tasks (locomotion control).
(2) LejuLab-Deploy is a humanoid robot reinforcement learning deployment and development platform developed by Leju Robotics. It provides simulation and real-robot control support for the Roban and Kuavo series of humanoid robots, helping researchers and developers quickly deploy and test robot control policies.
🧩 Framework Diagram

🔧 Hardware Configuration
- Robot platform: Roban 2 & Kuavo 5
- Compute platform (recommended configuration):
- GPU: NVIDIA GeForce RTX 4090 24G
- Intel i9-14900KF
- Memory: 64G
- Storage: 2TB
🤖 Full Workflow of Robot Reinforcement Learning Training
🎯 Features
- Multi-robot support: Supports multiple robot models (RobanS14, KuavoS54, etc.)
- Motion imitation: Train RL agents to imitate reference motions from NPZ files
- Data conversion: Convert motion data between CSV and NPZ formats
- Motion replay: Visualize and replay motion sequences in Isaac Sim
- RL training: Train policies with the RSL-RL framework
- Flexible configuration: Supports local motion files and the WandB registry
⚙️ Environment Requirements
- Operating system: Linux (Ubuntu 20.04 recommended, x86_64)
- Python: >= 3.10
- NVIDIA driver: Compatible with the CUDA version
- CUDA: Required for GPU acceleration (compatible with the Isaac Sim version)
- Isaac Sim: 4.5.0
- Isaac Lab: 2.1.0
- PyTorch: Must be compatible with the Isaac Lab version
🌿 Environment Setup
1. Install Isaac Sim 4.5.0
You need to manually download NVIDIA Isaac Sim 4.5.0 first. For installation steps, please refer to the official website; the steps provided here are for reference only.
# 安装 Isaac Sim 参考步骤
mkdir ~/rl_project && mkdir ~/rl_project/isaacsim # 也可以不创建rl_project,其他文件夹存放工程,后续将rl_project替换为您自己的工程文件夹名称即可
cd ~/Downloads
unzip "isaac-sim-standalone-4.5.0-linux-x86_64.zip" -d ~/rl_project/isaacsim
cd ~/rl_project/isaacsim
export ISAACSIM_PATH="${HOME}/rl_project/isaacsim"
export ISAACSIM_PYTHON_EXE="${ISAACSIM_PATH}/python.sh"
${ISAACSIM_PATH}/isaac-sim.shThe first run needs to load all components. Please be patient and wait until the window pops up; once this step is complete, you can terminate the process.

2. Configure Isaac Lab 2.1.0
For installation steps, please refer to the official website; the steps provided here are for reference only.
# 安装 Isaac Lab 参考步骤
cd ~/rl_project
git clone https://github.com/isaac-sim/IsaacLab.git
cd IsaacLab
git checkout v2.1.0
ln -s ../isaacsim _isaac_sim # 建立软链接 ln -s path_to_isaac_sim _isaac_sim
./isaaclab.sh --conda rl_project
conda activate rl_project
./isaaclab.sh --installThe subsequent scripts must be run in a Conda environment where Isaac Lab has been correctly installed and activated.
3. Get the Training Code Repository
pip install "numpy>=1.19.5,<2"
git clone https://gitee.com/leju-robot/LejuLab-Train.git
cd LejuLab-Train
cd source/leju_robot
pip install -e . # 以“可编辑模式”安装当前目录中的Python包4. Configure IDE Type Checking (Optional but Recommended)
To get proper IDE support (autocompletion, type checking) in VS Code/Pyright, you need to configure extraPaths in pyproject.toml:
[tool.pyright]
extraPaths = [
"/path/to/IsaacLab2.1/source/isaaclab",
"/path/to/IsaacLab2.1/source/isaaclab_assets",
"/path/to/IsaacLab2.1/source/isaaclab_mimic",
"/path/to/IsaacLab2.1/source/isaaclab_rl",
"/path/to/IsaacLab2.1/source/isaaclab_tasks",
"/path/to/IsaacLab2.1/IsaacLabExtensionRoban/source/amp-rsl-rl",
"/path/to/IsaacLab2.1/IsaacLabExtensionRoban/source/ext_kuavo",
"/path/to/isaac-sim-4.5/exts/omni.isaac.ml_archive/pip_prebundle",
]Why is this configuration needed?
- These paths point to the Isaac Lab source packages, which are not installed as standard Python packages;
- Pyright (VS Code's type checker) needs these paths to resolve imports and provide autocompletion;
- Without this configuration, you may see import errors and missing type hints in the IDE;
- Important: Please update the paths to match your actual Isaac Lab installation directory.
- Note: This configuration only affects IDE type checking and does not affect runtime execution. The actual imports work at runtime because the Isaac Lab packages are added to
PYTHONPATHduring execution.
🧠 Training Methods
1. Data Preprocessing (CSV to NPZ)
After the motion capture data is processed by GMR, you get CSV-format data containing the robot's base_link global pose and joint angle data. This project provides a script that converts CSV-format data into the more informative NPZ format. If the device performance is not high enough, it is not recommended to remove the --headless parameter; otherwise, severe lag will occur. When running on a low-spec GPU or CPU, --headless must be used.
python scripts/motion_tool/"csv_to_npz&deploycsv.py" \
--input_file path/to/motion.csv \
--input_fps 30 \
--output_fps 50 \
--robot robanS14 \
--npz_output output/motion.npz \
--csv_output output/motion_deploy.csv
--headlessParameter Description:
--input_file: Path to the input CSV file (required)--input_fps: Frame rate of the input motion (default: 30)--output_fps: Frame rate of the output motion (default: 50)--frame_range START END: Optional, the frame range to extract--npz_output: Path to the output NPZ file--csv_output: Optional output path for the deployment CSV--robot: Robot model name (default: robanS14)--headless: Run without GUI--input_quat_xyzw: The quaternion columns in the input CSV are xyzw and will be converted to wxyz; if not passed, the input is assumed to already be wxyz (use this parameter if the robot orientation is inverted in the output NPZ)
2. Verify Motion Replay
Before starting training, first test whether the converted motion data can be replayed correctly.
python scripts/motion_tool/replay_npz.py \
--motion_file path/to/motion.npz \
--robot robanS14Parameter Description:
--motion_file: Path to the NPZ motion file--robot: Robot model name (robanS14, kuavo S54)
3. Train the RL Agent
3.1 Trajectory Imitation Task
3.1.1 Dance Task
python scripts/reinforcement_learning/rsl_rl/train.py \
--task Tracking-Dance-Flat-RobanS14 \
--motion_file source/leju_robot/leju_robot/assets/motion_data/mimic/npz_data/robanS14_new_year_dance_50fps.npz \
--num_envs 8192 \
--headless \
--max_iterations 25000
# roban的舞蹈任务包含 charleston、new_year 舞蹈。
# --motion_file source/leju_robot/leju_robot/assets/motion_data/mimic/npz_data/robanS14_charleston_dance_50fps.npzpython scripts/reinforcement_learning/rsl_rl/train.py \
--task Tracking-Dance-Flat-KuavoS54 \
--motion_file source/leju_robot/leju_robot/assets/motion_data/mimic/npz_data/kuavos54_dance_50fps.npz \
--num_envs 8192 \
--headless \
--max_iterations 25000
# 该任务为 kuavo 5 的舞蹈任务。3.1.2 Stand-Up Task
python scripts/reinforcement_learning/rsl_rl/train.py \
--task Tracking-Standup-Flat-RobanS14 \
--motion_file source/leju_robot/leju_robot/assets/motion_data/mimic/npz_data/robanS14_prone_50fps.npz \
--num_envs 8192 \
--headless \
--max_iterations 25000
# roban的倒地起身任务包含 前倒地起身(prone)、后倒地起身(supine)。
# --motion_file source/leju_robot/leju_robot/assets/motion_data/mimic/npz_data/robanS14_supine_50fps.npz3.2 Velocity Tracking Task
# 该类任务包含 roban 和 kuavo 的PPO Flat Walk
# roban
python scripts/reinforcement_learning/rsl_rl/train.py \
--task Velocity-Flat-RobanS14 \
--num_envs 8192 \
--headless \
--max_iterations 25000
# kuavo
python scripts/reinforcement_learning/rsl_rl/train.py \
--task Velocity-Flat-KuavoS54-Play \
--num_envs 8192 \
--headless \
--max_iterations 25000⚠️Note: For the Kuavo PPO Flat Walk task here, please install Isaac Sim and Isaac Lab using the pip install method.
Parameter descriptions:
--task: task name (e.g.Tracking-Dance-Flat-RobanS14,Velocity-Flat-RobanS14,Velocity-Rough-AMP-Walk-RobanS14). You can view task names in theinit.pyscript; an example directory is as follows:source/leju_robot/leju_robot/tasks/tracking/config/robanS14/dance/init.py--motion_file: path to the reference motion NPZ file (required for tracking tasks)--num_envs: number of parallel environments (choose a reasonable value based on your computer's configuration)--max_iterations: maximum number of training iterations--headless: run without a GUI--resume: resume training from a checkpoint--load_run: run ID of the checkpoint to load--checkpoint: checkpoint file name (e.g.model_25000.pt)
🔍 Validating the Model
Load the trained model checkpoint and run a demo in Isaac Lab; an .onnx file ready for deployment is also generated.
python scripts/reinforcement_learning/rsl_rl/play.py \
--task Tracking-Dance-Flat-RobanS14-Play \
--motion_file assets/motion_data/your_task_type/npz_data/{motion_name}.npz \
--load_run your_date_and_time \
--checkpoint model_25000.pt \
--num_envs 1Parameter descriptions:
--task: task name, which must have the-Playsuffix--motion_file: path to the reference motion file in .npz format, specifying the motion sequence the robot needs to imitate.--load_run: run ID in the training logs--checkpoint: checkpoint file name--num_envs: number of environments (usually 1, for visualization)
⚙️ Using the VS Code Debug Configuration (Optional but Recommended)
The project includes preconfigured VS Code debug configurations in .vscode/launch.json, allowing you to launch training and test tasks with a single click.
How to use:
1. Set the Python Interpreter
- Press
Ctrl+Shift+P(Cmd+Shift+Pon Mac) to open the command palette - Type "Python: Select Interpreter" and select it
- Select the Python interpreter in your virtual environment (e.g.
venv/bin/pythonorconda envs/your_env/bin/python) - Alternatively, click the Python version in the lower-right corner of VS Code and select the correct interpreter
- This step is required - VS Code must use the same Python environment in which Isaac Lab and the project dependencies are installed
2. Open the Project in VS Code
- Open VS Code in the project root directory
3. Go to Run and Debug
- Press
F5or click the "Run and Debug" icon in the sidebar - Or use the menu:
Run > Start Debugging
4. Select a Configuration from the Dropdown Menu at the Top
-
Motion Tools:
csv to npz: Convert CSV motion files to NPZ formatpkl to npz: Convert PKL motion files to NPZ formatreplay npz: Replay a single NPZ motion file
-
Training Configurations:
train robanS14 walk: Train the RobanS14 velocity control tasktrain robanS14 dance: Train the RobanS14 dance tracking tasktrain robanS14 standup: Train the RobanS14 standup tracking tasktrain kuavoS54 walk: Train the KuavoS54 velocity control tasktrain kuavoS54 dance: Train the KuavoS54 dance tracking task
-
Run Configurations:
play robanS14 walk: Test the trained RobanS14 velocity policyplay robanS14 dance: Test the trained RobanS14 dance policyplay robanS14 standup: Test the trained RobanS14 standup policyplay kuavoS54 walk: Test the trained KuavoS54 velocity policyplay kuavoS54 dance: Test the trained KuavoS54 dance policy
5. Customizing Parameters
- Edit
.vscode/launch.jsonto modify parameters - Uncomment/comment out lines to enable/disable options
- Update
--load_runand--checkpointin the run configuration
Tips:
- Set breakpoints in the code for debugging
- Use the
--headlessflag during training to run without a GUI (faster) - Adjust
--num_envsaccording to your GPU memory - For run configurations, update
--load_runwith your training run ID
📋 Available Tasks
Tracking Tasks (Motion Imitation):
Tracking-Dance-Flat-RobanS14/Tracking-Dance-Flat-RobanS14-PlayTracking-New-Year-Dance-Flat-RobanS14/Tracking-New-Year-Dance-Flat-RobanS14-PlayTracking-Standup-Flat-RobanS14/Tracking-Standup-Flat-RobanS14-PlayTracking-Dance-Flat-KuavoS54/Tracking-Dance-Flat-KuavoS54-Play
Velocity Tasks (Locomotion Control):
Velocity-Flat-RobanS14/Velocity-Flat-RobanS14-PlayVelocity-Flat-KuavoS54/Velocity-Flat-KuavoS54-Play
🪛 Configuration
Robot configurations are defined in:
source/leju_robot/leju_robot/tasks/{task_type}/config/{robot_name}/
Each robot has its own configuration, including:
- Environment settings
- MDP components (observations, rewards, events, etc.)
- Agent configuration
- Task-specific parameters
🔗 Complete Robot Model Deployment Workflow
⬇️ Deployment Code
LejuLab-Deploy is the reinforcement learning deployment code for Leju humanoid robots. The code framework is as follows.
Clone the code:
git clone -b beta https://gitee.com/leju-robot/LejuLab-Deploy.git🎮Sim to sim
If you do not have a robot runtime environment, please use the Docker environment for compilation and simulation (recommended).
1. ✅ Prerequisites
Please install Docker properly. Beginners are recommended to use this one-click setup method to install Docker:
wget http://fishros.com/install -O fishros && . fishrosPlease install and configure the NVIDIA graphics driver and nvidia-container-toolkit properly (if you need to use the GPU). Refer to the NVIDIA official documentation to install the nvidia-container-toolkit version that matches your graphics driver version.
2. 🐳 Download the Image and Enter the Docker Container
Please download the precompiled image:
https://kuavo.lejurobot.com/kuavo_research_editiion/docker_images/kuavo_opensource_mpc_wbc_img_v1.3.0.tar.gzRun the following command to import the container image:
docker load -i kuavo_opensource_mpc_wbc_img_v1.3.0.tar.gzEnter the Docker container:
cd LejuLab-Deploy # 具体路径请根据你下载的仓库所在
git checkout -b beta origin/beta # 切换至 beta 分支
./docker/run_with_gpu.sh # 使用 GPU 运行 或 ./docker/run.sh 使用cpu3. 📦 Installing Dependencies
sudo apt-get update && sudo apt-get install -y \ # 依赖安装
build-essential cmake \
libacl1-dev libncurses5-dev4. ⚒️ Build
The container image uses zsh by default.
source installed/setup.zsh # !!! IMPORTANT !!! 非常重要,不可省略
catkin build5. ⚡ Deploy iceoryx Shared Memory (Required on First Use)
The project supports accelerating inter-process communication via iceoryx shared memory. Deploying it is recommended to achieve better real-time performance.
./src/leju_launch/scripts/setup_cyclonedds_config_for_docker.sh6. 📄 Configuration Files
6.1 Add Model Files
The sim2sim and sim2real model deployment workflows are similar. Please add the CSV files required for deployment and the ONNX files obtained from training to the corresponding paths. robanS14 is used as an example here.
# csv 文件放置路径
LejuLab-Deploy/src/leju-controllers/leju-rl-controller/config/14/motion_data/
# onnx 模型文件放置路径
LejuLab-Deploy/src/leju-controllers/leju-rl-controller/config/14/policy6.2 Configure the YAML Configuration File
This configuration file specifies the model path, deployment CSV path, joint mappings, PD parameters, etc. You can use an existing configuration file for deployment, or refer to it to create your own deployment configuration.
Create a configuration file under LejuLab-Deploy/src/leju-controllers/leju-rl-controller/config/<robot_version>/, for example, create a config_mimic_hpny_dance_sim.yaml configuration file.
Modify the ONNX model path and CSV trajectory path in the configuration file:
# ONNX 策略模型路径(相对于此配置文件)
policy_path: "policy/<onnx_name>.onnx"
# csv 运动数据路径
motion_data_path: "motion_data/<csv_name>.csv"
# Motion 数据配置
motion:
default_motion: "hpny_dance" # 默认动作名称(启动时加载)
motions: # 命名的动作数据文件
- name: "hpny_dance" # 动作名称
file: "motion_data/<csv_name>.csv"The sim2sim parameters must be modified to match the params/env.yaml output by the trained model. In the configuration file, joint_default_pos must be aligned with joint_pos in env.yaml; actuator_kp with stiffness; actuator_kd with damping; and action_scale with actions.
For sim2real, on top of this alignment, please fine-tune the parameters based on the actual performance of the real robot.
actuator_kp:
[ 100.0,
#...
actuator_kd:
[ 100.0,
#...
action_scale:
[ 0.49,
#... 6.3 Modify controller_manager.yaml
This file is the controller configuration file. Taking robanS14 as an example, its path is LejuLab-Deploy/src/leju-controllers/leju-rl-controller/config/14/controller_manager.yaml, where the default_controller field is the default controller. To change it, you can set it to the name corresponding to another configuration; the config field is the yaml file created in 6.2.
loop_dt: 0.001
default_controller: "hpny_dance" # 可将其修改为 dance_demo
# 贺年舞蹈
- name: "hpny_dance"
type: "GenericRLController"
config: "config_mimic_hpny_dance_sim.yaml"
enabled: true
# 舞蹈案例
- name: "dance_demo"
type: "GenericRLController"
config: "config_dance_demo.yaml"
enabled: true7. ▶️ Run
source devel/setup.zsh
# Roban 2
export ROBOT_VERSION=14
roslaunch leju_launch load_mujoco_sim.launch
# Kuavo 5
export ROBOT_VERSION=54
roslaunch leju_launch load_mujoco_sim.launch- The above command starts the controller, the MuJoCo simulator, and function packages such as gamepad control
- Following the terminal prompts, press the `start` button on the gamepad
- Click the `Run` button in the MuJoCo simulation. When dancing, press the "watermelon key / home" on the gamepad; when walking, use the gamepad to move
- tips: If the robot falls over at the start, you can first `Pause` and `Reset` the simulation, then `Run`

🔄 Sim to real
1. 📦 Installing Dependencies
sudo apt-get update && sudo apt-get install -y \ # 依赖安装
build-essential cmake \
libacl1-dev libncurses5-dev2. ⚒️ Build
cd LejuLab-Deploy # 具体路径请根据你下载的仓库所在
git checkout -b beta origin/beta # 切换至 beta 分支
source installed/setup.bash # !!! IMPORTANT !!! 非常重要,不可省略
catkin build3. ⚡ Deploy iceoryx Shared Memory (Required on First Use)
./src/leju_launch/scripts/setup_cyclonedds_config.sh4. 📄 Modify the Configuration File
This part is covered by the general tutorial and has already been described in sim 2 sim.
5. ▶️ Run
sudo su # 需要 root 权限
source devel/setup.bash
# Roban 2
export ROBOT_VERSION=14
roslaunch leju_launch load_real.launch
# Kuavo 5
export ROBOT_VERSION=54
roslaunch leju_launch load_real.launch- For a physical robot, you may first need to perform zero-point calibration of the motors, but this is not mandatory, because the robot has already been calibrated at the factory. If the following situations occur, you can manually run the calibration tool to recalibrate:
- When preparing to stand, you find a deviation between the joint angles and the zero positions
- Hardware repair or motor replacement
- For the motor zero-point calibration tool, refer to: Motor Zero-Point Calibration Tool
- Pull up the emergency stop button on the back of the robot, then run the above command
- Raise the support frame and wait for the robot to enter its initial ready posture
- Lower the support frame so that the robot's soles just touch the ground
- Use the
startbutton on the gamepad to make the robot stand up, then press thewatermelon key/homeon the gamepad to dance; if using a walking model, use the gamepad to move - When you are done using the robot, press the
backbutton on the gamepad
General Notes
- Select the robot version (for the numeric definitions, refer to the
RobotVersionsconstants inlejusdk-utils/robot_version.hpp)export ROBOT_VERSION=14: Roban 2nd generationexport ROBOT_VERSION=54: Kuavo 5th generation
- Gamepad control (general)
start: Switch from standby/ready state to running/standing stateback: Enter the safe shutdown/joint-relaxed state- Other buttons and joysticks: implement walking, turning, dancing, and other functions depending on the controller (e.g., RL demo / mimic); see the corresponding controller documentation for details
- Controller configuration
- The controller configuration file is located at
src/leju-controllers/leju-rl-controller/config/<ROBOT_VERSION>/controller_manager.yaml. Switch control modes by modifying thedefault_controllerfield. After the robot stands up, press the watermelon key to play the dance; after the dance finishes, press the watermelon key again to replay it.
- The controller configuration file is located at
4. Virtual Controller Configuration
If you do not have a physical controller, you can use the virtual controller. After the ROS node is started, use the command to start the virtual controller.
4.1 Virtual Controller Startup
- Real robot environment:
Open a new terminal on the local host and ssh into the robot.
sudo su
source devel/setup.bash
./devel/lib/lejusdk-vr/controller_cli- Docker simulation environment:
Open a new terminal on the host and connect to the running Docker container.
docker ps
docker exec -it <container_id> zsh
source devel/setup.zsh
./devel/lib/lejusdk-vr/controller_cli4.2 Command Description
Use the 'help' command to view which commands the virtual controller supports.
runtime [--json]: 查看 runtime 原始状态
controller [--json]: 查看控制器状态
list [--json]: controller 别名
motion [--json]: 查看动作状态
start [--json]: 触发 start(等价 START 事件)
stop [--json]: 触发 stop(等价 BACK/quit 事件)
motion start [name] [--json]: 触发动作播放
switch <name> [--json]: 切换控制器
mode <arm|waist> <keep|auto|external> [--json]:设置控制模式
walkcontrol [options]: 键盘速度控制
clear: 清屏
help: 帮助
quit / exit: 退出 4.3 Usage
- Motion imitation
#触发运行
start
#切换控制器
switch <controller_name>
#查看动作
motion
#触发动作
motion start <motion_name>- Motion control
#触发运行
start
#切换控制器
switch <controller_name>
#按键控制
walkcontrol










