PAPER DEEP DIVE
T-GMP: Terrain-conditioned Generative Motion Priors for Versatile and Natural Humanoid Locomotion
Achieving both anthropomorphic naturalness and robust terrain traversal remains a fundamental challenge in humanoid locomotion. Existing Reinforcement Learning (RL) approaches typically rely on fixed motion priors, limiting their adaptability to varying environments. We propose Terrain-conditioned Generative Motion Priors (T-GMP), a module that captures a terrain-conditioned latent motion manifold from a few expert state-terrain demonstrations using a Conditional Variational Autoencoder (CVAE). The learned priors enable smooth style transitions, facilitating a unified policy that adapts to terrain variations. We integrate T-GMP into an adversarial learning pipeline with our proposed Foothold Penalty, where a discriminator dynamically modulates naturalness constraints conditioned on local terrain features, guiding the generation of versatile and human-like motions. Experimental results demonstrate that our method outperforms existing baselines in traversal success rate and motion smoothness, while preserving biomimetically natural and physically coordinated motions.
Authors: Junhong Guo, Hao Hu, Chen Chen, Haoxuan Han, Linao Gong, Xin Yang, Zhicheng He, Yao Su, Fenghua He
Affiliations: Harbin Institute of Technology · Leju Robotics
Paper: arXiv:2606.06944 ·
Project: t-gmp.github.io
Date: June 5, 2026
Figure 1: T-GMP enables robots to exhibit versatile and natural behaviors across diverse terrains, including natural arm swinging during walking, lowering the COM on stairs and slopes, and extending the arms for balance when crossing gaps or narrow beams.
One-Sentence Summary
T-GMP uses a conditional VAE (CVAE) to learn a terrain-conditioned motion manifold from a few expert state-terrain demonstrations, combined with a terrain-conditioned discriminator and foothold penalty, enabling a humanoid robot to achieve both high traversal success rates and biomimetically natural gaits across eight terrain types with a single training run.
Background and Motivation
Humanoid robot locomotion control has long faced a fundamental tension: reinforcement learning (RL) methods have achieved remarkable progress in stability and terrain traversal success rates, but the resulting motions often exhibit "robotic" artifacts—stiff joints, unnatural postures, and a lack of biological plausibility. This is because hand-crafted reward functions struggle to capture the nuanced dynamics of human balance, especially when the robot must simultaneously optimize task objectives (e.g., velocity tracking) and stylistic constraints across diverse terrains.
To improve motion quality, mimic-based approaches have been widely adopted to distill "naturalness" and "agility" from motion capture (mocap) data into policies, enabling robots to demonstrate highly dynamic skills such as jumping, dancing, and backflipping. However, when a robot encounters complex terrains, fixed and terrain-agnostic motion priors penalize the necessary deviations required for physical stability. This creates a fundamental conflict between task completion and style preservation, often leading to stiff gaits or failure under varying environments.
The key insight is that human motion is intrinsically linked to the environment—humans employ entirely different whole-body coordination strategies when walking on flat ground, climbing stairs, or crossing obstacles. Therefore, a motion prior should not be a static template but a dynamic manifold conditioned on terrain features. T-GMP is built on this insight, embedding terrain perception into both motion generation and policy learning.
Furthermore, existing perception-driven methods predominantly focus on lower-limb stability and gait scheduling, frequently overlooking the whole-body coordination potential inherent in the humanoid form. T-GMP reframes locomotion as a terrain-conditioned whole-body coordination task, enabling the robot to autonomously recruit its entire skeletal structure, including arms and torso, to maintain stability.
Method Details
Overall Pipeline
Figure 2: Method Overview. The learning pipeline consists of three parts: (I) collecting expert locomotion data using privileged expert policies and human motion capture; (II) training T-GMP using a CVAE; (III) training a unified RL policy with a terrain-conditioned discriminator.
T-GMP's learning pipeline has three stages: (I) Data Collection—parallel training of multiple privileged expert policies and simultaneous collection of human mocap data to build a terrain-conditioned motion dataset; (II) T-GMP Training—a conditional VAE models the multi-style motion distribution; (III) Policy Training—a terrain-conditioned discriminator distills motion styles into the policy within an adversarial learning framework.
Data Collection: Terrain-conditioned Motion Dataset
To jointly model locomotion robustness and anthropomorphic naturalness, T-GMP constructs a terrain-conditioned motion dataset combining privileged policy data with human mocap data. On challenging terrains (stairs, slopes, beams), multiple privileged expert policies are trained in parallel, and the learned policies are used to collect terrain-conditioned locomotion data. The expert state at each time step $t$ is recorded as:
$$s_t = [q_t, \dot{q}_t, p_t] \tag{1}$$
where $q_t$ and $\dot{q}_t$ denote joint positions and velocities, and $p_t$ denotes end-effector positions relative to the root frame. The corresponding local height map $h_t$ is collected simultaneously. To introduce anthropomorphic motion priors, human motion data is collected on terrains amenable to motion capture (flat ground, gaps, stages) and retargeted via GMR (General Motion Retargeting) into executable robot trajectories satisfying kinematic and dynamic constraints.
The final expert dataset is $\mathcal{D} = \mathcal{D}_{\text{priv}} \cup \mathcal{D}_{\text{mocap}}$, where each trajectory $d \in \mathcal{D}$ is denoted as $d = \{(s_t, h_t)\}_{t=1}^{L}$ with $L$ being the trajectory length.
Terrain-conditioned Generative Motion Priors (CVAE)
T-GMP adopts a conditional $\beta$-VAE to model multi-style motion distributions, with its decoder serving as the T-GMP module. To explicitly incorporate terrain-conditioned information, a two-layer CNN $f_{\text{cnn}}^c$ extracts features from the local height map $h_t$, yielding a terrain embedding $h_t^{\text{emb},c} = f_{\text{cnn}}^c(h_t)$. The decoder conditions on this terrain embedding and a latent variable $z_t$ sampled from the prior distribution $p(z_t)$ to generate expert state trajectory sequences:
$$\hat{s}_{t:t+T} = \text{Decoder}(z_t, h_t^{\text{emb},c}) \tag{2}$$
The CVAE is trained by minimizing a weighted sum of reconstruction loss and regularization:
$$\mathcal{L}_{\text{cvae}} = \mathbb{E}_{(s_{t:t+T}, h_{t:t+T}) \sim \mathcal{D}} \left[ \mathbb{E}_{q_\phi(z_t | s_{t:t+T}, h_{t:t+T}^{\text{emb},c})} \left[ \|s_{t:t+T} - \hat{s}_{t:t+T}\|_2^2 \right] + \beta D_{\text{KL}}(q_\phi(z_t | s_{t:t+T}, h_{t:t+T}^{\text{emb},c}) \| p(z_t)) \right] \tag{3}$$
where $s_{t:t+T}$ and $h_{t:t+T}^{\text{emb},c}$ denote sequences of $T$ consecutive expert states and their corresponding local height map features, and $\beta$ balances reconstruction accuracy and latent space regularization. The prior distribution is a standard normal $\mathcal{N}(0, I)$.
A key design decision: during real-world deployment, only the local height map observation at the current time step is available. Therefore, the decoder is conditioned solely on a single-frame height map $h_t$ to ensure training-inference consistency. This inevitably introduces reconstruction accuracy loss, which is mitigated by shortening the reconstruction horizon $T$ to limit long-horizon prediction error propagation.
Terrain-conditioned Discriminator
To enable the policy to exhibit natural whole-body coordinated motion styles when traversing diverse terrains, T-GMP introduces Adversarial Motion Priors (AMP). However, when multiple motion priors simultaneously cover the same task, standard AMP may cause distinct motion styles to collapse into indistinguishable behaviors. To address this, the AMP discriminator is extended to a terrain-conditioned discriminator.
Specifically, a five-layer CNN $f_{\text{cnn}}^d$ extracts terrain features from the local height map, using the terrain embedding $h_t^{\text{emb},d}$ as a conditioning input alongside state transitions to guide the policy toward learning distinct motion styles across terrains. The discriminator training objective is:
$$\underset{D}{\arg\min} \; \mathbb{E}_{d^{\mathcal{M}}} \left[(D(s_k, s_{k+1} | h_t^{\text{emb},d}) - 1)^2\right] + \mathbb{E}_{d^\pi} \left[(D(s_t, s_{t+1} | h_t^{\text{emb},d}) + 1)^2\right] + \frac{\mathbf{w}^{\text{gp}}}{2} \mathbb{E}_{d^{\mathcal{M}}} \left[\|\nabla_\phi D(\phi)\|^2\right] \tag{4}$$
The discriminator output is converted to a style reward during policy training:
$$r_{\text{amp}} = \max\left[0, \; 1 - (D(s_t^\pi, s_{t+1}^\pi) - 1)^2 / 4\right] \tag{5}$$
This reward function encourages policy-induced state transitions to align with terrain-conditioned expert motion styles, guiding the policy to acquire consistent yet terrain-distinctive locomotion behaviors.
graph TD
A[Expert Data Collection] --> B[Privileged Policy Data
Stairs/Slope/Beam]
A --> C[Human Mocap Data
Flat/Gap/Stage]
B --> D[Terrain-conditioned Dataset D]
C --> D
D --> E[CVAE Training
T-GMP Decoder]
E --> F[Online Generation of
Terrain-conditioned Expert Trajectories]
F --> G[Terrain-conditioned Discriminator]
H[Policy Rollout
State Transition Pairs] --> G
G --> I[Style Reward r_amp]
I --> J[Unified RL Policy Training]
J --> H
K[Height Map h_t] --> E
K --> G
K --> J
Policy Observations and Network
The robot's observation at time step $t$ is defined as:
$$\mathbf{o}_t = [\omega_t, \mathbf{g}_t, q_t, \dot{q}_t, a_{t-1}] \tag{6}$$
where $\omega_t$ is the root angular velocity, $\mathbf{g}_t$ is the gravity direction vector, $q_t$ and $\dot{q}_t$ are joint positions and velocities, and $a_{t-1} \in \mathbb{R}^{26}$ is the action executed at the previous time step. The most recent five frames are stacked to form an augmented observation $\mathbf{O}_t = [\mathbf{o}_{t-4}, \cdots, \mathbf{o}_t]$. The Critic network has access to privileged information $\mathbf{o}_t^{\text{priv}}$ during training.
The policy network explicitly incorporates terrain perception: a CNN with the same architecture as the CVAE extracts features from the height map, and the terrain embedding $h_t^{\text{emb},p}$ is concatenated with the augmented proprioceptive observation $\mathbf{O}_t$ as input to the policy network. This enables the policy to (1) learn differentiated motion styles across terrains, and (2) attend to local terrain features for anticipatory decision-making.
Foothold Penalty
During policy training, the robot may exhibit undesirable foothold behaviors at terrain edges, such as kicking stair edges during ascent or edge-sliding during descent. T-GMP introduces a Foothold Penalty that explicitly constrains foot-terrain contact quality through ray-cast distance measurements from toe and sole regions.
The toe distance penalizes toe collisions:
$$r_{\text{toe}} = -\max\left(0, \; \left(\frac{d_{\text{toe}}^{\text{threshold}} - d_{\text{toe}}}{d_{\text{toe}}^{\text{threshold}}}\right)^3\right) \tag{7}$$
The sole distance suppresses edge-support and sliding behaviors:
$$r_{\text{sole}} = -\text{clip}(d_{\text{sole}} - d_{\text{sole}}^{\text{threshold}}, 0, 1) \cdot \mathbb{I}_{\text{contact}} \tag{8}$$
The final foothold penalty is $r_{\text{foothold}} = r_{\text{toe}} + r_{\text{sole}}$.
Experimental Results
Motion Style Distribution
Figure 3(a): Baseline RL t-SNE visualization showing loose motion distributions with significant inter-terrain overlap.
Figure 3(b): T-GMP t-SNE visualization showing highly compact intra-terrain clusters and clearly separable inter-terrain distributions.
To analyze motion style distributions, 700-step rollouts are conducted across eight terrains under four policies, collecting robot joint trajectories $\{q_t\}_{t=1}^{700}$ as motion style representations for t-SNE visualization. Comparison methods exhibit loose distributions with significant inter-terrain overlap, while T-GMP produces highly compact intra-terrain clusters and clearly separable inter-terrain distributions. Removing terrain conditioning significantly weakens the discriminator's ability to separate motion styles; removing the CVAE prevents adaptive style transitions.
Motion Smoothness
Figure 4(a): Mean and standard deviation of whole-body joint torques. T-GMP shows significantly lower torque fluctuations.
Figure 4(b): Mean and standard deviation of whole-body joint accelerations. T-GMP shows notably smaller acceleration fluctuations.
T-GMP achieves an average whole-body joint torque of 178.97 N·m and joint acceleration of 434.72 rad/s², corresponding to reductions of 30.01% and 38.20% compared to Baseline RL. This is attributed to T-GMP's effective modeling of terrain-aware anthropomorphic motion patterns, leading to increased dynamic consistency and reduced joint oscillations.
Traversal Success Rate
| Method | Gap | Beam | Stage | Stair Ascent | Stair Descent | Slope Ascent | Slope Descent |
|---|---|---|---|---|---|---|---|
| Baseline RL | 92.97 | 79.69 | 93.36 | 86.33 | 85.55 | 92.19 | 95.31 |
| T-GMP (Full) | 98.83 | 96.88 | 96.09 | 96.48 | 93.75 | 99.61 | 100.00 |
| w/o Condition | 96.88 | 81.41 | 89.06 | 96.09 | 82.42 | 98.44 | 97.66 |
| w/o CVAE | 97.27 | 78.52 | 91.80 | 91.80 | 84.38 | 96.48 | 97.66 |
| w/o Foothold | 98.05 | 94.14 | 95.70 | 95.70 | 85.94 | 99.61 | 98.83 |
Table 1: Traversal success rates (%) across eight terrains in a single run. T-GMP achieves the highest success rates on all terrains.
T-GMP achieves the highest success rates across all tested terrains. The beam traversal task shows an average improvement of 17.01 percentage points, mainly due to coordinated arm-extension behaviors for balance regulation. The stair descent task shows an average improvement of 9.18 percentage points, benefiting from adaptive COM lowering and the Foothold Penalty suppressing unstable edge contacts and sliding behaviors.
Ablation Analysis
| Ablation Variant | Key Finding |
|---|---|
| w/o Condition | Discriminator loses terrain awareness; motion styles collapse, beam success drops to 81.41% |
| w/o CVAE | Cannot generate terrain-adaptive style transitions; beam success only 78.52%, comparable to Baseline RL |
| w/o Foothold | Stair ascent/descent success drops; edge contacts and sliding behaviors increase |
Table 2: Ablation study key findings. Each component contributes significantly to specific terrain traversal rates.
Real-world Deployment
Figure 5: Real-world deployment showing terrain-adaptive anthropomorphic locomotion behaviors, including natural arm swinging on flat ground, lowered COM on stairs/slopes, and arm extension for dynamic balance on gaps and beams.
Experiments are conducted on a full-size Kuavo humanoid robot (28 DoF) across diverse terrains, including flat ground, a 0.3m high stage, stairs with 0.13m step height and 0.28m tread width, a 15° slope, a 0.4m wide gap, and a 0.35m wide beam (robot foot separation: 0.3m). T-GMP effectively preserves diverse terrain-conditioned expert motion patterns, exhibiting coordinated and anthropomorphic locomotion behaviors during real-world deployment.
Limitations
1. Paired Data Dependency (author-acknowledged): T-GMP relies on paired motion states and local height maps for training. While privileged policies can conveniently generate synchronized motion and terrain data, the resulting trajectories often lack anthropomorphic naturalness. Although mocap data provides highly natural human motions, constructing temporally aligned terrain observations remains challenging. Future work may explore adversarial motion regularization during privileged policy training to efficiently generate natural and physically feasible expert trajectories with synchronized terrain observations.
2. Perception Noise and Reconstruction Latency: The terrain perception pipeline relies on LiDAR-based environment reconstruction. LiDAR measurements inevitably contain sensing noise and reconstruction artifacts that may compromise locomotion robustness on complex terrains. Additionally, terrain reconstruction suffers from limited update frequency. Future work may investigate multi-modal perception strategies integrating depth cameras with LiDAR to improve reconstruction accuracy and perception update frequency.
Conclusion and Future Work
T-GMP unifies anthropomorphic naturalness and robust terrain traversal for humanoid locomotion. By leveraging a CVAE, the method successfully learns a generative manifold of human movements intrinsically aligned with terrain-aware physical constraints. The terrain-conditioned discriminator dynamically modulates the naturalness reward, enabling the agent to discover sophisticated balancing strategies, such as reflexive arm-spreading on a narrow beam. Experimental results demonstrate that T-GMP improves traversal success rates and motion smoothness by promoting physically coordinated and anthropomorphic whole-body behaviors across diverse terrains. This work suggests that integrating generative motion priors conditioned on perceptual observations into RL is a powerful paradigm for achieving the next level of agile and human-like robot locomotion.
Golden Quotes
"Human motion is intrinsically linked to the environment—a motion prior should not be a static template but a dynamic manifold conditioned on terrain features."
"Integrating generative motion priors conditioned on perceptual observations into RL is a powerful paradigm for achieving the next level of agile and human-like robot locomotion."
SOURCE LINKS



