6.3 KiB
Unitree Deploy
🌎English | 🇨🇳中文
This document provides instructions for setting up the deployment environment for Unitree G1 (with gripper) and Z1 platforms, including dependency installation, image service startup, and gripper control.
0. 📖 Introduction
This repository is used for model deployment with Unitree robots.
1. 🛠️ Environment Setup
conda create -n unitree_deploy python=3.10 && conda activate unitree_deploy
conda install pinocchio -c conda-forge
pip install -e .
# Optional: Install lerobot dependencies
pip install -e ".[lerobot]"
git clone https://github.com/unitreerobotics/unitree_sdk2_python.git
cd unitree_sdk2_python && pip install -e . && cd ..
2. 🚀 Start
Tip: Keep all devices on the same LAN
2.1 🤖 Run G1 with Dex_1 Gripper
2.1.1 📷 Image Capture Service Setup (G1 Board)
To open the image_server, follow these steps
-
Connect to the G1 board:
ssh unitree@192.168.123.164 # Password: 123 -
Activate the environment and start the image server:
conda activate tv cd ~/image_server python image_server.py
2.1.2 🤏 Dex_1 Gripper Service Setup (Development PC2)
Refer to the Dex_1 Gripper Installation Guide for detailed setup instructions.
-
Navigate to the service directory:
cd ~/dex1_1_service/build -
Start the gripper service, ifconfig examines its own dds networkInterface:
sudo ./dex1_1_gripper_server --network eth0 -l -r -
Verify communication with the gripper service:
./test_dex1_1_gripper_server --network eth0 -l -r
2.1.2 ✅Testing
Perform the following tests to ensure proper functionality:
-
Dex1 Gripper Test:
python test/endeffector/test_dex1.py -
G1 Arm Test:
python test/arm/g1/test_g1_arm.py -
Image Client Camera Test:
python test/camera/test_image_client_camera.py -
G1 Datasets Replay:
# --repo-id Your unique repo ID on Hugging Face Hub # --robot_type The type of the robot e.g., z1_dual_dex1_realsense, z1_realsense, g1_dex1, python test/test_replay.py --repo-id unitreerobotics/G1_CameraPackaging_NewDataset --robot_type g1_dex1
2.2 🦿 Run Z1
2.2.1 🦿 Z1 Setup
Clone and build the required repositories:
-
Download z1_controller and z1_sdk.
-
Build the repositories:
mkdir build && cd build cmake .. && make -j -
Copy the
unitree_arm_interfacelibrary: [Modify according to your own path]cp z1_sdk/lib/unitree_arm_interface.cpython-310-x86_64-linux-gnu.so ./unitree_deploy/robot_devices/arm -
Start the Z1 controller [Modify according to your own path]:
cd z1_controller/build && ./z1_ctrl
2.2.2 Testing ✅
Run the following tests:
-
Realsense Camera Test:
python test/camera/test_realsense_camera.py # Modify the corresponding serial number according to your realsense -
Z1 Arm Test:
python test/arm/z1/test_z1_arm.py -
Z1 Environment Test:
python test/arm/z1/test_z1_env.py -
Z1 Datasets Replay:
# --repo-id Your unique repo ID on Hugging Face Hub # --robot_type The type of the robot e.g., z1_dual_dex1_realsense, z1_realsense, g1_dex1, python test/test_replay.py --repo-id unitreerobotics/Z1_StackBox_Dataset --robot_type z1_realsense
2.3 🦿 Run Z1_Dual
2.3.1 🦿 Z1 Setup and Dex1 Setup
Clone and build the required repositories:
-
Download and compile the corresponding code according to the above z1 steps and Download the gripper program to start locally
-
Download the modified z1_sdk_1 and then compile it, Copy the
unitree_arm_interfacelibrary: [Modify according to your own path]cp z1_sdk/lib/unitree_arm_interface.cpython-310-x86_64-linux-gnu.so ./unitree_deploy/robot_devices/arm -
Start the Z1 controller [Modify according to your own path]:
cd z1_controller/builb && ./z1_ctrl cd z1_controller_1/builb && ./z1_ctrl -
Start the gripper service, ifconfig examines its own dds networkInterface:
sudo ./dex1_1_gripper_server --network eth0 -l -r
2.3.2 Testing ✅
Run the following tests:
-
Z1_Dual Arm Test:
python test/arm/z1/test_z1_arm_dual.py -
Z1_Dual Datasets Replay:
# --repo-id Your unique repo ID on Hugging Face Hub # --robot_type The type of the robot e.g., z1_dual_dex1_realsense, z1_realsense, g1_dex1, python test/test_replay.py --repo-id unitreerobotics/Z1_Dual_Dex1_StackBox_Dataset_V2 --robot_type z1_dual_dex1_realsense
3.🧠 Inference and Deploy
- Modify the corresponding parameters according to your configuration
- Go back the step-2 of Client Setup under the Inference and Deployment under Decision-Making Mode.
4.🏗️ Code structure
If you want to add your own robot equipment, you can build it according to this document
5. 🤔 Troubleshooting
For assistance, contact the project maintainer or refer to the respective GitHub repository documentation. 📖
6. 🙏 Acknowledgement
This code builds upon following open-source code-bases. Please visit the URLs to see the respective LICENSES (If you find these projects valuable, it would be greatly appreciated if you could give them a star rating.):