This code can deploy the trained network on physical robots. Currently supported robots include Unitree G1, H1.
It is recommended to use the Python interpreter installed with Legged Lab to run the deployed code. The additional requirement is unitree_sdk2_python
- Install unitree_sdk2_python for Communication
conda activate leggedlab
git clone https://github.com/unitreerobotics/unitree_sdk2_python.git
cd unitree_sdk2_python
pip install -e .python deploy.py {net_interface} {config_name}net_interface: is the name of the network interface connected to the robot, such asenp3s0config_name: is the file name of the configuration file. The configuration file will be found underconfigs/, such asg1.yaml,h1.yaml.
Start the robot.
Press the L2+R2 key combination of the remote control; the robot will enter the debugging mode, and the robot joints are in the damping state in the debugging mode.
Use an Ethernet cable to connect your computer to the network port on the robot. Modify the network configuration as follows
Then use the ifconfig command to view the name of the network interface connected to the robot. Record the network interface name, which will be used as a parameter of the startup command later
Assume that the network card currently connected to the physical robot is named eno1. Take the G1 robot as an example, execute the following command to start
python deploy.py --net eno1 --config_path configs/g1.yamlAfter starting, the robot joints will be in the zero torque state. You can shake the robot joints by hand to feel and confirm.
In the zero torque state, press the start button on the remote control, and the robot will move to the default joint position state.
After the robot moves to the default joint position, you can slowly lower the hoisting mechanism to let the robot's feet touch the ground.
After the preparation is completed, press the A button on the remote control, and the robot will step on the spot. After the robot is stable, you can gradually lower the hoisting rope to give the robot a certain amount of space to move.
At this time, you can use the joystick on the remote control to control the movement of the robot. The front and back of the left joystick controls the movement speed of the robot in the x direction The left and right of the left joystick controls the movement speed of the robot in the y direction The left and right of the right joystick controls the movement speed of the robot's yaw angle
Press the select at any time, the robot will enter the damping mode and fall down, and the program will exit. Or use ctrl+c in the terminal to close the program.
If you use Legged Lab in your research, you can cite it as follows:
@software{LeggedLab,
author = {Wandong, Sun},
license = {BSD-3-Clause},
title = {Legged Lab: Direct IsaacLab Workflow for Legged Robots},
url = {https://github.com/Hellod035/LeggedLab},
version = {1.0.0},
year = {2025}
}