Software
CDDP (cddp-cpp)
From github.com/astomodynamics/cddp-cpp (opens in a new tab)
- Navigation and mapping
- Library
- Apache-2.0
A C++ library of constrained differential dynamic programming solvers for trajectory optimization and model predictive control, aimed mainly at mobile robots. Python bindings are also published.
Facts
- GitHub stars
- 95read on 6 Nov 2026
- Last update
- 8 Jul 2026Newest commit on master
- Maintenance
- Maintaineda commit in the last 12 months
- Difficulty
- Advanced
Checked on GitHub on 6 Nov 2026.
Licenses
- Code
- Apache-2.0 (opens in a new tab)
Read by Robotheca from LICENSE (opens in a new tab) (Apache-2.0) at commit 59cdcb3 (opens in a new tab), on 22 Oct 2026.
- Commercial use
- Yes
Overview
What it does: Robotheca's summary
- Solves constrained optimal control problems with path and terminal constraints, using CDDP and the interior-point variant IPDDP.
- Terminal constraints are attached through the C++ API with built-in equality and inequality classes.
- Ships a few minimal C++ reference examples, including pendulum, cart-pole, unicycle, quadrotor and manipulator.
- Provides a Python portfolio that generates animations for pendulum, cart-pole, unicycle obstacle avoidance and racing line tracking.
- Installable from PyPI as pycddp, with prebuilt wheels intended for CPython 3.10-3.13 on Linux, macOS and Windows.
- Depends on autodiff, with optional Ipopt and CasADi features.
Written by Robotheca from the project's README (opens in a new tab) at commit 59cdcb3, not by its creator.
The README
The creator's own README, copied as written: README.md by @astomodynamics, at commit 59cdcb3, under Apache-2.0 (opens in a new tab). The original on GitHub (opens in a new tab).
Read the README here
Constrained Differential Dynamic Programming (CDDP) solver in C++
(opens in a new tab)
(opens in a new tab)
(opens in a new tab)

This repository contains a C++ implementation of constrained differential dynamic programming (CDDP) and related solvers for trajectory optimization and model predictive control.
Overview
This is an optimal control solver library using constrained differential dynamic programming (CDDP) written in C++. This library is particularly useful for mobile robot trajectory optimization and model predictive control (MPC).
The CDDP library solves problems in the form:
$$ \min_{\mathbf{U}} J(\mathbf{x}_0, \mathbf{U}) = \phi(\mathbf{x}_N) + \sum \ell(\mathbf{x}_k,\mathbf{u}_k) $$
$$ \mathrm{s.t.~} \mathbf{x}_{k+1} = \mathbf{f}(\mathbf{x}_k,\mathbf{u}_k) $$
$$ \quad \mathbf{g}(\mathbf{x}_k,\mathbf{u})_k\leq 0 $$
$$ \quad \mathbf{h}(\mathbf{x}_N)=0,;\mathbf{g}_N(\mathbf{x}_N)\leq 0 $$
$$ \quad {\mathbf{x}}_{0} = \mathbf{x}{(t_0)} $$
$$ \quad k = 0,1,\cdots N-1 $$
For interior-point solves, IPDDP supports path inequalities, terminal
equalities, terminal inequalities, and mixed path/terminal constrained
problems with warm-started multiplier and slack state. In the C++ API,
terminal constraints are attached with CDDP::addTerminalConstraint(...)
and should use the built-in TerminalEqualityConstraint or
TerminalInequalityConstraint classes.
Examples
The maintained example surface is now split:
- a small C++ reference set in
examples/, built whenCDDP_CPP_BUILD_EXAMPLES=ON - the Python portfolio for plotting, animation, and notebook workflows
The kept C++ examples are:
cddp_pendulum.cppcddp_cartpole.cppcddp_unicycle.cppcddp_quadrotor_point.cppcddp_manipulator.cpp
The wider historical C++ example inventory has been removed to keep the example surface focused. The kept C++ examples are intentionally minimal and do not depend on visualization libraries.
Python Portfolio
The Python bindings now ship with a small animation-focused portfolio built on top of the same solver models used by the C++ examples:
source .venv/bin/activate
python examples/python_portfolio.py --demo all
This generates GIFs under docs/assets/python_portfolio/ for:
- pendulum swing-up
- cart-pole swing-up
- unicycle obstacle avoidance
- full-lap MPCC racing line tracking
See docs/python_portfolio.md (opens in a new tab) for the gallery and regeneration command.
Pendulum swing-up:

