Skip to content

OCS2

  • Software
  • Humanoids and robot learning
  • Library

A C++ toolbox for formulating and solving nonlinear optimal control problems, aimed at real-time Model Predictive Control (MPC) for robotics.

Made by ETH Zurich Robotic Systems Lab, Switzerland (checked on github.com/leggedrobotics (opens in a new tab)).

Source on GitHub: github.com/leggedrobotics/ocs2 (opens in a new tab). Facts read at commit 2638675 (opens in a new tab).

Licenses

Code
BSD-3-Clause (opens in a new tab)

Read by Robotheca from LICENCE.txt (opens in a new tab) (BSD-3-Clause) at commit 2638675 (opens in a new tab), on 16 Oct 2026.

Commercial use
Yes

What it does

  • Provides several solvers: SLQ and iLQR (DDP family), SQP, SLP, and a multiple-shooting interior-point method.
  • Supports switched-system optimal control problems with mode schedules and jump maps.
  • Handles hard and soft path constraints via Augmented Lagrangian and relaxed barrier methods.
  • Offers analytic derivative interfaces plus automatic differentiation (CppAD) and optional code generation.
  • Includes robotics tooling built from URDF models: kinematics, centroidal models, and self-collision constraints.
  • Provides ROS interfaces, messages, and visualization/plotting tools for deploying MPC on robots, with example robots such as a legged robot, quadrotor, and cartpole.

Written by Robotheca from the project's README (opens in a new tab) at commit 2638675.

Getting started

Difficulty
Advanced
Hardware it needs, as the project states it
Designed for robotic platforms with limited onboard computation power; no specific hardware requirements are stated.

Maintenance

Status
Maintained: a commit in the last 12 months
Newest commit
16 Dec 2025 on main
Latest release
v12.0 (14 Jul 2023)

Checked on GitHub on 16 Oct 2026.

Robots on Robotheca that use it

No robot on Robotheca is linked to it yet. Links come from a robot's robot.yaml, from its dependency files read as text, or from Robotheca's editors.

Robotheca lists software as a reference: nothing is hosted or run here, and every fact links to where it was read.