Files
lerobot/examples
Martino Russi f7afeb9cb2 feat(unitree_g1): add mjlab BeyondMimic motion-imitation controller
Generalized full-body controller that deploys any mjlab BeyondMimic
motion-tracking policy (ONNX, trained without state estimation) together
with its reference clip. Gains/action-scale/default pose are read from the
ONNX metadata and the trajectory from motion.npz, so a new motion only
needs its (onnx, npz) pair -- selectable via constructor args or the
MJLAB_ONNX_PATH / MJLAB_MOTION_PATH env vars.

Key fix: the policy's anchor body is torso_link while base_ang_vel comes
from the pelvis IMU. The sim publishes the pelvis as imu_state, so the
torso orientation for motion_anchor_ori_b is reconstructed from the pelvis
quaternion + the three waist joints. Without this the anchor used the
pelvis orientation and any dynamic motion (e.g. spin kick) toppled.

Registered as MjlabMotionImitationController in make_locomotion_controller
and bundles the double-spin-kick policy + clip as the default.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-27 16:57:21 +02:00
..
2026-05-12 15:49:54 +02:00