Refresh examples and add Python portfolio demos#162
Merged
Conversation
Introduce animated Python portfolio examples and generated assets for the new bindings. Document the gallery in the README and cover the demo generation path with tests.
Prune the old example inventory down to a small compiled reference set. Also remove the SpacecraftROE model from the core build, tests, and Python bindings.
Add standard issue and pull request templates, contributor guidance, and lightweight community policies. Also move the PR template to GitHub's standard location and link the new docs from the README.
Drop generated images and GIFs from the repository and ignore the results directory going forward. This keeps the repo focused on source, tests, and doc assets that are still referenced.
Vendor a compact racing track and add a full-lap kinematic MPCC showcase for the Python portfolio.\n\nThis wires the new demo into the gallery, adds focused regression coverage, and documents the Liniger MPCC track provenance explicitly.
There was a problem hiding this comment.
Pull request overview
This PR refreshes the repo’s “examples + bindings” surface by adding a Python portfolio (with animations and an MPCC demo), curating the C++ example set down to a small compile-checked reference pack, and removing the SpacecraftROE dynamics model (and its bindings/tests). It also adds standard GitHub contribution/security templates and ignores/removes generated results/ artifacts.
Changes:
- Add Python portfolio demos + gallery docs/assets (pendulum, cart-pole, unicycle obstacle avoidance, MPCC) and regression tests for the portfolio.
- Curate native C++ examples built under
CDDP_CPP_BUILD_EXAMPLES=ONand remove legacy/visualization-heavy examples. - Remove
SpacecraftROEfrom the C++ library, tests, and Python bindings; add contribution/security documentation and templates; ignoreresults/.
Reviewed changes
Copilot reviewed 62 out of 140 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
README.md |
Updates example documentation and embeds the Python portfolio gallery. |
examples/python_portfolio.py |
New CLI entrypoint to build/save portfolio GIFs. |
examples/python_portfolio_lib.py |
New portfolio implementation: solvers, MPCC demo, and Matplotlib animations. |
python/tests/test_portfolio.py |
Adds regression tests for portfolio solves + GIF writing. |
docs/python_portfolio.md |
Adds gallery page and regeneration instructions. |
examples/data/README.md |
Documents MPCC track provenance. |
examples/CMakeLists.txt |
Replaces legacy example build with curated reference example targets. |
examples/cddp_pendulum.cpp |
Removes plotting/frames logic; keeps a compile-checked reference solve + summary output. |
examples/cddp_cartpole.cpp |
Removes plotting/frames logic; keeps a compile-checked reference solve + summary output. |
examples/cddp_unicycle.cpp |
Removes plotting/frames logic; keeps a compile-checked reference solve + summary output. |
examples/cddp_manipulator.cpp |
Removes plotting/frames logic; keeps a compile-checked reference solve + summary output. |
examples/test_barrier_strategies.cpp |
Removes a legacy example that is no longer part of the maintained reference set. |
include/cddp-cpp/dynamics_model/spacecraft_roe.hpp |
Removes the SpacecraftROE public header. |
src/dynamics_model/spacecraft_roe.cpp |
Removes the SpacecraftROE implementation. |
CMakeLists.txt |
Removes SpacecraftROE from the core build source list. |
tests/dynamics_model/test_spacecraft_roe.cpp |
Removes the SpacecraftROE unit tests. |
tests/CMakeLists.txt |
Removes the (commented) SpacecraftROE test target lines. |
python/src/bind_dynamics.cpp |
Removes SpacecraftROE binding exposure. |
python/src/bind_solver.cpp |
Removes SpacecraftROE from the GIL-skip allowlist. |
python/pycddp/__init__.py |
Removes SpacecraftROE from the Python public API imports. |
SECURITY.md |
Adds a security policy and disclosure guidance. |
CONTRIBUTING.md |
Adds contribution workflow + build/test commands (including uv usage). |
CODE_OF_CONDUCT.md |
Adds collaboration and enforcement guidelines. |
.github/PULL_REQUEST_TEMPLATE.md |
Adds a standard PR template at the GitHub default location. |
.github/ISSUE_TEMPLATE/bug_report.yml |
Adds a structured bug report template. |
.github/ISSUE_TEMPLATE/feature_request.yml |
Adds a structured feature request template. |
.github/ISSUE_TEMPLATE/config.yml |
Adds issue template configuration with security policy link. |
.github/workflows/PR_TEMPLATE/pull_request_template.md |
Removes the legacy misplaced PR template file. |
.gitignore |
Ignores results/ directory going forward. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Address Copilot review feedback by validating animation inputs, forcing a headless backend in the portfolio CLI, and checking solver trajectories before wrapping demo results.\n\nThe Python test extra now includes matplotlib, and the portfolio regression covers invalid animation settings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR refreshes the repository surface around examples, Python bindings, and contribution workflow.
It adds a Python animation portfolio for
pycddp, trims the noisy legacy C++ example set down to a small maintained reference pack, removes the ROE dynamics model, and adds standard GitHub contribution templates and docs.It also adds a full-lap kinematic MPCC portfolio demo with explicit track provenance.
Changes
examples/python_portfolio.pyandexamples/python_portfolio_lib.pywith animated pendulum, cart-pole, unicycle, and MPCC demosdocs/assets/python_portfolio/and document regeneration indocs/python_portfolio.mdREADME.mdto show the Python portfolio gallery and describe the curated example splitCDDP_CPP_BUILD_EXAMPLES=ONto a minimal maintained reference setSpacecraftROEfrom the core library, tests, and Python bindingsresults/artifacts and ignore that directory going forwardCONTRIBUTING.md,CODE_OF_CONDUCT.md, andSECURITY.mdexamples/data/and document its provenance fromalexliniger/MPCCTest Plan
cmake -S . -B build -DCDDP_CPP_BUILD_TESTS=OFF -DCDDP_CPP_BUILD_EXAMPLES=ONcmake --build build --target cddp_pendulum cddp_cartpole cddp_unicycle cddp_quadrotor_point cddp_manipulator -j4source .venv/bin/activate && pytest -q python/testssource .venv/bin/activate && python examples/python_portfolio.py --demo all --output-dir docs/assets/python_portfoliogit diff --checkRelated Issues
None.
How to Test
CDDP_CPP_BUILD_EXAMPLES=ON..venvand runpytest -q python/tests.python examples/python_portfolio.py --demo all --output-dir docs/assets/python_portfolio.docs/assets/python_portfolio/, especiallympcc_racing_line.giffor the full-lap MPCC demo.Screenshots/Videos
docs/assets/python_portfolio/pendulum_swing_up.gifdocs/assets/python_portfolio/cartpole_swing_up.gifdocs/assets/python_portfolio/unicycle_obstacle_avoidance.gifdocs/assets/python_portfolio/mpcc_racing_line.gifAdditional Notes
.github/workflows/PR_TEMPLATE/.