This document provides a high-level overview of Aligator, a C++ library for efficient trajectory optimization in robotics and beyond. It introduces the library's architecture, core components, solver algorithms, and integration capabilities.
For detailed information on specific topics:
Aligator is a trajectory optimization library designed for robotics applications including motion generation, planning, optimal estimation, and model-predictive control (MPC). The library provides modular components for formulating optimal control problems and efficient solvers for constrained trajectory optimization.
Key capabilities:
Sources: README.md1-99
Aligator implements two main trajectory optimization algorithms:
| Algorithm | Description | Main Class |
|---|---|---|
| ProxDDP | Proximal Differential Dynamic Programming with augmented Lagrangian constraint handling | SolverProxDDPTpl |
| FDDP | Feasible Differential Dynamic Programming | SolverFDDPTpl |
The ProxDDP algorithm is the primary solver, offering robust constraint handling through a two-level optimization structure (outer augmented Lagrangian loop, inner DDP-like iterations). It supports parallel computation and multiple rollout types.
Sources: README.md28-31 include/aligator/solvers/proxddp/solver-proxddp.hpp28-36
Architecture Overview
The library follows a layered design:
TrajOptProblemTpl and StageModelTpl define the optimal control problemSolverProxDDPTpl and SolverFDDPTpl implement trajectory optimization algorithmsSources: CHANGELOG.md1-499 include/aligator/solvers/proxddp/solver-proxddp.hpp1-367
The TrajOptProblemTpl<Scalar> class represents a trajectory optimization problem as a sequence of stages plus terminal constraints and costs. It stores:
StageModelTpl instances (one per time step)Sources: include/aligator/solvers/proxddp/workspace.hxx9-10
Each StageModelTpl<Scalar> encapsulates the components for a single time step:
ExplicitDynamicsModel (defines state evolution)CostAbstractTpl (stage cost)ConstraintStackTpl (path constraints)The stage model provides methods to evaluate costs, dynamics, constraints, and compute their derivatives.
Sources: include/aligator/solvers/proxddp/workspace.hxx29-30 include/aligator/solvers/proxddp/workspace.hpp1-155
The ManifoldAbstractTpl<Scalar> base class abstracts state space geometry. Concrete implementations include:
VectorSpaceTpl: Euclidean space ℝⁿSE2, SO3, etc.MultibodyPhaseSpace: Configuration-velocity space for multibody systemsCartesianProductTpl: Products of manifoldsManifolds provide integration, difference, and Jacobian operations respecting the space geometry.
Sources: CHANGELOG.md175-181
ProxDDP Two-Level Structure
The SolverProxDDPTpl implements an augmented Lagrangian method:
run method): Updates constraint multipliers and penalty parameter mu_ until primal and dual feasibility achievedinnerLoop method): Solves a penalized subproblem via DDP-like iterationsgar subsystemKey solver components stored in the solver instance:
workspace_: WorkspaceTpl (primal-dual variables, LQR problem, gradients)results_: ResultsTpl (optimal trajectories, multipliers, gains)linear_solver_: RiccatiSolverBase (LQR solver: serial, parallel, or dense)Sources: include/aligator/solvers/proxddp/solver-proxddp.hxx419-529 include/aligator/solvers/proxddp/solver-proxddp.hpp36-195
The GAR (Generalized Approximate Riccati) subsystem provides efficient solvers for linear-quadratic trajectory optimization problems arising as subproblems in the main DDP iterations.
The LqrProblemTpl<Scalar> represents a multi-stage LQR problem as a sequence of LqrKnotTpl stages. Each knot contains:
Q (state), R (control), S (cross-term)A, BC, Dq, r, f, dSources: include/aligator/solvers/proxddp/workspace.hpp42
Three Riccati solver implementations inherit from RiccatiSolverBase:
| Solver Class | Description | Use Case |
|---|---|---|
ProximalRiccatiSolver | Serial proximal Riccati recursion | General purpose, single-threaded |
ParallelRiccatiSolver | Parallel block-tridiagonal solver | Long horizons with multiple threads |
RiccatiSolverDense | Stage-dense Bunch-Kaufman | Very dense stage Hessians |
The parallel solver divides the horizon into "legs", solves them independently, then links via a condensed KKT system.
Sources: include/aligator/solvers/proxddp/solver-proxddp.hxx12-14 CHANGELOG.md393-399
Pinocchio provides rigid-body dynamics support. Aligator integrates via:
MultibodyPhaseSpace: State space for (q, v) configurationsMultibodyConstraintFwdDynamics: Forward dynamics with contactsFrameTranslationResidual, FramePlacementResidual, etc.Sources: README.md24 CHANGELOG.md232-233
An optional compatibility layer (BUILD_CROCODDYL_COMPAT) allows using Crocoddyl's ActionModel and cost functions with Aligator's backend solvers. This provides access to Crocoddyl's modeling library while leveraging Aligator's ProxDDP algorithm.
Sources: README.md25-26
Build System Overview
Aligator uses CMake as the primary build system with support for:
double scalar type (controlled by ALIGATOR_ENABLE_TEMPLATE_INSTANTIATION)Distribution options:
conda install -c conda-forge aligatorpixi.tomlSources: README.md33-92 doc/advanced-user-guide.md1-173
The codebase is organized into the following main directories:
include/aligator/: C++ header files
core/: Core abstractions (manifolds, constraints, costs, problem definition)solvers/: Solver implementations (ProxDDP, FDDP)gar/: Linear algebra subsystem (Riccati solvers, LQR problems)modelling/: Concrete dynamics, costs, constraintsbindings/python/: Python bindings using Boost.Pythonexamples/: C++ and Python example applicationstests/: Unit testsSources: CHANGELOG.md1-499
Recent versions (0.14.0+) introduced advanced memory management:
LqrProblemTpl, WorkspaceTpl, and Riccati solvers support custom allocatorsmimalloc_resource provides high-performance allocationThis infrastructure enables memory pooling and reduces allocation overhead in time-critical MPC applications.
Sources: CHANGELOG.md74 CHANGELOG.md160-166 include/aligator/solvers/proxddp/workspace.hpp40
Refresh this wiki
This wiki was recently refreshed. Please wait 7 days to refresh again.