Skip to content

Navigation Menu

Sign in
Sign up

Latest commit

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

LAC — Linear and Angular Compliance for Humanoid Whole-body Control

MuJoCo sim2sim test stack and trained policy checkpoint for LAC on the Unitree G1 (23 DOF).

Repository layout

checkpoints/lac_g1_23dof.pt trained policy (inference-only, 52 MB)
config/policy_cfg.yaml network architecture config consumed by the loader
motions/lac_motion_library.npz 100 upper-body poses (retargeted from OMOMO)
ros2/lac_deploy/ ROS 2 package: inference / relay / stiffness_control nodes
sim/ MuJoCo simulator (vendored subset of unitree_mujoco, BSD-3)
tests/smoke.py no-ROS smoke test (obs layout + ckpt load + forward)

Installation

Tested on Ubuntu 22.04 with a conda environment built by RoboStack (ROS 2 Humble without a system ROS install).

# 1. conda env: ROS 2 Humble via robostack + tools
conda create -n lac -c conda-forge -c robostack-humble ros-humble-desktop -y
conda activate lac
conda config --env --add channels robostack-humble
conda install -c conda-forge ros-dev-tools ros-humble-rosidl-generator-dds-idl -y
# 2. python deps
pip install mujoco pygame torch numpy pyyaml
# 3. Unitree SDK (python) — also provides the CRC kernel
pip install git+https://github.com/unitreerobotics/unitree_sdk2_python.git
# 4. Unitree ROS 2 messages (unitree_hg) — build once
git clone https://github.com/unitreerobotics/unitree_ros2
cd unitree_ros2/cyclonedds_ws && colcon build # see their README for details
# source its install/setup.bash in every terminal below
# 5. this repo
git clone https://github.com/lac-humanoid/lac-code
cd lac-code/ros2 && colcon build && cd ..
# 6. sanity check (no ROS needed)
python tests/smoke.py # expect ALL PASS

DDS note: all nodes and the simulator must share the same CycloneDDS domain (the defaults here use domain 0 on interface lo).

Quick start (4 terminals + Xbox gamepad)

Plug in an Xbox-style USB gamepad (/dev/input/js0) before starting the sim.

Terminal 1 — MuJoCo sim:

cd sim/simulate_python && python unitree_mujoco.py

Terminal 2 — policy:

cd lac-code # repo root (paths resolve relative to cwd, or set LAC_ROOT)
ros2 run lac_deploy inference

Terminal 3 — relay:

ros2 run lac_deploy relay

Terminal 4 — stiffness keyboard:

ros2 run lac_deploy stiffness_control

Startup sequence (gamepad, watch terminal 2's log):

  1. In the MuJoCo window press 9 to engage the elastic support band.
  2. Press A — robot ramps to the default pose (NEUTRAL).
  3. Press A again — policy handoff at low gains (HANDOFF).
  4. Press A again — gains ramp to full (RAMP_UP -> POLICY).
  5. Press 9 to release the band. The robot now stands on its own.

Controls

Input Action
Left stick vx / vy walking velocity (±0.5 m/s)
Right stick (X) yaw rate (±0.5 rad/s)
LB / RB previous / next pose in the 100-pose motion library
D-pad up/down commanded base height ±0.02 m (range 0.56–0.78)
A advance the startup state machine
X reset to IDLE
R2 emergency stop (relay damps and exits)
Keys 1..5 / q w e r t (terminal 4) raise / lower the 5 stiffness channels (x1.25 per press)
Key 0 (terminal 4) reset stiffness to [250, 250, 250, 55, 55]
Ctrl + right-drag in the viewer apply force to a body (MuJoCo native perturb)
Ctrl + left-drag in the viewer apply torque

Suggested first experiment: pick a pose with an extended arm (LB/RB), drag the hand with Ctrl+right-drag, then lower K_lin_la (q key) from 250 to ~20 and drag again.

Motion library

motions/lac_motion_library.npz holds 100 static upper-body poses (waist_yaw + 10 arm joints) selected for diversity from motions retargeted from the OMOMO human-object interaction dataset, ordered as a nearest-neighbour chain so LB/RB moves between similar poses. Fields: upper_pose (100,11), active_mask (100,11), name, omomo_clip, omomo_frame (provenance).

License

  • LAC code: MIT.
  • sim/ is a vendored subset of Unitree's unitree_mujoco (BSD 3-Clause, © Unitree Robotics) with small modifications listed in sim/README.md.

Acknowledgments

  • Unitree Robotics for the G1 model, unitree_mujoco, the SDK, and ROS 2 message definitions.
  • OMOMO (Li et al., SIGGRAPH Asia 2023) — the motion library poses are retargeted from OMOMO motion capture.

Citation

@misc{liu2026lac,
 title={LAC: Linear and Angular Compliance for Humanoid Whole-body Control},
 author={Yang Liu and Zhongkai Gu and Wei Zhu and Mitsuhiro Hayashibe},
 year={2026},
 eprint={2608.25405},
 archivePrefix={arXiv},
 primaryClass={cs.RO},
 url={https://arxiv.org/abs/2608.25405}
}

About

Test code for LAC: MuJoCo sim2sim stack and trained policy checkpoint on the Unitree G1

Topics

Resources

Stars

10 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

AltStyle によって変換されたページ (->オリジナル) /