Learning optimal gaits and styles for terrain-adaptive quadruped locomotion
TL;DR An RL policy driving coupled oscillators learns 11 quadruped gaits with terrain-adapted posture, and a second policy picks the gait that minimizes a chosen cost such as power or base rotation. Every gait is the best one for some terrain, speed and metric (the trot is most energy-efficient in only about a quarter of cases), and the same policies gallop a real Go1 or Go2 across a 0.7 m gap.
What they do
Learned quadruped controllers usually settle on one gait, most often a trot, so it is unclear which gait is best where. This paper learns 11 gaits, from lateral sequence walk to rotary gallop, on seven terrain types, compares them on energy, base stability and joint smoothness, and trains a selector that picks gaits online for a chosen criterion.
How it works
- CPG action space. The policy sets the amplitude and frequency of four coupled oscillators plus body height, swing-foot clearance and foot offset. A coupling matrix imposes the gait’s phase pattern, and inverse kinematics turns foot targets into joint angles.
- Stage 1. One PPO policy for a Unitree Go1 learns all gaits on all terrains, with the gait resampled every few seconds and one velocity-tracking reward for all gaits, without style rewards.
- Stage 2. With Stage 1 frozen, a small policy picks one of the 11 gaits at each step, with a separate reward per criterion. It trains in minutes; Stage 1 takes hours.
- Hardware. A CNN-GRU encoder, trained with DAgger, estimates the height map from one RealSense D435i depth camera.
Results
- Over 100 simulated robots on 10 m courses at 0.5-2.0 m/s, every gait minimizes at least one of cost of transport, base angular velocity or joint acceleration somewhere. The trot is most energy-efficient in only about 25% of velocity-terrain combinations.
- Each Stage 2 policy beats the other two on its own target metric. An uncoupled baseline that may form its own gaits is not optimal in most cases.
- Zero-shot, the robot gallops across 0.8 m gaps (training maximum 0.55 m), and the Go1 policy also controls a Go2, an Aliengo (2x mass) and a B2 (5x mass).
- On a real Go1 and Go2 it bounds or gallops over a 0.21 m obstacle and across a 0.7 m gap at 1 m/s.
Limitations
The gait rankings depend on the shared training reward and its weights. Control is mainly in the sagittal plane, so simulated failures cluster where mixed blocks are hit off-center. New criteria change only gait choice, not the frozen gait parameters. Hardware results are demonstrations without reported success rates.
Videos
Figures

Abstract
Animals use many different gaits to locomote at different speeds across varying terrains. A longstanding question in biology and robotics is: which gait is best? This question is most often addressed from an energy-efficiency perspective on flat terrain, leaving open how the answer depends on terrain and on the criterion optimized. Here we show that gait optimality is determined jointly by terrain, performance metric, and velocity. We use deep reinforcement learning and networks of abstract oscillators, modeling spinal central pattern generators, to learn 11 quadrupedal gaits across diverse challenging terrains, together with the locomotion style (base height, foot ground clearance, foot offsets) that each requires. A second policy then selects among them to optimize a user-specified criterion such as cost of transport, base stability, or joint smoothness. Across these performance metrics and within this repertoire, every gait is optimal under at least one terrain-metric-velocity combination. The framework adapts zero-shot to gait couplings and styles never seen during training, to terrains far beyond the training distribution, and to larger quadrupeds five times the training mass. With a single additional pitch-tracking reward term, the same gait couplings also support bipedal-mode locomotion. Our method provides a general and systematic way to produce expressive locomotion and to select the gait best suited to a given terrain and criterion. Project page: https://guillaume10.github.io/terrain-gaits.
Summaries are written automatically from each paper's text. Figures and videos come from the paper and its project page; all credit goes to the authors.
