Tutorial: Deploying AGILE WBC on the Unitree G1#

This tutorial will guide you through deploying the AGILE Whole-Body Control policy on a Unitree G1 using Isaac ROS Deploy. It will cover deployment on both real robots and simulated robots.

Note

To deploy a different custom policy, refer to How to bring your own policy. To deploy to a different custom robot, refer to How to bring your own embodiment.

Overview#

AGILE WBC is a locomotion policy trained in Isaac Lab. We use LEAPP to export the policy and deploy it with Isaac ROS Deploy. AGILE is a purely proprioceptive policy, namely, it only uses joint and IMU measurements as inputs. Due to this, we run it with the ros2_control LEAPP runtime.

Set Up Development Environment#

  1. Set up your development environment by following the instructions in getting started.

  2. (Optional) Install dependencies for any sensors you want to use by following the sensor-specific guides.

    Note

    We strongly recommend installing all sensor dependencies before starting any quickstarts. Some sensor dependencies require restarting the development environment during installation, which will interrupt the quickstart process.

Install and Build#

Choose the installation method that matches your deployment.

Note

If you plan to deploy in Isaac Sim, follow the Build from Source path because the Isaac Sim extension is released as source only.

  1. Activate the Isaac ROS environment:

    isaac-ros activate
    
  2. Install the G1 bringup package and its Isaac ROS Deploy runtime dependencies:

    sudo apt-get update
    
    sudo apt-get install -y ros-jazzy-unitree-g1-bringup
    source /opt/ros/jazzy/setup.bash
    

Deploy#

We recommend validating in simulation before deploying to the real robot.

  1. Launch the controller manager with MuJoCo and the AGILE policy:

    ros2 launch unitree_g1_bringup unitree_g1_controller_manager.launch.py \
        hardware_type:=mujoco \
        initial_controller_group:=agile_velocity
    

    This will open a MuJoCo viewer. A virtual gantry will hold the robot upright during startup; press G to toggle it, [ / ] to shorten / lengthen the rope.

    The controller waits for its first reference twist command before it activates. Continue with Send Velocity Commands.

Send Velocity Commands#

After launch, the controller remains inactive until it receives its first reference twist command. Open a new terminal in the Isaac ROS environment and publish a twist command:

ros2 topic pub /cmd_vel geometry_msgs/msg/Twist {}

This activates the controller.

The policy is still gated at this point: blend_ratio defaults to 0.0. Enable the policy by setting blend_ratio to 1.0 after the twist command above:

Note

Raise blend_ratio only after the controller is active. Enabling the policy at full authority before it activates applies its first inference in one step, and the resulting transient can trip the velocity safety check.

ros2 param set /safety_controller blend_ratio 1.0

Sending the zero twist command from above will make the robot balance. To make it walk, you can send other non-zero twist commands or connect another twist command source, for example teleop_twist_keyboard.

Once done with testing, set the blend ratio back to zero to disable the policy:

ros2 param set /safety_controller blend_ratio 0.0

Use an Exported AGILE Bundle#

By default, the AGILE LEAPP bundle shipped with unitree_g1_bringup is used. If you modify the AGILE WBC code or have a custom policy you want to deploy, generate the LEAPP bundle yourself. For the G1 velocity policy, export the Velocity-G1-History-v0 task.

Follow the AGILE WBC repository documentation to export the LEAPP bundle from a checkpoint.

The export produces a directory containing YAML configuration, ONNX models, and optional safetensors. Keep the folder together and copy it to the machine that you are using to deploy the policy.

To use the exported bundle, pass the path to the LEAPP bundle’s YAML file with the launch argument inference_controller_config_path. For example:

ros2 launch unitree_g1_bringup unitree_g1_controller_manager.launch.py \
    hardware_type:=mujoco \
    initial_controller_group:=agile_velocity \
    inference_controller_config_path:=/path/to/Velocity-G1-History-v0/Velocity-G1-History-v0.yaml