¶
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:
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.
Sample Results¶
More videos, including trajectory generation and simulated and real MPC, are in the Gallery.
Where to start¶
- Installation: install SSQP with pip, or build it 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
ssqpybindings
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/andsrc/: the C++ header and source directories for the library.python/: the library's Python binding code (thessqpymodule), built using nanobind.tests/: unit tests for library functionality.external/: external dependencies of the library.