FTH 3 · Whole body|INEMA.CLUB-PRO

Lesson 4 · 15 min

A policy that imitates any motion

Having the motion in the robot's format is not the same as making it perform it. If you send only the angles to the motors, it imitates for a second and falls: nobody is handling balance. In this lesson you play the boxing in MuJoCo with and without a gantry, measure each joint's error, and see what BeyondMimic, GMT and SONIC solve.

Start the lesson
Humanoid robot with a dark visor in a boxing guard in a lab, one fist in a slight motion blur and a safety cable overhead.

In this lesson you will

  1. 1Play a reference with the joints' PD
  2. 2Tracking error in degrees, per joint
  3. 3Why following angles doesn't balance the robot
  4. 4BeyondMimic (now in mjlab), GMT and SONIC: what each one does

Goal: play the motion in MuJoCo with and without a gantry and explain why a tracking policy is needed.

01From reference to standing robot

Click each block.

Click each block of the diagram to see what it does.

Virtual gantry = the base is put back at the reference pose at every step, like a robot hanging in the first test.

02Who solves motion tracking in 2026

Click on each one. All of them train on a GPU; here they are shown, not run.

1. BeyondMimic

Tracks dynamic motions (spinning, running, cartwheel) and uses a guided diffusion policy for tasks without specific training (arXiv 2508.08241, Aug/2025). The whole_body_tracking repository pins Isaac Lab 2.1.0.

As of 10/15/2026, that repository's README says it has been retired: BeyondMimic tracking continues in mjlab, in the Mjlab-Tracking-Flat-Unitree-G1 task.

03Replay with the pelvis on the gantry

The joints receive the reference at each 2 ms step; the base is placed back at the reference pose. The error is the difference between the measured angle and the reference angle at the next step.

Terminal · with gantry
F=${FTH:-$HOME/fth}; cd $F/corpo-inteiro && . $F/.venv/bin/activate
python3 kit/reproduzir.py $F/movimentos/boxe_g1.npz; echo "saída: $?"
Excerpt · kit/reproduzir.py
        if a.modo == "portico":
            fth.portico(d, r[:7])
        d.ctrl[mot] = r[adr]
        mujoco.mj_step(m, d)
Example from the repository
movimento: boxe_g1.npz · 1200 quadros a 120 Hz · 10.0 s · modo portico
passos de física: 4995 (2 ms cada)
erro médio de junta: 0.3° · pior junta: right_shoulder_roll_joint (1.9°)
queda: não
saída: 0

Average error of 0.3°: with the body supported, the PD handles it. The right shoulder, which moves the most in boxing, is the worst.

04What is used at scale (shown)

Command from the mjlab README (commit 8bb2bc9, 10/18/2026). It requires an NVIDIA GPU and a WandB account to log the motions; it was not run here and is not a prerequisite for the course.

Shown · mjlab, motion tracking on the G1 (not run here)
# github.com/mujocolab/mjlab · README (commit 8bb2bc9, 18/10/2026)
uv run train Mjlab-Tracking-Flat-Unitree-G1 --registry-name your-org/motions/motion-name --env.scene.num-envs 4096
uv run play Mjlab-Tracking-Flat-Unitree-G1 --wandb-run-path your-org/mjlab/run-id

05Practice

Measure with and without the gantry.

E1 · With gantry

5 min

Run the boxing replay with the pelvis on the gantry.

Done when: python3 kit/reproduzir.py ~/fth/movimentos/boxe_g1.npz | tail -2 → erro médio de junta: 0.3° and queda: não.

E2 · Without gantry

5 min

Run with --modo livre and note the moment of the fall.

Done when: python3 kit/reproduzir.py ~/fth/movimentos/boxe_g1.npz --modo livre | tail -1 → queda: sim, em t = 1.68 s.

E3 · The second excerpt

5 min

If you did E3 from lesson 3, replay boxe_trecho2.npz with the gantry and compare the average error and the worst joint.

Done when: python3 kit/reproduzir.py ~/fth/movimentos/boxe_trecho2.npz | grep erro → erro médio de junta: 1.5°.

06Lesson quiz

The explanation appears after your answer.

Question 1 of 3

Without the gantry, the joint error is small and the G1 still falls. Why?skill

07In three sentences

ReplayFollowing the angles works with the body supported and fails when it is free.
PolicyThe tracking policy looks at the state and the future reference and takes care of balance.
Where to trainmjlab (with the BeyondMimic pipeline) or a ready-made SONIC, on a GPU.

Going further

Previous lessonNext lesson