Next Steps: Learning a Disentangled Gait Representation for Versatile Quadruped Locomotion

Alexander L. Mitchell, Wolfgang Merkt, Mathieu Geisert, Siddhant Gangapurwala, Martin Engelcke, Oiwi Parker Jones, Ioannis Havoutis, Ingmar Posner

TL;DR

This paper introduces a generative framework that learns a structured, disentangled latent space for quadruped locomotion from just a single trot style. By injecting a synthetic "drive signal" into this latent space, the system can continuously vary key gait parameters—like cadence and step height—on-the-fly. Deployed on a real ANYmal robot, the framework enables seamless gait transitions and uses anomaly detection to rapidly recover from physical disturbances.

What Problem Does This Paper Address?

While modern quadruped robots routinely traverse rough terrain, their gait planners remain surprisingly rigid. Typically, robots switch between a few discrete, pre-computed gait styles (like walking, trotting, or galloping).

Current systems struggle to vary key parameters—such as how high the robot lifts its feet or how fast it steps—continuously and online while the robot is moving. Tweakable parameters are usually optimized offline because doing so in real-time is computationally expensive. This lack of flexibility limits a robot's ability to smoothly blend maneuvers or rapidly adapt its gait when encountering unexpected slips or shoves.

Methods

The authors tackle this challenge using a Variational Autoencoder (VAE) combined with a Whole-Body Controller (WBC).

  1. Latent Space Learning: The VAE is trained on short histories of robot state trajectories (joint angles, torques, base velocities, and contact forces). It maps these high-dimensional inputs to a low-dimensional latent space. A "feet-in-contact" performance predictor is trained alongside the VAE to help structure this space based on gait phases.
  2. The Drive Signal: The authors discovered that locomotion naturally aligns along specific axes in the latent space. By overwriting a single latent dimension with a synthetic, periodic drive signal ($A_k \sin^3(\phi_k)$), they can directly manipulate the gait. Adjusting the amplitude ($A_k$) changes the foot swing height, while modifying the phase ($\phi_k$) controls cadence and full-support stance duration.
  3. Closed-Loop Control: During deployment, raw sensor data is encoded to infer the current gait phase, the drive signal is applied, and the decoder outputs a motion plan to the WBC at 400 Hz.
  4. Disturbance Detection: Because the VAE is trained on steady, unperturbed gaits, external forces (like a push) push the robot's state out-of-distribution. This causes a spike in the VAE's Evidence Lower Bound (ELBO) loss, which the system uses as a trigger to automatically increase cadence and stabilize the robot.
[Raw Sensors] -> [VAE Encoder] -> [Latent Space + Drive Signal] -> [VAE Decoder] -> [Whole-Body Controller] -> [Motors]

Datasets

  • Training Data: The VAE was trained entirely on synthetic data generated in the RaiSim physics simulator.
  • Generation Method: The authors used an existing optimization-based controller (Dynamic Gaits) to command a simulated ANYmal robot. They uniformly sampled desired base twists to create a dataset of continuous trot trajectories with fixed parameters (0.5 s swing duration, 75 ms stance duration, and 0.10 m footstep height).
  • No real-world data was used for training, showcasing successful sim-to-real transfer.

Key Insights and Ideas

  • Emergent Disentanglement: Remarkably, the model was only trained on a single trot style with fixed parameters. Despite this, it naturally discovered a disentangled latent space where gait traits are axis-aligned. You don't need to train on multiple gaits to learn how to transition between them.
  • Unsupervised Stance Clustering: The network clustered the four distinct stance phases of a trot completely unsupervised. This was driven purely by the temporal continuity of the training trajectories and the contact predictor, eliminating the need for manual labeling.
  • Biologically Inspired: Overwriting a latent dimension with a periodic drive signal closely mirrors Central Pattern Generators (CPGs) found in the spinal cords of vertebrates, bridging deep learning with biological locomotion principles.

Key Results

  • Real-Robot Deployment: The system was successfully validated on a physical 35 kg ANYmal quadruped.
  • On-the-Fly Tweakability: Operators successfully adjusted the robot's swing duration continuously from 312.5 ms down to 125 ms in real-time. They also reduced the full-stance duration to zero, transitioning the robot into a highly dynamic line-contact trot.
  • Natural Halting: By smoothly scaling the drive signal's amplitude to zero, the robot naturally transitioned from a dynamic trot to a stable, standing standstill.
  • Push Recovery: When subjected to physical shoves, the robot detected the anomaly via the ELBO (using a threshold of 11.0). It automatically halved its swing duration for 1.5 seconds, allowing it to step faster and successfully recover its balance within 3 to 4 steps.

Limitations and Future Work

  • Rudimentary Recovery Policy: While the push detection is elegant, the recovery response is a simple, hardcoded heuristic (halving the swing duration). Integrating a more sophisticated, learned recovery policy could further improve robustness.
  • Hardware Compute Constraints: To maintain a strict 1 ms real-time inference budget on the robot, the authors had to compress the VAE down to just 6 latent dimensions and 128 hidden units. Compressing the model further caused instability.
  • Single-Gait Limitation: The framework was only demonstrated on variations of a trot. Extending this method to seamlessly transition between entirely different gait families (e.g., pacing, bounding, or crawling) remains an open challenge.

Summary updated

BibTeX
@inproceedings{mitchell2022next,
  author = {Alexander L. Mitchell and Wolfgang Merkt and Mathieu Geisert and Siddhant Gangapurwala and Martin Engelcke and Oiwi Parker Jones and Ioannis Havoutis and Ingmar Posner},
  title = {{Next Steps: Learning a Disentangled Gait Representation for Versatile Quadruped Locomotion}},
  booktitle = {IEEE International Conference on Robotics and Automation},
  year = {2022},
  doi = {10.1109/icra46639.2022.9811584},
}
Figure