Cart-pole swing-up:

Unicycle obstacle avoidance:

MPCC racing line tracking:

The MPCC portfolio example is a lightweight kinematic contouring-control demo.
Its vendored track data in examples/data/ is derived from the
alexliniger/MPCC (opens in a new tab) project.
The portfolio currently emphasizes animated path-constrained examples. The terminal-constraint cases added to IPDDP are covered by the regression suite rather than by a dedicated gallery animation.
Installation
Dependencies
- CMake (opens in a new tab) (Build System)
sudo apt-get install cmake # For Ubuntu
brew install cmake # For macOS
- Eigen (opens in a new tab) (Linear Algebra Library in CPP)
sudo apt-get install libeigen3-dev # For Ubuntu
brew install eigen # For macOS
Python package
Tagged releases publish the Python bindings to PyPI:
pip install pycddp
Prebuilt wheels are intended for CPython 3.10-3.13 on Linux, macOS, and Windows. If a wheel is not available for your platform yet, install from source using the steps below.
Building from source
git clone https://github.com/astomodynamics/cddp-cpp
cd cddp-cpp
mkdir build && cd build
cmake ..
make -j4
make test
Documentation
The project site is published through GitHub Pages at:
https://astomodynamics.github.io/cddp-cpp/ (opens in a new tab)
The Pages workflow builds the Markdown docs from docs/ using MkDocs.
ROS
If you want to use this library for ROS2 MPC node, please refer CDDP MPC Package (opens in a new tab). You do not need to install this library to use the package. MPC package will automatically install this library as a dependency.
References
- Y. Tassa, N. Mansard and E. Todorov, "Control-limited differential dynamic programming," 2014 IEEE International Conference on Robotics and Automation (ICRA), 2014, pp. 1168-1175, doi: <10.1109/ICRA.2014.6907001>.
- Pavlov, A., Shames, I., and Manzie, C., “Interior Point Differential Dynamic Programming,” IEEE Transactions on Control Systems Technology, Vol. 29, No. 6, 2021, pp. 2720–2727.
- Liniger, A., Domahidi, A., and Morari, M., “Optimization-based autonomous racing of 1:43 scale RC cars,” Optimal Control Applications and Methods, 2015. doi: <10.1002/oca.2123>.
Third Party Libraries
This library uses the following open-source libraries as core dependencies:
- autodiff (opens in a new tab) (MIT License)
This library also uses the following open-source libraries for optional features:
- Ipopt (opens in a new tab) (EPL License)
- CasADi (opens in a new tab) (GPL License)
Citing
If you use this work in an academic context, please cite this repository.
License
This project is licensed under the Apache License 2.0 - see the LICENSE (opens in a new tab) file for details.
Collaboration
Contributions are welcome.
Start with:
- CONTRIBUTING.md (opens in a new tab) for setup, validation, and PR expectations
- CODE_OF_CONDUCT.md (opens in a new tab) for community standards
- SECURITY.md (opens in a new tab) for vulnerability reporting guidance
Use GitHub issues for bug reports and feature requests, and open pull requests against master.
TODO
- improve python binding ergonomics
- improve parallelization
- add simulation examples and Python visualizations
- Quadruped robot
- Manipulator
- Humanoid
Files and versions
- Repository on GitHubgithub.com/astomodynamics/cddp-cpp (opens in a new tab)
- The version Robotheca read59cdcb3 (opens in a new tab)
- Latest releaseRelease v0.5.2 (10 Apr 2026)
Robotheca never hosts the code: each link goes to the creator's own page.
Use it
How to install it, in the creator's words: The project's website (opens in a new tab)
Robotheca doesn't review code. Read it before running it.
Robotheca lists software as a reference: nothing is hosted or run here, and every fact links to where it was read.