Sim-to-Real Transfer for Quadrupedal Locomotion via Terrain Transformer

Hang Lai, Weinan Zhang, Xialin He, Chen Yu, Zheng Tian, Yong Yu, Jun Wang · DOI

Abstract

Quadrupedal locomotion in diverse real-world environments remains a significant challenge due to the "reality gap" between simulation and physical deployment. We present Terrain Transformer (TERT), a high-capacity sequence model designed to map proprioceptive history directly to actions. TERT utilizes a novel two-stage training process: offline imitation of an expert teacher followed by online self-correction via a DAgger-inspired approach. Our results demonstrate that TERT significantly outperforms traditional Temporal Convolutional Network (TCN) and Recurrent Neural Network (RNN) based models, achieving a 100% success rate on challenging terrains like sand pits where previous state-of-the-art methods failed.

Introduction

The "reality gap"—the discrepancy between simulated physics and real-world dynamics—often causes robotic policies to fail during deployment. A common mitigation strategy is privileged learning, where a "teacher" policy is trained with access to hidden environmental data (e.g., ground friction, heightmaps), and a "student" policy is trained to mimic it using only onboard sensors. However, traditional student models often struggle with fragile latent vector estimations. TERT addresses this by treating locomotion as a sequence modeling task, leveraging the Transformer architecture's self-attention mechanism to implicitly capture environmental dynamics from historical sensor data without explicit parameter estimation.

Methods

The TERT framework employs a two-stage training pipeline to bridge the gap between simulation and reality. First, a teacher policy is trained via Reinforcement Learning (PPO) with full access to privileged environmental information.

  1. Offline Pretraining: The TERT model, a GPT-style Transformer, is trained to predict the teacher's actions based on historical observation-action sequences ($T=20$) collected from successful teacher runs.
  2. Online Correction: To address distribution shift, the student interacts with the simulator, and the teacher provides corrective labels for the student's own trajectories. This DAgger-inspired approach teaches the robot how to recover from its own errors.
The TERT training pipeline, illustrating the transition from offline pretraining to online correction.

Results and Discussion

TERT was validated on a Unitree A1 quadruped across nine challenging real-world terrains, including grass, pebbles, and sand. TERT achieved a 100% success rate on sand pits and a 60% success rate on descending stairs, significantly outperforming the RMA baseline, which failed 100% of the time on these terrains.

Analysis of the model's latent space via t-SNE visualizations shows that TERT develops a more structured and discriminative representation of different terrains compared to RMA. Furthermore, ablation studies highlighted that both the offline pretraining and online correction stages are critical for maintaining high performance.

Comparison of normalized returns and t-SNE visualizations of latent representations between RMA and TERT across various terrains.

Conclusion

Terrain Transformer demonstrates that high-capacity sequence models can effectively bypass the need for explicit environmental parameter estimation in quadrupedal locomotion. By leveraging self-attention and a robust two-stage training regime, TERT achieves unprecedented stability on complex terrains. Future research will focus on integrating exteroceptive sensors, such as LiDAR or cameras, to enable more precise navigation and foot placement on structured obstacles like upward stairs.

Summary updated

BibTeX
@inproceedings{lai2023sim,
  author = {Hang Lai and Weinan Zhang and Xialin He and Chen Yu and Zheng Tian and Yong Yu and Jun Wang},
  title = {{Sim-to-Real Transfer for Quadrupedal Locomotion via Terrain Transformer}},
  booktitle = {IEEE International Conference on Robotics and Automation},
  year = {2023},
  doi = {10.1109/icra48891.2023.10160497},
}
Figure