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 high-performance Model Predictive Control (MPC) framework for quadruped robots, enabling them to perform complex movements like trotting, pacing, and bounding. It addresses the challenge of maintaining stability and balance during legged locomotion by calculating optimal control actions in real-time.

How it works

The system uses a single rigid body model to predict and optimize robot movements. It offers two distinct implementation paths:

  • Gradient-based MPC: Utilizes acados for fast computation (under 5ms on a modern CPU) and includes features like foothold optimization and stability criteria based on Lyapunov functions.
  • Sampling-based MPC: Leverages jax for massive parallel rollouts (10,000 in under 2ms on a GPU), supporting strategies such as MPPI, CEMPPI, and random sampling with various control parametrizations (zero-order, linear, or cubic splines).

Who it’s for

This is designed for robotics researchers and engineers working on legged locomotion and control systems, specifically those using Mujoco for simulation or deploying to real Unitree robots.

Highlights

  • Dual-Engine Approach: Supports both CPU-based gradient optimization and GPU-accelerated sampling.
  • Real-World Ready: Compatible with Mujoco and integrated with state estimation and communication tools for real robot deployment.
  • High Efficiency: Extremely low latency for both gradient and sampling-based control loops.
  • Advanced Control Options: Includes optional smoothing for ground reaction forces and step frequency adaptation for increased robustness.

Related

  • Project
  • Project
  • Project
  • Dispatch
  • Project