Skip to content
r.

ocs2

leggedrobotics/ocs2 · Public GitHub repository

Optimal Control for Switched Systems

Open project in RepoShelf

Open the project to try its demo, view the repository, or save it to your collection. Repository and demo actions use RepoShelf’s sign-in flow.

ocs2 live demo screenshot
Captured from the live demo · 2026-10-30

About this project

Author-written excerpt from the project README.

OCS2 (Optimal Control for Switched Systems) is a C++ toolbox for formulating and solving nonlinear optimal control problems, with an emphasis on real-time Model Predictive Control (MPC) for robotics.

OCS2 handles general path constraints through Augmented Lagrangian or relaxed barrier methods. To facilitate the application of OCS2 in robotic tasks, it provides additional tools to set up the system dynamics (such as kinematic or dynamic models) and cost/constraints (such as self-collision avoidance and end-effector tracking) from a URDF model. The library also provides an automatic differentiation tool to calculate derivatives of the system dynamics, constraints, and cost. To facilitate deployment on robotic platforms, OCS2 provides tools for ROS interfaces. The toolbox’s efficient and…

Requirements and intended audience

OCS2 (Optimal Control for Switched Systems) is a C++ toolbox for formulating and solving nonlinear optimal control problems, with an emphasis on real-time Model Predictive Control (MPC) for robotics.

Not recorded: account, external api key, self-hosting. Missing information does not mean there are no requirements.

Statements extracted from the author’s documentation · Checked 2026-10-25. Source: https://github.com/leggedrobotics/ocs2/blob/main/README.md

Recorded maintenance information

Last recorded source update: 2026-09-29. Saved release: 12.0 · 2023-07-14. These dates do not guarantee ongoing maintenance.

Technologies
C++
Licence
BSD-3-Clause. Generally permits modification and commercial use, subject to the licence’s notices and conditions.
Demo check
A public page loaded on 2026-11-16. This does not test every feature.

Browse related categories