iit-DLSLab/Quadruped-PyMPC

A model predictive controller for quadruped robots based on the single rigid body model and written in python. Gradient-based (acados) or Sampling-based (jax)

What it solves

This project provides a Python-based framework for controlling the movement of quadruped (four-legged) robots. It solves the complex challenge of calculating how a robot should move its legs to maintain balance and perform specific gaits like trotting or bounding, using a simplified model of the robot's body.

How it works

The software uses Model Predictive Control (MPC), which constantly predicts future movements and adjusts the robot's actions in real-time. It offers two distinct approaches:

  • Gradient-based: Uses the acados library to perform precise, fast calculations on a standard CPU.
  • Sampling-based: Uses JAX to run thousands of parallel simulations on a GPU, allowing the robot to explore many possible movement paths simultaneously to find the best one.

The framework is compatible with the Mujoco physics simulator for testing and supports real-world deployment on a wide range of popular quadruped robots.

Who it’s for

This tool is designed for robotics researchers and developers working on legged locomotion who need a flexible, high-performance control system. It is ideal for those who want to experiment with different control strategies—ranging from traditional optimization to modern stochastic sampling—on real hardware or in simulation.

Highlights

  • Supports a wide variety of robots including GO2, A2, B2, GO1, Aliengo, Spot, Mini-Cheetah, and HyqReal.
  • Gradient-based MPC achieves computation times under 5ms on standard CPUs.
  • Sampling-based MPC can perform 10,000 parallel rollouts in under 2ms on consumer-grade GPUs.
  • Includes advanced features like foothold optimization, ground reaction force smoothing, and step frequency adaptation.
  • Provides modular support for real-world deployment via state estimation and communication libraries.

Related

  • Project
  • Dispatch
  • Project
  • Project
  • Project