leggedrobotics/ocs2

Optimal Control for Switched Systems

What it solves

OCS2 provides a C++ toolbox for formulating and solving nonlinear optimal control problems, specifically designed for real-time Model Predictive Control (MPC) in robotics. It addresses the challenge of implementing numerically stable and efficient control on robotic platforms that often have limited onboard computation power.

How it works

The toolbox uses a variety of solvers (including SLQ, iLQR, SQP, SLP, and IPM) to handle optimal control problems. It supports switched-system OCPs with mode schedules and jump maps. To simplify robotic setup, it integrates with URDF models to define system dynamics, costs, and constraints (such as self-collision avoidance). It also features automatic differentiation for calculating derivatives and provides ROS interfaces for deployment.

Who it’s for

It is designed for robotics engineers and researchers who need to implement real-time MPC for complex robotic systems, such as legged robots, quadrotors, or mobile manipulators.

Highlights

  • Multiple Solvers: Supports a wide range of algorithms including SLQ, iLQR, SQP, SLP, and IPM.
  • Switched-System Support: Handles single- and multi-domain problems using mode schedules and jump maps.
  • Constraint Handling: Manages hard and soft constraints via Augmented Lagrangian and relaxed barrier methods.
  • Robotics Tooling: Includes URDF-to-model helpers via Pinocchio and self-collision constraints via HPP-FCL.
  • ROS Integration: Provides dedicated messages, nodes, and visualization tools for ROS 1 and ROS 2.
  • Automatic Differentiation: Utilizes CppAD for calculating derivatives of system dynamics and costs.

Related

  • Project
  • Project
  • Project
  • Project
  • Project