English | 中文
If there is no need to rely on ROS and you prefer pure C++ development, this is the deployment example to follow. It covers environment configuration, the compilation process and basic function implementation. The code structure is meant to be easy to reuse or extend, which lowers the development threshold and keeps project setup and iterations short.
robot_hw loads every controller listed in robot_hw/robot_controllers.yaml into one process. Each runs at 1000 Hz, but only one is active at a time; the joystick picks which.
Ubuntu 20.04 or newer is assumed. Install the project dependencies as follows.
sudo apt update
sudo apt install cmake build-essential libeigen3-dev libyaml-cpp-dev python3 python3-pip -y
sudo pip3 install vcstool colcon-common-extensionsInstall the onnxruntime dependency from the v1.10.0 release page, choosing the version that matches your OS and platform. For Ubuntu 20.04 x86_64, follow these steps:
wget https://github.com/microsoft/onnxruntime/releases/download/v1.10.0/onnxruntime-linux-x64-1.10.0.tgz
tar xvf onnxruntime-linux-x64-1.10.0.tgz
sudo cp -a onnxruntime-linux-x64-1.10.0/include/* /usr/include
sudo cp -a onnxruntime-linux-x64-1.10.0/lib/* /usr/libCreate an RL deployment and development workspace as follows.
The workspace holds two repositories: the MuJoCo simulator and this deployment
example. Both are cloned with --recurse, which also fetches their submodules.
Each one carries a limxsdk-lowlevel submodule: the simulator's supplies the
wheel installed in 4.1, and this repository's supplies the library linked in
4.2, so a clone without submodules fails at both steps.
mkdir -p ~/limx_ws
cd ~/limx_ws
# Option 1: HTTPS
git clone --recurse https://github.com/limxdynamics/humanoid-mujoco-sim.git
git clone --recurse https://github.com/limxdynamics/humanoid-rl-deploy-cpp.git
# Option 2: SSH
git clone --recurse git@github.com:limxdynamics/humanoid-mujoco-sim.git
git clone --recurse git@github.com:limxdynamics/humanoid-rl-deploy-cpp.gitROBOT_TYPE selects which configuration directory the controllers load. List
the available robot types first:
cd ~/limx_ws/humanoid-rl-deploy-cpp/src
tree -L 1 humanoid-rl-deploy-cpp/robot_controllers/mimic_controller/confighumanoid-rl-deploy-cpp/robot_controllers/mimic_controller/config
├── HU_D03_03
└── HU_D04_01
tree comes from the tree package, which the apt line in 2.1 does not
include; if the command above reports command not found, run
sudo apt install tree.
Taking HU_D04_01 (replace with your actual robot type) as an example, set the
robot model type:
echo 'export ROBOT_TYPE=HU_D04_01' >> ~/.bashrc && source ~/.bashrcThree programs run at the same time — the simulator, the controller and the virtual joystick — so each one gets its own Bash terminal.
Python 3.8 or higher is recommended. In the first terminal:
cd ~/limx_ws
pip install -r humanoid-mujoco-sim/requirements.txtThat installs MuJoCo (mujoco>=3.0.0), which simulator.py imports at
start-up. Then install the motion control development library, choosing the
architecture of your machine.
Linux x86_64 environment:
cd ~/limx_ws
pip install humanoid-mujoco-sim/limxsdk-lowlevel/python3/amd64/limxsdk-*.whlLinux aarch64 environment:
cd ~/limx_ws
pip install humanoid-mujoco-sim/limxsdk-lowlevel/python3/aarch64/limxsdk-*.whlRun the MuJoCo simulator:
cd ~/limx_ws
python humanoid-mujoco-sim/simulator.pyA MuJoCo window opens. Nothing drives the robot until the controller in 4.2 is running, so start the controller first and then click Reset in the left panel.
In the second terminal:
# 1. Compile the algorithm code
cd ~/limx_ws/humanoid-rl-deploy-cpp
make
# 2. Run the algorithm
source build/install/setup.bash
robot_hwrobot_hw takes the robot address as an optional argument. Without it the
address is 127.0.0.1, which is the simulator; section 5 passes the robot's
address instead. The program then serves a command-line interface on port 8888
(telnet localhost 8888) and stays in the foreground until Ctrl+C.
Use the virtual remote control to operate the robot during simulation. In the third terminal:
~/limx_ws/humanoid-mujoco-sim/robot-joystick/robot-joystickYou can now use the virtual joystick to control the robot.
| Button | Mode | Description |
|---|---|---|
| L1+Y | Switch to Stand Mode | If the robot cannot stand, click "Reset" in the MuJoCo interface to reset it. |
| L1+B | Switch to Greeting Mode | |
| R1+X | Switch to Walk Mode | You can train your model for this mode! |
| L1+A | Switch to Damping Mode | Damping only (Kd, no position target): the joints go limp. |
| L1+X | Stop all controllers |
Your policy must match this interface: 102 observations per frame, 5 frames of history, 31 joint actions (walking_controller/config/HU_D04_01/param.yaml).
-
In the humanoid-rl-isaaclab project, run the inference code and export the model. It writes
policy.onnxinto anexported/folder next to the checkpoint:python scripts/rsl_rl/play.py --task LimX-Oli-31dof-Velocity --checkpoint path-to-model
-
Add the
policy.onnxto the folderlimx_ws/humanoid-rl-deploy-cpp/src/humanoid-rl-deploy-cpp/robot_controllers/walking_controller/config/HU_D04_01/policy -
Run
makeagain: theinstall(DIRECTORY config/.)rule inwalking_controller/CMakeLists.txtcopies that folder intobuild/install/etc/walking_controller/, and only the installed copy is loaded at run time. -
Follow 4.1 and 4.2 to run the MuJoCo simulator and control the robot.
-
Make sure your model runs perfectly in the simulation before deploying it on the real robot.
A walking configuration is shipped for
HU_D04_01only.robot_controllers/walking_controller/config/has noHU_D03_03directory, so that robot needs one added before Walk Mode can load.
-
Set your computer's IP: ensure your computer is connected to the robot via the external network port. Set your computer's IP address to
10.192.1.200and verify connectivity withping 10.192.1.2. Configure your computer's IP as shown: -
Robot preparation:
- Hang the robot by the hooks on its shoulders.
- Power on the robot, then press the
right joystickon the remote to start the motors. - Press
R1 + DOWNon the remote to switch to developer mode. This mode persists across reboots. Exit withR1 + LEFT.
-
Real machine deployment: execute the following shell commands in a Bash terminal to start the control algorithm:
# 1. Compile the algorithm code cd ~/limx_ws/humanoid-rl-deploy-cpp make # 2. Enter the robot's IP address (10.192.1.2) and run the algorithm source build/install/setup.bash robot_hw 10.192.1.2
-
Now you can press
L1 + △ (Y)on the remote control to make the robot stand up. -
Press
L1 + 〇 (B)on the remote control to make the robot wave. -
Press
R1 + 口 (X)on the remote control to make the robot walk.





