Skip to content

roboterax/humanoid-lab

Repository files navigation

Humanoid Lab

IsaacSim Isaac Lab pre-commit License

Overview

This project provides reinforcement learning pipeline for locomotion and single-motion tracking on L7 robots, built on Isaac Lab, covering the full workflow from policy training to sim2sim and sim2real deployment.

motion sim2sim sim2real
locomotion
locomotion_sim2sim.mp4
locomotion_sim2real.mp4
mimic
dance_9_compress.mp4
dance_9_sim2sim_compress.mp4
dance_9_sim2real.mp4

Installation

  • Install Isaac Lab v2.3.2 by following the installation guide. We recommend using the conda installation as it simplifies calling Python scripts from the terminal.

  • Clone this repository separately from the Isaac Lab installation (i.e., outside the IsaacLab directory):

  • Using a Python interpreter that has Isaac Lab installed, install the library

python -m pip install -e source/era_okcc_humanoid_lab

Motion Tracking

Motion Preprocessing

We use GMR to retarget collected mocap data to the L7 robot.

  • Convert retargeted motions to include the maximum coordinates information (body pose, body velocity, and body acceleration) via forward kinematics,
python scripts/l7_csv_to_npz.py   --input_file {motion_name}.csv    --input_fps 30 --output_name {motion_name}  --save_to motions/{motion_name}.npz  --no_wandb

for example,

python scripts/l7_csv_to_npz.py   --input_file motions/csv/dance_7.csv   --input_fps 30 --output_name dance_7 --save_to motions/dance_7.npz  --no_wandb

This will automatically upload the processed motion file to the WandB registry with output name {motion_name}.

  • Test if the npz file works properly by replaying the motion in Isaac Sim:
python scripts/replay_l7_npz.py --motion_file motions/{motion_name}.npz

for example,

python scripts/replay_l7_npz.py --motion_file motions/dance_7.npz

Policy Training

  • Train tracking policy by the following command:
 python scripts/rsl_rl/train.py   --task=Tracking-Flat-L7_29Dof-v0    --motion_file {motion_name}   --run_name  {run_name}   --num_envs=8192   --headless

for example,

 python scripts/rsl_rl/train.py   --task=Tracking-Flat-L7_29Dof-v0    --motion_file motions/long_motion_1.npz   --run_name Tracking-long_motion_1   --num_envs=8192   --headless

Policy Evaluation

  • Play the trained policy by the following command:
# play tracking policy
python scripts/rsl_rl/play.py --task=Tracking-Flat-L7_29Dof-v0  --motion_file motions/long_motion_1.npz --model_path {model_path} --num_envs 2

Locomotion

Policy Training

  • Train locomotion policy by the following command
 python scripts/rsl_rl/train.py --task=Locomotion-Flat-L7_29Dof-v0 --run_name L7_locomotion   --num_envs=8192   --headless

Policy Evaluation

  • Play the trained policy by the following command:
python scripts/rsl_rl/play.py --task=Locomotion-Flat-L7_29Dof-v0  --model_path {model_path} --num_envs 2

Deployment

Prerequisites

pip install onnx onnxruntime mujoco pynput

Sim2Sim

  • Launch controller node:
cd deploy/

# source ros2 environment
source /opt/ros/humble/setup.bash

# build era_rl_controller package
colcon build --packages-up-to era_rl_controller

# source the setup files
source install/setup.bash

# run controller node with the tracking configuration
ros2 run era_rl_controller era_rl_controller_node --config src/era_rl_controller/configs/mimic_dance_9.yaml --mode sim2sim

# or run controller node with the locomotion configuration
ros2 run era_rl_controller era_rl_controller_node --config src/era_rl_controller/configs/loco_walk_1.yaml --mode sim2sim
  • Launch robot node (new terminal):
# source ros2 environment
source /opt/ros/humble/setup.bash

# source the setup files
source install/setup.bash

# launch era_robot node
ros2 launch era_robot era_robot_launch.py

Sim2Real

Please follow the L7 robot's official instructions to start the robot, then run the following commands to deploy the policy:

# ros2 run era_rl_controller era_rl_controller_node --config path/to/config --mode real
ros2 run era_rl_controller era_rl_controller_node --config src/era_rl_controller/configs/mimic_dance_9.yaml --mode real

ros2 run era_rl_controller era_rl_controller_node --config src/era_rl_controller/configs/loco_walk_1.yaml --mode real

Acknowledgements

This repository is built upon the support and contributions of the following open-source projects. Special thanks to:

  • IsaacLab: The foundation for training and running codes.
  • mujoco: Providing powerful simulation functionalities.
  • whole_body_tracking: Versatile humanoid control framework for motion tracking.
  • GMR: The motion retargeting and processing pipeline.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors