Research
TERRA: Terrain-Aware Reconstruction, Retargeting and Control for Musculoskeletal Locomotion
Muscle-actuated agents trained with reinforcement learning can now imitate complex human motion, but almost entirely on flat ground. Two obstacles block progress: motion capture datasets rarely…

- arXiv
- 2609.38653 · Preprint · not peer-reviewed
- Published
- 2026-09-29
- Authors
- Merkourios Simos, Chengkun Li, Bianca Ziliotto, Alexander Mathis
In plain words
Muscle-actuated agents trained with reinforcement learning can now imitate complex human motion, but almost entirely on flat ground.
AI summary
Overview
Research area: Physics-based robotics and computational biomechanics — specifically musculoskeletal (muscle-actuated) locomotion control, motion retargeting, and terrain reconstruction from motion capture.
Technical level: Advanced. The paper assumes familiarity with reinforcement learning (PPO), MuJoCo/MJX simulation, musculoskeletal models, motion retargeting via interaction meshes, and sequential quadratic programming.
Scope: TERRA is an end-to-end pipeline that recovers task-relevant terrain geometry from body kinematics alone, retargets motion onto a full-body muscle-actuated model under anatomical and contact constraints, and trains a single terrain-aware tracking policy on a 9.4-hour, five-dataset motion–terrain library.
What This Paper Is About
Muscle-actuated agents trained with reinforcement learning can now imitate complex human motion, but almost entirely on flat ground. Two obstacles block progress: motion capture datasets rarely include terrain geometry aligned with the motion, and mapping human motion onto a complex musculoskeletal body must preserve foot contacts, avoid penetration, skating and floating, and respect anatomical and tendon limits — problems that get worse on non-flat terrain.
TERRA addresses both: from kinematic trajectories alone it infers the support surfaces (ramps, staircases, independent platforms, seats) that the motion implies, produces physically valid retargeted references for a muscle-driven body, and trains one controller that can track held-out motions over those terrains.
Key Contributions
-
Terrain reconstruction from motion alone. TERRA combines four explicit terrain priors (horizontal support boxes, inclined ramps, staircases, seats) with positive surface evidence (stationary, low ankle/toe landmarks) and negative free-space evidence (the rest of the body's trajectory). It separates continuous ramps from discrete surfaces using ankle–toe orientation during stance and swing-foot clearance profiles.
-
Terrain-aware musculoskeletal retargeting. It adapts OmniRetarget's interaction-mesh objective and adds orientation, touchdown-anchor, ankle/toe displacement, leg-separation, swing-sole clearance, terrain-clearing lift, and seat signed-distance residuals, solved frame-by-frame with a sequential quadratic program, followed by post-hoc repair of tendon discontinuities and collision outliers.
-
A paired motion–terrain library and a single muscle-actuated policy. Motion–terrain pairs from five datasets yield 9.4 hours of diverse locomotion used to train one reference-conditioned policy on the finger-disabled MyoFullBody model (354 Hill-type musculotendon actuators, 83 MuJoCo joints, 49 active polynomial couplings).
-
Benchmarks plus a physiological comparison. Evaluation spans terrain classification and geometry against known apparatus dimensions and PRISM meshes, retargeting validity, held-out policy tracking, and a qualitative comparison of policy muscle activity and vertical ground-reaction forces against held-out EMG and force-plate data.
Main Findings
-
Terrain classification is near-perfect, and the physical cues are what do it. TERRA reached 99.9% terrain-family accuracy over N = 5,474 labeled clips (3,476 Gait120 + 1,282 Darmstadt + 716 Vielemeyer). Removing the foot-orientation and swing-clearance cues dropped accuracy to 73.5% while leaving other metrics essentially unchanged. The subject-clustered 95% CI for pooled family accuracy was 99.853–99.982% over 144 dataset–subject clusters.
-
Geometry errors are small against known apparatus. Grade MAE was 0.223° ± 0.244° (N = 1,190); riser MAE was 8.08 ± 6.99 mm on Gait120 (N = 1,184) and 5.17 ± 4.36 mm on Darmstadt (N = 1,282); stool height MAE was 45.62 ± 13.57 mm (N = 1,102); Vielemeyer grade MAE was 0.536° ± 0.353° (N = 568). Across independent captures, grade MAE was 0.544°/0.529° at 7.5°/10° and riser MAE was 7.36/4.34/3.61 mm at 100/170/240 mm.
-
TERRA beat both reconstruction baselines on all terrain categories. On PRISM mesh geometry (31/31 successes), foot height MAE was 12.95 ± 6.56 mm, seat 11.16 ± 5.93 mm, observed 12.20 ± 6.36 mm, with raised-footprint coverage 98.0 ± 0.6%, flat coverage 47.3 ± 5.5%, and raised-footprint IoU 90.8 ± 12.4%; the Voronoi baseline reached 34.13 / 15.44 / 26.29 mm and the contact least-squares baseline 102.41 / 204.21 / 145.10 mm.
-
Retargeting violations dropped sharply. On AMASS-terrain, TERRA succeeded on 993/993 motions with contact MAE 10.24 ± 9.21 mm, 97.1% of events within 50 mm, 0.7% penetrating and 2.2% floating, raised-support precision/recall/F1 of 98.6/89.7/93.9, toe–ankle pair MAE 9.01 ± 7.46 mm, and 0.077% ± 0.444% free-space penetration.
-
Ablating the residuals isolates their effect. Across 6,498 retargeting attempts, TERRA (no residuals) had 33.45% ± 33.63% terrain penetration; the full pipeline reduced this to 0.16% ± 2.46%, while contact-timing F1 rose from 88.49% to 93.80% and tendon-discontinuity rate fell from 0.134% to 0.026%. TERRA had the best value on all five violation metrics and on contact F1 among all compared methods (GMR, OmniRetarget, MM-MoCap-Body, TERRA+Voronoi).
-
The single policy handles held-out motion over all four terrain families. TERRA-retargeted references gave the highest completion rate (87.59% ± 0.18%) with MPJPE 74.47 ± 1.51 mm, versus OmniRetarget 80.29% / 87.23 mm. TERRA+Voronoi achieved lower MPJPE (71.65 mm) but lower success (82.16%).
-
Family breakdown shows where each variant wins. TERRA had the highest success on flat (91.70%), ramps (99.49%), boxes (46.45%), and seats (89.32%), and the lowest MPJPE on flat (70.01 mm), ramps (66.74 mm), and boxes (82.50 mm); TERRA+Voronoi was best on stairs (85.01% success, 66.65 mm) and had the lowest seat MPJPE (83.09 mm). Boxes remained the hardest family for every method.
-
Reconstruction degrades gracefully. Clean accuracy was 99.93%; 2 mm, 5 mm, and 10 mm landmark noise gave 99.91%, 99.51%, and 97.06%; removing 10%, 20%, 30% of support intervals gave 97.30%, 94.40%, 90.04%, with stools degrading most (down to 70.36% at −30%); 80%/120% threshold perturbations gave 99.95%/99.91%.
-
Physiological comparison is qualitative. Min–max-normalized population-averaged waveforms for vertical GRF and three representative muscles per condition (from VL, VM, SOL, GAS, BF, TA) show both similarities and visible mismatches in EMG timing and shape across level walking, ramp descent, stair descent, and sit/stand. The authors present this as evidence TERRA could support future physiological study, not as a quantitative validation.
Methodology in Plain English
Step 1 — Everything starts as skeleton motion. Inputs come in AMASS-compatible SMPL-H format (plus C3D, MAT, and TRC for marker-based data) and are converted to 52 world-space joint positions and rotations, then shifted vertically so the lowest toe sits at z = 0. Seventeen SMPL-H landmarks (pelvis, spine, head, bilateral hip/knee/ankle/toe, shoulder/elbow/wrist) are paired with the muscle model's body origins.
Step 2 — Guess the ground from the feet. Any interval where an ankle or toe stays slow and low is treated as a foot planted on a surface. Its median height, minus a joint-specific offset, becomes a candidate surface level. Nearby candidate heights are grouped into levels using a 4 cm split threshold, with groups wider than 8 cm recursively divided. Everything else the body does becomes evidence about where terrain cannot be, used to trim geometry so it does not intersect the moving body.
Step 3 — Decide ramp versus stairs. The foot's ankle–toe pitch during stance is compared against what a flat surface and an inclined surface would predict. If the two hypotheses are within 2°, a swing-clearance score breaks the tie: near-linear foot-height transitions indicate ramps, early-ascent or delayed-descent profiles indicate discrete steps. Seats are detected separately from pelvis motion (slow for at least 0.4 s, positioned outside the feet's convex hull).
Step 4 — Retarget under constraints. Each frame solves a small optimization over 89 generalized coordinates that blends the interaction-mesh objective (keeping the body's relationship to the scene points intact), rotation matching at pelvis/hips/knees, foot anchoring at touchdown, penalties on horizontal foot motion, leg-separation and swing-clearance limits, and a seat-contact term — all subject to hard non-penetration and joint-limit constraints. A per-iteration cap of 10 mm stops a deep penetration from making the subproblem arbitrarily large.
Step 5 — Train one controller. PPO on MJX–Warp with 8,192 parallel environments at 100 Hz (five 2 ms physics steps per action), layer-normalized gated-residual MLPs of width 2048,512,512,512,512, 4 billion steps per policy, roughly 20 hours on four A100 GPUs. The policy sees proprioception, muscle commands and activations, four foot and toe touch sensors, and an 11×11 height map at 0.1 m spacing centered on the pelvis, plus one-step and future targets (0.2–0.8 s) without a motion phase signal. Adaptive motion sampling upweights hard motions. Episodes end when mean site error exceeds 0.15 m or root-orientation error exceeds 1 rad.
Step 6 — Compare against people. Held-out recordings from Gait120, Darmstadt, and Vielemeyer are used to place policy-generated EMG and vertical GRF next to measured human traces, each independently min–max normalized to compare waveform shape.
Why This Matters
Most large motion-capture corpora record bodies, not worlds. TERRA shows that the world can be recovered well enough from the body alone to train physically valid, muscle-actuated locomotion over non-flat ground — turning existing scene-less datasets into terrain-aware training data without new capture campaigns. That is a meaningful shift for both robotics (humanoids must handle the stairs, ramps, and chairs built for humans) and neuroscience (studying how muscle-level control adapts across affordances).
Real-world applications:
- Humanoid and legged robot deployment in human-built environments: staircases, ramps, curbs, seating.
- Clinical and rehabilitation biomechanics: using reconstructed terrain plus muscle-actuated simulation to examine gait on stairs and inclines, and to compare simulated muscle activity against patient EMG.
- Animation and digital humans: generating physically plausible, contact-consistent motion over reconstructed environments from performance capture.
- Exoskeleton and prosthesis design: evaluating muscle-level control strategies over the terrain types users actually encounter.
Industry relevance: the pipeline reuses existing mocap assets rather than requiring scanned scenes, which lowers the data cost for anyone training locomotion controllers. The reconstruction and retargeting stages are also usable independently of the RL stage, as quality-control tooling for motion libraries.
Future Directions
- Quantitative physiological validation. The EMG and vertical-GRF comparison is explicitly qualitative and min–max normalized. Establishing how closely policy-generated muscle activity matches measured signals — in absolute amplitude and timing, not just normalized shape — remains open.
- Closing the accuracy-versus-executability gap. TERRA had the highest completion rate but TERRA+Voronoi had lower MPJPE, and TERRA+Voronoi was better on stairs. Understanding why better tracking error does not translate into better task completion, and improving the weakest family (boxes, 46.45% success even for TERRA), are clear next steps.
- Robustness to sparse or missing contacts. Support-interval removal degrades accuracy noticeably, most severely for stools (70.36% at −30%). Motions with few or brief contacts — and terrain priors beyond the four considered — are not addressed.
- Scaling and generalization. The reported policies were trained for 4 billion steps each on 9.4 hours of motion; whether this recipe extends to larger repertoires, unseen terrain compositions, and real hardware is untested here. The paper states code and data will be made publicly available.
Target Audience
Researchers and graduate students in robot learning, musculoskeletal simulation, and computational biomechanics who work on motion imitation, retargeting, or terrain-aware locomotion. It is also relevant to graphics and animation researchers interested in reconstructing environments from motion, and to biomechanics groups who want to connect learned muscle control to measured EMG and ground-reaction-force data. Readers need comfort with reinforcement learning and constrained optimization to follow the method sections; the results tables are readable with less background.
Authors’ abstract
Recent advances in musculoskeletal modeling and reinforcement learning have enabled muscle-actuated agents to reproduce increasingly complex human motions. Yet these capabilities remain largely confined to flat ground, in part because motion datasets rarely include aligned terrain geometry and because retargeting terrain interactions to complex musculoskeletal bodies is challenging. We present TERRA, an end-to-end pipeline for terrain-aware retargeting and control of…
The full abstract on arXivRelated papers
- Burden, Bounty, or Bliss? Muscle-Aware Retargeting and Null-Space Exploration for Whole-Body Musculoskeletal Control 2026-11-07 · cs.RO · Key terms of the title in common
- Multi-Terrain Mastery: A Comprehensive Controller for Bipedal Locomotion 2026-09-27 · cs.RO · Key terms of the title in common
- UniExo: Unified Multi-Skill Policies for Musculoskeletal Locomotion and Co-Adaptive Exoskeleton Control 2026-09-17 · cs.RO · Key terms of the title in common
- RoboSynChallenge: Mastering Real-World Dexterity via Generalizing Synthesized Manipulation Skills 2026-08-12 · cs.RO · Also by Chengkun Li
- Multifunctional Locomotion Control of Multi-Jointed BURs with Swimming and gait Capabilities 2026-09-29 · cs.RO · Key terms of the title in common