A real-time human pose estimation and shadowing system for the Unitree G1 humanoid robot arm using Intel RealSense D455 camera.
This project enables the Unitree G1 robot to mirror human movements in real-time by capturing human arm poses through a RealSense camera and translating them to robot joint commands.
- Unitree G1 Humanoid Robot
- Intel RealSense D455 Camera
- PC with the following specifications:
- Recommended: NVIDIA RTX 4090, 64GB RAM
- Minimum: Any CUDA-compatible GPU (slower inference on lower specs)
- Ethernet Cable for PC-G1 communication
- Higher-end hardware provides faster inference and smoother real-time performance
- Lower specification PCs are supported but may experience reduced frame rates
- Ubuntu 22.04 (Required)
- CUDA 11.8 (Required for GPU acceleration)
- cuDNN (Compatible with CUDA 11.8)
- Miniconda or Anaconda
- ROS 2 Humble
git clone https://github.com/shubham-goel/4D-Humans.git
git clone https://github.com/ WeGo-Robotics/G1_Shadowing.git
cd G1_Shadowing
cp * ~/4D-Humans
cd ~/4D-HumansBesides these files, you also need to download the SMPL model. You will need the neutral model for running the code. Please go to the Google Drive link and download the model. Place the model in ./data/ folder under 4D-Humans
conda create --name shadow python=3.10
conda activate shadow# Install PyTorch with CUDA 11.8 support
conda install pytorch==2.4.1 torchvision==0.19.1 torchaudio==2.4.1 pytorch-cuda=11.8 -c pytorch -c nvidia# Note: Remove pytorch and torchvision from setup.py before installation
pip install -e .[all]# Install fvcore, iopath, and pytorch3d
conda install -c fvcore -c iopath -c conda-forge fvcore iopath
conda install pytorch3d -c pytorch3dFollow the instructions at the offical Unitree Github to install the SDK.
sudo apt install ros-humble-librealsense2*
sudo apt install ros-humble-realsense2-*- Connect the Intel RealSense D455 camera to your PC via USB 3.0+
- Verify camera detection and functionality
- Connect the Unitree G1 to your PC using an Ethernet cable
- Follow the network configuration guide: Unitree G1 Developer Quick Start
ros2 launch realsense2_camera rs_launch.py enable_depth:=false rgb_camera.color_profile:=640x480x30- Important: Ensure only one person is visible in the camera frame
- Position the person in a zero pose (neutral standing position) similar to the G1 robot's default stance
- Verify clear visibility and proper lighting
- For the first time the algorithm will take some time because of downloading the HMR2.0 model.
python3 pose_estimation.py --detector regnetypython3 g1_retargeting.py- Problem: Algorithm fails due to automatic PyTorch updates
- Solution: Ensure PyTorch version remains at 2.4.1 as specified in installation. If the PyTorch is updated also install compatible torchvision.
- Problem: GCC-related compilation errors
- Solution: Install compatible GCC version:
conda install -c conda-forge gcc=12.1.0- Verify RealSense camera is properly connected and recognized
- Check USB 3.0+ connection for optimal performance
- Test camera with RealSense Viewer application
- Follow the complete network setup guide from Unitree documentation
- Ensure proper IP configuration between PC and G1
- Verify Ethernet cable connection and network interface status
- Monitor GPU memory usage and system resources
- Reduce camera resolution if experiencing lag
- Consider upgrading hardware for better real-time performance
| Component | Minimum | Recommended |
|---|---|---|
| OS | Ubuntu 22.04 | Ubuntu 22.04 |
| GPU | CUDA-compatible | RTX 4090 |
| RAM | 16GB | 64GB |
| CUDA | 11.8 | 11.8 |
| Python | 3.10 | 3.10 |
Contributions are welcome! Please ensure all pull requests include:
- Detailed description of changes
- Testing on recommended hardware configuration
- Documentation updates if applicable
Please refer to the original 4D-Humans repository for licensing information.
For technical issues:
- Check troubleshooting section above
- Review Unitree G1 developer documentation
- Open an issue with detailed error logs and system specifications
- 4D-Humans for pose estimation
- Unitree Robotics for G1 platform
- Intel RealSense for depth sensing technology