Developing natural and diverse locomotion controllers for quadruped robots that can adapt to complex terrains while preserving motion style remains a significant challenge. Existing imitation-based methods face a fundamental optimization trade-off: strict adherence to motion capture (mocap) references penalizes the geometric deviations required for terrain adaptability, whereas terrain-centric policies often compromise stylistic fidelity. We introduce LatentMimic, a novel locomotion learning framework that decouples stylistic fidelity from geometric constraints. By minimizing the marginal latent divergence between the policy's state-action distribution and a learned mocap prior, our approach provides a conditional relaxation of rigid pose-tracking objectives. This formulation preserves gait topology while permitting independent end-effector adaptations for irregular terrains. We further introduce a terrain adaptation module with a dynamic replay buffer to resolve the policy's distribution shifts across different terrains. We validate our method across four locomotion styles and four terrains, demonstrating that LatentMimic enables effective terrain-adaptive locomotion, achieving higher terrain traversal success rates than state-of-the-art motion-tracking methods while maintaining high stylistic fidelity.
Figures & tables
Fig. 1 : Left to right: Stair terrain, Noisy terrain, Wavy terrain.
Fig. 2 : Overview of LatentMimic: a) We first pretrain a motion encoder to encode the motion transitions into a latent space and a motion predictor to predict the future motion transitions based on a mocap dataset. These two networks together form our Latent Prior Module . b) We then perform imitation policy learning using a mimic reward that measures the KL-divergence between the simulated and target transition in the latent space to learn the desired motion style. c) We introduce an anchor reward and a terrain adaptation replay buffer to enhance terrain traverse while preserving the desired motion style. These components aid learning and enable effective adaptation across diverse terrains. Note: The latent prior module is trained in both b) and c).
Fig. 3 : A target motion predicted from flat terrain data may result in collisions when applied to stairs.
Fig. 4 : The input of our policy consists of proprioceptive observation, historical data, and encoded target motion ztarget .
Fig. 5 : The latent mimic reward: both the simulated and the predicted target motions are encoded into the latent space, and their KL-divergence is computed.
Fig. 6 : Terrain Adaptation Module: the current policy πθ and the style policy πθstyles takes the same observation to output the action distribution. Transitions with top 10% rewards are stored to fine-tune the motion predictor.
Parameter
Randomization Range
Terrain Friction
[0.5,1.25]
Additional Base Mass
[−1.0kg,1.0kg]
COM Displacement
[−0.15m,0.15m]
Motor Strength Factor
[0.9,1.1]
KP Gain Factor
[0.8,1.3]
KD Gain Factor
[0.5,1.3]
TABLE I : Domain Randomization Parameters applied during the training process to ensure sim-to-real robustness.
Metric
Method
Pace
Pace Backwards
Trot
Trot Backwards
Base Position (m)↓
Our
0.0338
0.0734
0.1437
0.3445
LIA
0.5838
0.3523
0.3519
0.6876
AMP
0.4684
0.4547
1.4965
4.9182
Joint Angles (rad)↓
Our
0.1386
0.1061
0.1474
0.1511
LIA
0.2712
0.1624
0.3611
0.1786
AMP
0.0842
0.1772
0.1952
0.1702
TABLE II : Tracking errors of four different locomotion styles on flat terrain. The best performance is in bold. Errors are measured using mean squared errors (MSE). Joint angle and velocity errors are computed per joint.
Fig. 7 : The figure shows the t-SNE visualization of latent motion features of four different motion styles.
Fig. 8 : The left figure depicts a frame of pace in which the robot moves its legs laterally (left front and left hind together). The right figure shows a trotting frame in which the robot moves its legs diagonally (left front and right hind).
TABLE III : Robots’ success rate of traversing different terrains. Each row shows the maximum level the robot can reach with a specific success rate. Note: All methods achieve a 100% success rate on flat terrain.
Pace max level
our
w/o TA
Stairs
45
18
Noise
64
64
Waves
64
43
TABLE IV : Ablation Study: Our model can achieve the maximum level with and without the terrain adaptation module for locomotion style pace.