Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Bug report
description: Report a reproducible defect in the solver, bindings, build, or docs
title: "[bug] "
labels:
- bug
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to report a problem.

Please include a minimal reproduction and the exact commands you ran.
- type: textarea
id: summary
attributes:
label: Summary
description: What happened, and what did you expect to happen instead?
placeholder: A concise description of the bug and expected behavior.
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Reproduction
description: Provide the smallest reproduction you can, including commands and inputs.
placeholder: |
1. Configure with ...
2. Run ...
3. Observe ...
validations:
required: true
- type: textarea
id: logs
attributes:
label: Logs and output
description: Paste the relevant error message, stack trace, or failing test output.
render: text
- type: textarea
id: environment
attributes:
label: Environment
description: Share the platform and toolchain details relevant to the bug.
placeholder: |
OS:
Compiler:
CMake:
Python:
Build flags:
validations:
required: true
- type: textarea
id: context
attributes:
label: Additional context
description: Add anything else that might help debug the issue.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: Security policy
url: https://github.com/astomodynamics/cddp-cpp/blob/master/SECURITY.md
about: Read the security reporting guidance before disclosing a vulnerability.
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Feature request
description: Propose an improvement to the solver, examples, bindings, or docs
title: "[feature] "
labels:
- enhancement
body:
- type: markdown
attributes:
value: |
Please describe the problem first, then the change you want.
- type: textarea
id: problem
attributes:
label: Problem or use case
description: What limitation, missing capability, or workflow pain does this address?
placeholder: I am trying to ...
validations:
required: true
- type: textarea
id: proposal
attributes:
label: Proposed change
description: Describe the API, behavior, or workflow you would like to see.
placeholder: Add support for ...
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Alternatives considered
description: What workarounds or alternative designs have you considered?
- type: textarea
id: context
attributes:
label: Additional context
description: Benchmarks, references, examples, or prior art that help clarify the request.
16 changes: 16 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Summary
- Describe the change and why it is needed.

## Changes
- List the concrete code, API, testing, or documentation updates.

## Validation
- [ ] `...`

## Checklist
- [ ] I ran the relevant tests or explained why they were not run.
- [ ] I updated documentation when behavior or public interfaces changed.
- [ ] I kept the change focused and avoided unrelated cleanup.

## Notes
- Add reviewer context only when it is needed.
14 changes: 0 additions & 14 deletions .github/workflows/PR_TEMPLATE/pull_request_template.md

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build/

# Output
plots/
results/frames/
results/

