You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

2.6 KiB

Unitree RL Gym

Source: https://github.com/unitreerobotics/unitree_rl_gym Fetched: 2026-02-13 Type: GitHub Repository README


Unitree RL GYM: Complete Project Overview

Project Description

Unitree RL GYM is "a repository for reinforcement learning implementation based on Unitree robots, supporting Unitree Go2, H1, H1_2, and G1." The system enables training robotic policies in simulation and deploying them to physical hardware through a structured pipeline.

Supported Robots

The framework supports four Unitree robot platforms:

  • Go2: Quadruped robot
  • G1: Humanoid robot
  • H1: Humanoid robot
  • H1_2: Enhanced humanoid variant

Training Workflow: Train -> Play -> Sim2Sim -> Sim2Real

1. Training Phase

Execute training using Isaac Gym simulation environment:

python legged_gym/scripts/train.py --task=xxx

Key parameters include:

  • --task: Robot selection (go2, g1, h1, h1_2)
  • --headless: High-efficiency mode without visualization
  • --num_envs: Parallel environment count
  • --max_iterations: Training duration
  • --sim_device / --rl_device: GPU/CPU specification

Training outputs save to: logs/<experiment_name>/<timestamp>_<run_name>/model_<iteration>.pt

2. Play/Validation Phase

Verify trained policies with visualization:

python legged_gym/scripts/play.py --task=xxx

The system exports actor networks as:

  • policy_1.pt (standard MLP networks)
  • policy_lstm_1.pt (RNN-based networks)

3. Sim2Sim Deployment (Mujoco)

Cross-simulator validation ensures policies generalize beyond Isaac Gym:

python deploy/deploy_mujoco/deploy_mujoco.py {config_name}

Configuration files located in deploy/deploy_mujoco/configs/ enable model substitution via policy_path parameter.

4. Sim2Real Deployment (Physical Robots)

Deploy to actual hardware with prerequisite of "debug mode" activation:

python deploy/deploy_real/deploy_real.py {net_interface} {config_name}

Parameters specify network interface (e.g., enp3s0) and robot config files.

C++ Alternative: Pre-compiled G1 deployment available in deploy/deploy_real/cpp_g1/ using LibTorch library.

Technical Architecture

Language Composition:

  • Python: 90.8%
  • C++: 8.2%
  • Other: 1.0%

Core Dependencies:

  • legged_gym: Foundation framework
  • rsl_rl: RL algorithm implementation
  • Mujoco: Physics simulation
  • unitree_sdk2_python: Hardware communication interface
  • LibTorch: C++ neural network inference

License

BSD 3-Clause License governs usage, requiring copyright retention, prohibiting promotional misuse, and mandating modification disclosure.