Skip to content

SSQP

SSQP is an implementation of a Structure-exploiting Sequential Quadratic Programming (SQP) Non-Linear Problem (NLP) solver that works natively on manifolds, specifically tailored to Optimal Control Problems (OCPs) of the following form:

\[ \begin{split} \min_{\boldsymbol{x}, \boldsymbol{u}} \sum_{k=0}^{H-1} \ell_k(\boldsymbol{x}_k, \boldsymbol{u}_k) + \ell_H(\boldsymbol{x}_H) &\\ \text{subject to} \\ \boldsymbol{x}_{k + 1} = \boldsymbol{f}_k(\boldsymbol{x}_k, \boldsymbol{u}_k)&, 0 \leq k < H \\ \boldsymbol{c}_k(\boldsymbol{x}_k, \boldsymbol{u}_k) \geq \boldsymbol{0}&, 0 \leq k < H \\ \boldsymbol{c}_H(\boldsymbol{x}_H) \geq \boldsymbol{0} & \end{split} \]

Where:

  • \(\boldsymbol{x}\) and \(\boldsymbol{u}\) are the optimization variables corresponding to the system state and controls,

  • \(H\) is the optimization horizon,

  • \(\ell_k(\cdot) \in \mathcal{R}\) is the cost function for optimization stage \(k\),

  • \(\boldsymbol{f}_k(\cdot) \in \mathcal{R}^{n_x}\) is the dynamics function for optimization stage \(k\), and

  • \(\boldsymbol{c}_k(\cdot) \in \mathcal{R}^{n_c}\) is the constraints function for optimization stage \(k\).

This problem formulation splits the OCP into multiple stages up to a desired time horizon and allows the user to assign costs and constraints for each of those stages.

\(\boldsymbol{x}\) is not required to be a flat Euclidean vector: SSQP works natively on manifolds, so a state can include components like a floating-base orientation (an \(SO(3)\)/\(SE(3)\) element) alongside ordinary vector components, with linearization and integration carried out through the correct tangent-space operators throughout. See Manifold-valued states for details.

At each iteration, SSQP quadratizes the cost and linearizes the dynamics/constraints around the current guess to build a Quadratic Program (QP), exploits the stagewise (banded) structure of that QP to solve it efficiently, and uses the QP solution as an update step, governed by a line search. See The SSQP Solver for details.

Where to start

  • Installation: build SSQP and its Python bindings from source
  • Quickstart: solve a minimal OCP with the Python API
  • FAQ: frequently asked questions about basic usage and concepts
  • Concepts: the Model, costs, constraints, dynamics, solvers and MPC
  • Examples: trajectory generation and MPC examples shipped with the repository
  • Python API Reference: generated reference for the ssqpy bindings

Repository layout

  • examples/: examples using SSQP to construct and solve OCPs for robotics tasks: offline trajectory generation, and real-time Model Predictive Control (MPC) both in simulation and on real systems.

  • include/ and src/: the C++ header and source directories for the library.

  • python/: the library's Python binding code (the ssqpy module), built using nanobind.

  • tests/: unit tests for library functionality.

  • external/: external dependencies of the library.