2026-01-07 16:05:31 +01:00
# Unitree G1
2025-12-01 16:10:13 +01:00
2026-03-08 11:33:24 +01:00
<img
src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/lerobot/unitree_thumbnail.jpg"
alt="Unitree G1 locomanipulation demo"
style={{ width: "100%" }}
/>
2025-12-01 16:10:13 +01:00
2026-03-08 11:33:24 +01:00
The Unitree G1 humanoid is now supported in LeRobot! You can teleoperate, train locomanipulation policies, test in sim, and more. Both 29 and 23 DoF variants are supported.
2025-12-01 16:10:13 +01:00
2026-03-08 11:33:24 +01:00
---
2025-12-01 16:10:13 +01:00
2026-03-08 11:33:24 +01:00
## Part 1: Getting Started
2025-12-01 16:10:13 +01:00
2026-03-09 18:47:12 +01:00
### Install the Unitree SDK
Follow the [unitree_sdk2_python installation guide](https://github.com/unitreerobotics/unitree_sdk2_python#installation). Tested with `unitree_sdk2py==1.0.1` and `cyclonedds==0.10.2`:
2026-03-08 11:33:24 +01:00
```bash
conda create -y -n lerobot python=3.12
conda activate lerobot
git clone https://github.com/unitreerobotics/unitree_sdk2_python.git
2026-03-09 18:47:12 +01:00
cd unitree_sdk2_python
pip install -e .
cd ..
```
### Install LeRobot
```bash
conda install ffmpeg -c conda-forge
conda install -c conda-forge "pinocchio>=3.0.0,<4.0.0"
2026-03-08 11:33:24 +01:00
git clone https://github.com/huggingface/lerobot.git
cd lerobot
pip install -e '.[unitree_g1]'
```
2025-12-01 16:10:13 +01:00
2026-03-09 18:47:12 +01:00
<Tip>
For now, pinocchio must be installed from conda-forge (not pip) to include the
CasADi bindings needed for arm IK.
</Tip>
2026-03-08 11:33:24 +01:00
### Test the Installation (Simulation)
2025-12-01 16:10:13 +01:00
2026-03-09 18:47:12 +01:00
The simulation environment has its own dependencies. Check the Simulation environment dependencies: [Unitree G1 Mujoco EnvHub](https://huggingface.co/lerobot/unitree-g1-mujoco/tree/main).
```bash
pip install mujoco loguru msgpack msgpack-numpy
```
2026-03-08 11:33:24 +01:00
```bash
lerobot-teleoperate \
--robot.type=unitree_g1 \
--robot.is_simulation=true \
--teleop.type=unitree_g1 \
--teleop.id=wbc_unitree \
2026-03-09 18:47:12 +01:00
--robot.cameras='{"global_view": {"type": "zmq", "server_address": "localhost", "port": 5555, "camera_name": "head_camera", "width": 640, "height": 480, "fps": 30, "warmup_s": 5}}' \
--display_data=true \
--robot.controller=GrootLocomotionController
2026-03-08 11:33:24 +01:00
```
2026-03-09 18:47:12 +01:00
This will launch a [MuJoCo sim instance](https://huggingface.co/lerobot/unitree-g1-mujoco/tree/main) for the G1. You can connect a gamepad to your machine before launching in order to control the robot's locomotion in sim. We support both [HolosomaLocomotionController](https://github.com/amazon-far/holosoma) and [GrootLocomotionController](https://github.com/NVlabs/GR00T-WholeBodyControl) via `--robot.controller`.
2026-03-08 11:33:24 +01:00
- Press `9` to release the robot
- Press `7` / `8` to increase / decrease waist height
2026-03-09 18:47:12 +01:00
### Connect to the Physical Robot
2025-12-01 16:10:13 +01:00
2026-03-08 11:33:24 +01:00
The G1's Ethernet IP is fixed at `192.168.123.164`. Your machine must have a static IP on the same subnet: `192.168.123.x` where `x ≠ 164`.
2025-12-01 16:10:13 +01:00
```bash
# Replace 'enp131s0' with your ethernet interface name (check with `ip a`)
sudo ip addr flush dev enp131s0
sudo ip addr add 192.168.123.200/24 dev enp131s0
sudo ip link set enp131s0 up
```
2026-03-08 11:33:24 +01:00
### SSH into the Robot
2025-12-01 16:10:13 +01:00
```bash
ssh unitree@192.168.123.164
# Password: 123
```
2026-03-09 18:47:12 +01:00
### Share Internet via Ethernet
2025-12-01 16:10:13 +01:00
2026-03-09 18:47:12 +01:00
The G1 needs internet access to clone repos and install packages. Share your laptop's connection over Ethernet:
2025-12-01 16:10:13 +01:00
2026-03-09 18:47:12 +01:00
**On your laptop:**
2025-12-01 16:10:13 +01:00
```bash
sudo sysctl -w net.ipv4.ip_forward=1
2026-03-08 11:33:24 +01:00
# Replace wlp132s0f0 with your WiFi interface name
2025-12-01 16:10:13 +01:00
sudo iptables -t nat -A POSTROUTING -o wlp132s0f0 -s 192.168.123.0/24 -j MASQUERADE
sudo iptables -A FORWARD -i wlp132s0f0 -o enp131s0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i enp131s0 -o wlp132s0f0 -j ACCEPT
```
2026-03-09 18:47:12 +01:00
**On the G1:**
2025-12-01 16:10:13 +01:00
```bash
sudo ip route del default 2>/dev/null || true
sudo ip route add default via 192.168.123.200 dev eth0
echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf
2026-03-08 11:33:24 +01:00
# Verify
2025-12-01 16:10:13 +01:00
ping -c 3 8.8.8.8
```
2026-03-09 18:47:12 +01:00
### Install the Unitree SDK on the G1
Follow the [unitree_sdk2_python installation guide](https://github.com/unitreerobotics/unitree_sdk2_python#installation):
```bash
conda create -y -n lerobot python=3.12
conda activate lerobot
git clone https://github.com/unitreerobotics/unitree_sdk2_python.git
cd unitree_sdk2_python
python -m pip install -e .
cd ..
```
### Install LeRobot on the G1
```bash
git clone https://github.com/huggingface/lerobot.git
cd lerobot
conda install -c conda-forge "pinocchio>=3.0.0,<4.0.0"
python -m pip install -e '.[unitree_g1]'
```
<Tip>
For now, pinocchio must be installed from conda-forge (not pip) to include the
CasADi bindings needed for arm IK.
</Tip>
### (Optional) Enable WiFi on the Robot
For wireless SSH access, you can enable WiFi on the G1 (it's blocked by default):
```bash
sudo rfkill unblock all
sudo ip link set wlan0 up
sudo nmcli radio wifi on
sudo nmcli device set wlan0 managed yes
sudo systemctl restart NetworkManager
```
2026-03-08 11:33:24 +01:00
**Connect to a WiFi network:**
2025-12-01 16:10:13 +01:00
```bash
nmcli device wifi list
sudo nmcli connection add type wifi ifname wlan0 con-name "YourNetwork" ssid "YourNetwork"
sudo nmcli connection modify "YourNetwork" wifi-sec.key-mgmt wpa-psk
sudo nmcli connection modify "YourNetwork" wifi-sec.psk "YourPassword"
sudo nmcli connection modify "YourNetwork" connection.autoconnect yes
sudo nmcli connection up "YourNetwork"
ip a show wlan0
```
2026-03-09 18:47:12 +01:00
You can then SSH over WiFi instead of Ethernet:
2025-12-01 16:10:13 +01:00
```bash
2026-03-08 11:33:24 +01:00
ssh unitree@<ROBOT_WIFI_IP>
2025-12-01 16:10:13 +01:00
# Password: 123
```
---
2026-03-09 18:47:12 +01:00
## Part 2: Teleoperation & Locomotion
2025-12-01 16:10:13 +01:00
2026-03-08 11:33:24 +01:00
### Run the Robot Server
2025-12-01 16:10:13 +01:00
2026-03-09 18:47:12 +01:00
On the robot (from `~/lerobot`):
2025-12-01 16:10:13 +01:00
```bash
2026-03-09 18:47:12 +01:00
cd ~/lerobot
2026-03-08 11:33:24 +01:00
python src/lerobot/robots/unitree_g1/run_g1_server.py --camera
2025-12-01 16:10:13 +01:00
```
2026-03-08 11:33:24 +01:00
### Run the Locomotion Policy
2025-12-01 16:10:13 +01:00
2026-03-09 18:47:12 +01:00
You can run the teleoperation client from your laptop over Ethernet, over WiFi (experimental), or directly on the robot itself. Mind potential latency introduced by your network.
**From your laptop:**
2025-12-01 16:10:13 +01:00
```bash
2026-03-08 11:33:24 +01:00
lerobot-teleoperate \
--robot.type=unitree_g1 \
--robot.is_simulation=false \
--robot.robot_ip=<ROBOT_IP> \
--teleop.type=unitree_g1 \
--teleop.id=wbc_unitree \
--robot.cameras='{"global_view": {"type": "zmq", "server_address": "<ROBOT_IP>", "port": 5555, "camera_name": "head_camera", "width": 640, "height": 480, "fps": 30}}' \
--display_data=true \
--robot.controller=HolosomaLocomotionController
2026-01-07 16:05:31 +01:00
```
2025-12-01 16:10:13 +01:00
2026-03-09 18:47:12 +01:00
We support both [GrootLocomotionController](https://github.com/NVlabs/GR00T-WholeBodyControl) and [HolosomaLocomotionController](https://github.com/amazon-far/holosoma) via `--robot.controller`.
2025-12-01 16:10:13 +01:00
---
2026-03-09 18:47:12 +01:00
## Part 3: Loco-Manipulation with the Homunculus Exoskeleton
2025-12-15 16:22:27 +01:00
2026-03-09 18:47:12 +01:00
We provide a loco-manipulation solution via the Homunculus Exoskeleton — an open-source 7 DoF exoskeleton for whole-body control. Check it out [here](https://github.com/nepyope/hmc_exo).
2026-01-28 15:17:38 +01:00
2026-03-08 11:33:24 +01:00
### Calibrate
2026-01-28 15:17:38 +01:00
```bash
lerobot-calibrate \
2026-03-08 11:33:24 +01:00
--teleop.type=unitree_g1 \
--teleop.left_arm_config.port=/dev/ttyACM1 \
--teleop.right_arm_config.port=/dev/ttyACM0 \
--teleop.id=exo
2026-01-28 15:17:38 +01:00
```
2026-03-08 11:33:24 +01:00
During calibration move each joint through its entire range. After fitting, move the joint in a neutral position and press `n` to advance.
2026-01-28 15:17:38 +01:00
2026-03-08 11:33:24 +01:00
### Record a Dataset
2026-01-28 15:17:38 +01:00
```bash
2026-02-18 22:46:12 +01:00
lerobot-record \
2026-03-08 11:33:24 +01:00
--robot.type=unitree_g1 \
--robot.is_simulation=true \
--robot.cameras='{"global_view": {"type": "zmq", "server_address": "localhost", "port": 5555, "camera_name": "head_camera", "width": 640, "height": 480, "fps": 30}}' \
--teleop.type=unitree_g1 \
--teleop.left_arm_config.port=/dev/ttyACM1 \
--teleop.right_arm_config.port=/dev/ttyACM0 \
--teleop.id=exo \
--dataset.repo_id=your-username/dataset-name \
--dataset.single_task="Test" \
--dataset.num_episodes=2 \
--dataset.episode_time_s=5 \
--dataset.reset_time_s=5 \
--dataset.push_to_hub=true \
--dataset.streaming_encoding=true \
--dataset.encoder_threads=2
2026-01-28 15:17:38 +01:00
```
2026-03-08 11:33:24 +01:00
> **Note:** Omit `--teleop.left_arm_config.port` and `--teleop.right_arm_config.port` if you're only using the joystick.
2026-01-28 15:17:38 +01:00
2026-03-08 11:33:24 +01:00
Example dataset: [nepyope/unitree_box_move_blue_full](https://huggingface.co/datasets/nepyope/unitree_box_move_blue_full)
2026-01-28 15:17:38 +01:00
2026-03-08 11:33:24 +01:00
---
2026-01-28 15:17:38 +01:00
2026-03-09 18:47:12 +01:00
## Part 4: Training & Inference
2026-01-28 15:17:38 +01:00
2026-03-08 11:33:24 +01:00
### Train
2026-01-28 15:17:38 +01:00
```bash
2026-03-08 11:33:24 +01:00
python src/lerobot/scripts/lerobot_train.py \
--dataset.repo_id=your-username/dataset-name \
--policy.type=pi05 \
--output_dir=./outputs/pi05_training \
--job_name=pi05_training \
--policy.repo_id=your-username/your-repo-id \
--policy.pretrained_path=lerobot/pi05_base \
--policy.compile_model=true \
--policy.gradient_checkpointing=true \
--wandb.enable=true \
--policy.dtype=bfloat16 \
--policy.freeze_vision_encoder=false \
--policy.train_expert_only=false \
--steps=3000 \
--policy.device=cuda \
--batch_size=32
2026-01-28 15:17:38 +01:00
```
2026-03-08 11:33:24 +01:00
### Inference with RTC
2026-01-28 15:17:38 +01:00
2026-03-08 11:33:24 +01:00
Once trained, we recommend deploying policies using inference-time RTC:
2026-01-28 15:17:38 +01:00
```bash
2026-04-28 00:57:35 +02:00
lerobot-rollout \
--strategy.type=base \
2026-03-08 11:33:24 +01:00
--policy.path=your-username/your-repo-id \
--policy.device=cuda \
--robot.type=unitree_g1 \
--robot.is_simulation=false \
--robot.controller=HolosomaLocomotionController \
--robot.cameras='{"global_view": {"type": "zmq", "server_address": "<ROBOT_IP>", "port": 5555, "camera_name": "head_camera", "width": 640, "height": 480, "fps": 30}}' \
--task="task_description" \
--duration=1000 \
--fps=30 \
2026-04-28 00:57:35 +02:00
--inference.type=rtc
2026-01-28 15:17:38 +01:00
```
---
2025-12-15 16:22:27 +01:00
2025-12-01 16:10:13 +01:00
## Additional Resources
- [Unitree SDK Documentation](https://github.com/unitreerobotics/unitree_sdk2_python)
2026-01-07 16:05:31 +01:00
- [GR00T-WholeBodyControl](https://github.com/NVlabs/GR00T-WholeBodyControl)
- [Holosoma](https://github.com/amazon-far/holosoma)
2025-12-01 16:10:13 +01:00
- [LeRobot Documentation](https://github.com/huggingface/lerobot)
2026-03-08 11:33:24 +01:00
- [Unitree IL LeRobot](https://github.com/unitreerobotics/unitree_IL_lerobot)
2025-12-01 16:10:13 +01:00
---
2026-03-08 11:33:24 +01:00
_Last updated: March 2026_