G1 legs + pelvis world model (2.7k parameters)
A small learned world model of the Unitree G1 humanoid's legs and pelvis: given what the body has been doing and the legs' and waist's joint targets, it predicts how the body will move — the torso's position and attitude, and where the palms end up in the world. It knows nothing about tasks: the arms' joints and payloads come in from the arm models, never from here. A sampling planner (MPPI) imagines a few hundred futures with it every 50 ms, and walking with a payload, or being pushed, is written as costs on those futures.
- 2,695 learned parameters. The physics is hand-written: a stance leg holds its foot where it landed and follows the pelvis by inverse kinematics, its ground wrench from the leg's physics; a swing leg runs PD torque and gravity through a per-joint inertia, integrated implicitly; the pelvis is a Newton–Euler hub (foot forces in, body motion out). The network carries only the correction: a 35 → 12 residual MLP (ground wrench + swing acceleration, in the heading frame) and 9 log-inertias, shared by both legs — the right leg is seen through the left's mirror. Untrained, it is exactly the physics.
- Task-free. Trained on g1-legs-v1: 2,000 episodes (9.7 h of the G1, 24 % falls) flown by a walker (toolbot-g1-velocity) as the exciter — randomised masses, torso CoM, foot friction, encoder bias, hand payloads (66 % of episodes carry one), pushes, action noise, at 50 Hz. The dataset is private (see the humanpilot repo).
legs_pelvis_v0.pt: trained on 20 ms steps.legs_pelvis_v0r.pt: retrained from v0 with 0.5 s rollouts — the current default.
By Edgar Moreau · huggingface.co/Ethgar
Try it
pip install torch
python load_example.py
load_example.py loads legs_pelvis_v0r.pt and prints the learned part.
How good
The bar: 10 × 20 s of walking, commands changing every 2–5 s, the arms hidden from the legs
(humanpilot, scripts/eval_torso.py):
| forecaster | torso position, cm (0.25 / 0.5 / 1.0 s) | heading, deg | palm in the world, cm |
|---|---|---|---|
| hold (nothing moves) | 14.4 / 30.0 / 59.5 | 8.2 / 8.8 / 16.5 | 15.0 / 30.2 / 59.6 |
| command integrated, τ 0.3 s | 1.8 / 3.7 / 10.5 | 8.0 / 4.6 / 7.9 | 5.3 / 5.0 / 12.5 |
v0 beats the second row up to 0.5 s; what remains at the palm is the gait's sway, which the integrator ignores. v0r (val 9.66 on the held-out eval) is the version the body runs.
Use it in a body
The full model is the hand-written physics of the humanpilot body
(humanpilot/model/{leg,hub,legs_pelvis}.py) with these learned parameters, frozen behind rollout() for MPPI in
the worldpilot core:
import torch
from humanpilot.model.legs_pelvis import LegsPelvis
model = LegsPelvis() # the G1 + the hand-written physics
model.load_state_dict(torch.load("legs_pelvis_v0r.pt", weights_only=False)["model"])
# one 20 ms step: joint targets (legs + waist) in, the body's motion out (model.step)
Lineage
- walker / data exciter: Ethgar/toolbot-g1-velocity (ONNX, plain MuJoCo; pelvis within 2.5 cm of mjlab's after 3 s)
- the arms during data: armpilot's SO-101 arm world model, mirrored onto the G1 (swing, hold or taken)
- planner: MPPI over imagined futures, the worldpilot core — the legs model is never retrained for a task