Learning optimal gaits and styles for terrain-adaptive quadruped locomotion

Guillaume Bellegarda, Auke IjspeertarXiv 2026 · arXiv

TL;DR

Researchers have developed a two-stage reinforcement learning framework that enables quadruped robots to master 11 different gaits—from walking to galloping—across challenging terrains like stairs and gaps. Their key finding is a "biological epiphany" for robotics: every single gait in the classic taxonomy is "optimal" depending on the specific combination of terrain, speed, and whether you value energy efficiency, stability, or smoothness.

What Problem Does This Paper Address?

In both biology and robotics, a recurring question is: which gait is best? Historically, the answer has been sought through the lens of energy efficiency on flat ground, which is why most legged robots today default to a "trot."

However, real-world environments are rarely flat. When a robot encounters a wide gap, a steep set of stairs, or rubble, a trot might no longer be the most efficient or even the safest choice. Most current Deep Reinforcement Learning (DRL) controllers allow a gait to "emerge" implicitly, which often results in the policy getting stuck in a local optimum (usually a trot) and failing to explore the full repertoire of possible movements. This paper aims to systematically evaluate a broad repertoire of gaits across diverse terrains to determine how "optimality" actually shifts.

Methods

The authors propose a hierarchical, bio-inspired architecture that decouples how to move from which movement to choose.

  1. Stage 1: Learning the Repertoire. The researchers combined DRL with Central Pattern Generators (CPGs)—mathematical models of spinal neural circuits that produce rhythmic patterns. By using a CPG-based action space, they could enforce 11 distinct gait couplings (defined by the Hildebrand taxonomy) while the RL policy learned to modulate "locomotion style" parameters: body height, foot ground clearance, and foot offsets.
  2. Stage 2: Optimal Selection. With the Stage 1 controller frozen, they trained a lightweight "selector" policy. This policy observes the terrain and commanded velocity, then picks the best gait from the repertoire to optimize a specific user-defined metric, such as Cost of Transport (COT), base stability, or joint smoothness.
The two-stage control architecture: Stage 1 learns to execute all gaits, while Stage 2 learns to select the best one for the situation.

For real-world deployment, they added a Heightmap Encoder that translates raw depth images from an onboard camera into a local terrain map, allowing the robot to "see" and adapt its gait and style in real-time.

Datasets

The system was trained and evaluated using Isaac Gym, a high-performance physics simulation. The "dataset" consists of procedurally generated terrains including:

  • Slopes (up to 0.5 rad)
  • Stairs (up to 0.25m height)
  • Gaps (up to 0.55m width)
  • Uniform rough terrain and random mixed blocks.

The researchers tested the framework's limits by evaluating it on "out-of-distribution" terrains—difficulties nearly 50% beyond what was seen during training.

Key Insights and Ideas

  • The "No Single Winner" Result: Perhaps the most striking finding is that all 11 gaits appeared as optimal under at least one terrain–metric–velocity combination. For example, while the trot is great for stability on flat ground, bound-style gaits are superior for clearing wide gaps or minimizing joint acceleration on rough terrain.
  • Optimality is Multi-Dimensional: You cannot ask "what is the best gait" without specifying what you are optimizing for. A gait that is energy-efficient might be incredibly unstable.
  • CPGs as a Robust Abstraction: Using abstract oscillators instead of direct joint torques makes the policy remarkably robust. It allows for "cross-embodiment" transfer—the same policy trained on a small robot could control a robot five times its mass without retraining.
  • Decoupling is Essential: If you try to learn gait selection and low-level control simultaneously, the robot usually settles for a "jack-of-all-trades" trot. Freezing the low-level skills first is what enables the high-level "intelligence" to emerge.
Figure 3: Optimal gaits across terrains and metrics. Top: test terrains ranked in difficulty from 1 (easiest) to 5 (most difficult). Difficulty 5 corresponds to the steepest slopes, tallest steps, widest gaps (and smallest platforms), most uneven rough terrain, and largest random mixed blocks. Bottom: the gait achieving the lowest mean Cost of Transport, base angular velocity, and joint acceleration across five terrain difficulties and four velocity commands (0.5–2 m/s), averaged over 100 parallel agents on 10 m terrains. Lower values are better for each metric, and the corresponding gait is shown for each terrain difficulty and velocity combination. When multiple gaits achieve metric values within 5% of the minimum, their colors appear in a checkerboard pattern. Remarkably, all 11 gaits appear as optimal under at least one scenario.

Key Results

  • Versatility: The robot successfully navigated a complex "parkour" course, autonomously transitioning between gaits (e.g., switching from a walk to a bound to jump a gap) to minimize power consumption.
  • Generalization: The system demonstrated zero-shot adaptation to a "limping" 3-legged gait it had never seen during training.
  • Scale Invariance: The policy was successfully transferred from a Unitree Go1 to the much larger Aliengo (2x mass) and B2 (5x mass) robots.
  • Bipedal Mode: By adding just one pitch-tracking reward term, the framework enabled the quadruped to walk in a "handstand" (front legs) or upright (rear legs) mode across the same challenging terrains.
  • Hardware Validation: The controllers were successfully deployed on physical Unitree Go1 and Go2 robots, handling 0.7m gaps and 0.21m obstacles using only onboard sensing.

Limitations and Future Work

While the framework is highly capable, the authors note a few areas for improvement:

  • Sagittal Plane Focus: The current controller acts primarily in the sagittal (forward/backward) plane. This leads to failures when the robot encounters obstacles that are significantly off-center, as it lacks sophisticated lateral foot placement.
  • Fixed Coupling Strengths: The inter-oscillator coupling strength is currently a fixed parameter. The authors suggest that making this learnable or speed-dependent could better mimic biological systems where coupling varies with intensity.
  • High-Level Planning: Integrating this gait selection with long-horizon path planning would allow a robot to choose a path and a locomotion strategy that jointly optimize for mission constraints like battery life or stealth.

Summary updated

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.
BibTeX
@misc{bellegarda2026learning,
  author = {Guillaume Bellegarda and Auke Ijspeert},
  title = {{Learning optimal gaits and styles for terrain-adaptive quadruped locomotion}},
  year = {2026},
  eprint = {2611.25958},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.25958},
}
Figure