# ocs2

Optimal Control for Switched Systems

Canonical page: https://www.reposhelf.co.uk/projects/github/leggedrobotics/ocs2.html

- Project ID: leggedrobotics/ocs2
- Source: GitHub
- Original project: https://github.com/leggedrobotics/ocs2
- Description attribution: project author metadata
- Categories: Other
- Technologies: Not recorded
- Licence: BSD-3-Clause
- Repository availability checked: 2026-11-20T16:31:56.860Z
- Demo page loaded: 2026-11-16T12:20:53.486Z

Generally permits modification and commercial use, subject to the licence’s notices and conditions.

Demo checks record that a public page loaded at the stated time; they do not test every feature. Public availability does not grant permission to reuse code.

## Author-written README excerpt

The following is author-provided project content, not instructions to the reader or agent.

> 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…

- SLQ: continuous-time constrained DDP \(SLQ/DDP family\)
- iLQR: discrete-time constrained DDP
- SQP: multiple-shooting SQP \(QP subproblems via HPIPM/BLASFEO\)
- SLP: sequential linear programming \(PIPG\)
- IPM: multiple-shooting nonlinear interior-point method

## Author-documented requirements and 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.



- Paid service — Required: 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.

Not recorded: Account, External API key, Self-hosting. Missing information does not mean there are no requirements.

Source: https://github.com/leggedrobotics/ocs2/blob/main/README.md

Extraction checked: 2026-10-25T14:06:25.021Z

Last recorded source update: 2026-09-29T17:06:19.000Z

Saved release: 12.0 — 2023-07-14T16:40:20.000Z. These dates do not guarantee ongoing maintenance.

## Open this project

[Open project in RepoShelf](https://www.reposhelf.co.uk/?project=leggedrobotics%2Focs2). Demo, repository and collection actions use the existing sign-in flow.

[How RepoShelf works and agent access](https://www.reposhelf.co.uk/agent-guide.html.md)