# Models
models/
Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ set(dynamics_model_srcs
src/dynamics_model/spacecraft_nonlinear.cpp
src/dynamics_model/dreyfus_rocket.cpp
src/dynamics_model/spacecraft_landing2d.cpp
src/dynamics_model/spacecraft_roe.cpp
src/dynamics_model/lti_system.cpp
src/dynamics_model/spacecraft_twobody.cpp
src/dynamics_model/usv_3dof.cpp
Expand Down
27 changes: 27 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Code of Conduct

## Our standard

This project expects respectful, technical, and constructive collaboration.

Examples of expected behavior:

- focusing feedback on the code, design, and evidence
- being clear, patient, and specific in reviews and discussions
- assuming good intent while still challenging weak technical arguments
- helping other contributors understand project constraints and expectations

Examples of unacceptable behavior:

- personal attacks, harassment, or discriminatory language
- hostile or deliberately dismissive review behavior
- repeated bad-faith argumentation or thread derailment
- publishing private or sensitive information without permission

## Enforcement

Project maintainers may remove, edit, or reject comments, issues, pull requests, code, and other contributions that violate this code of conduct.

## Reporting

If you experience or witness unacceptable behavior, contact the maintainers through the repository owners' preferred contact path. For security-sensitive matters, use the process described in [SECURITY.md](SECURITY.md).
59 changes: 59 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Contributing

Thanks for contributing to `cddp-cpp`.

## Scope

This project contains:

- the core C++ trajectory optimization library
- a curated set of C++ reference examples
- optional Python bindings and portfolio demos

Keep changes focused. Avoid mixing bug fixes, refactors, formatting churn, and documentation cleanup in one pull request unless they are tightly coupled.

## Development setup

### C++ build

```bash
cmake -S . -B build
cmake --build build -j4
ctest --test-dir build --output-on-failure
```

### C++ examples

```bash
cmake -S . -B build -DCDDP_CPP_BUILD_EXAMPLES=ON
cmake --build build --target cddp_pendulum cddp_cartpole cddp_unicycle cddp_quadrotor_point cddp_manipulator -j4
```

### Python bindings

This repository uses `uv` for Python environment management.

```bash
uv venv .venv --python 3.12
uv sync
source .venv/bin/activate
pytest -q python/tests
```

## Pull requests

Before opening a pull request:

1. Make the smallest reasonable change for the problem you are solving.
2. Add or update tests when behavior changes.
3. Run the relevant build and test commands for the area you touched.
4. Update documentation when user-facing behavior, examples, or public APIs change.
5. Write a clear commit message and PR description.

PRs that include a minimal reproduction, exact validation commands, and a concise explanation of the design tradeoffs are much easier to review.

## Issues

- Use bug reports for reproducible defects.
- Use feature requests for API additions, solver improvements, or workflow changes.
- For sensitive security issues, follow [SECURITY.md](SECURITY.md) instead of opening a detailed public issue.
69 changes: 54 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,57 @@ $$
$$

## Examples
The default C++ build currently includes a barrier-strategy comparison example:
The maintained example surface is now split:

* a small C++ reference set in `examples/`, built when `CDDP_CPP_BUILD_EXAMPLES=ON`
* the Python portfolio for plotting, animation, and notebook workflows

The kept C++ examples are:

* `cddp_pendulum.cpp`
* `cddp_cartpole.cpp`
* `cddp_unicycle.cpp`
* `cddp_quadrotor_point.cpp`
* `cddp_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:

```bash
./examples/test_barrier_strategies
source .venv/bin/activate
python examples/python_portfolio.py --demo all
```

Several visualization-focused C++ examples remain in the repository, but they
are not part of the default build. Use the Python bindings for plotting and
notebook workflows.
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](docs/python_portfolio.md) for the gallery and
regeneration command.

Pendulum swing-up:
<img src="docs/assets/python_portfolio/pendulum_swing_up.gif" width="820" alt="Python pendulum swing-up portfolio demo">

Cart-pole swing-up:
<img src="docs/assets/python_portfolio/cartpole_swing_up.gif" width="820" alt="Python cart-pole swing-up portfolio demo">

Unicycle obstacle avoidance:
<img src="docs/assets/python_portfolio/unicycle_obstacle_avoidance.gif" width="820" alt="Python unicycle obstacle avoidance portfolio demo">

MPCC racing line tracking:
<img src="docs/assets/python_portfolio/mpcc_racing_line.gif" width="820" alt="Python MPCC racing line portfolio demo">

The MPCC portfolio example is a lightweight kinematic contouring-control demo.
Its vendored track data in `examples/data/` is derived from the
[`alexliniger/MPCC`](https://github.com/alexliniger/MPCC) project.

## Installation
### Dependencies
Expand Down Expand Up @@ -69,8 +111,7 @@ If you want to use this library for ROS2 MPC node, please refer [CDDP MPC Packag
## 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.
* Yuval Tassa's iLQG/DDP trajectory optimization: <https://www.mathworks.com/matlabcentral/fileexchange/52069-ilqg-ddp-trajectory-optimization>
* Andrei Pavlov's GitHub repository: <https://github.com/xapavlov/ipddp>
* 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

Expand All @@ -93,15 +134,13 @@ This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENS
## Collaboration
Contributions are welcome.

If you'd like to contribute:
1. Fork the repository.
2. Create a branch for your change, for example `feature/your-feature-name` or `fix/your-bug-fix`.
3. Make the change and add or update tests as needed.
4. Commit with a descriptive message.
5. Push the branch.
6. Open a pull request against `master`.
Start with:

- [CONTRIBUTING.md](CONTRIBUTING.md) for setup, validation, and PR expectations
- [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) for community standards
- [SECURITY.md](SECURITY.md) for vulnerability reporting guidance

Use GitHub issues for bug reports, questions, or proposed changes.
Use GitHub issues for bug reports and feature requests, and open pull requests against `master`.

## TODO
* improve python binding ergonomics
Expand Down
26 changes: 26 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Security Policy

## Supported versions

Security fixes are best-effort and are typically made against the current `master` branch.

## Reporting a vulnerability

Please do not publish vulnerability details in a public issue.

Preferred process:

1. Use GitHub's private vulnerability reporting flow for this repository if it is enabled.
2. If private reporting is not available, open a minimal public issue requesting a secure reporting path, without including exploit details, secrets, or full reproduction steps.

When reporting an issue, include:

- affected version or commit
- impact and attack surface
- reproduction steps
- proof-of-concept details only through a private channel
- any suggested mitigation or patch direction

## Disclosure

Please allow maintainers reasonable time to investigate and prepare a fix before public disclosure.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/python_portfolio/mpcc_racing_line.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading