Skip to content

Refresh examples and add Python portfolio demos#162

Merged
astomodynamics merged 6 commits into
masterfrom
feature/python-portfolio-cleanup
Apr 2, 2026
Merged

Refresh examples and add Python portfolio demos#162
astomodynamics merged 6 commits into
masterfrom
feature/python-portfolio-cleanup

Conversation

@astomodynamics
Copy link
Copy Markdown
Owner

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

  • add examples/python_portfolio.py and examples/python_portfolio_lib.py with animated pendulum, cart-pole, unicycle, and MPCC demos
  • add generated portfolio GIFs under docs/assets/python_portfolio/ and document regeneration in docs/python_portfolio.md
  • update README.md to show the Python portfolio gallery and describe the curated example split
  • reduce the C++ examples built with CDDP_CPP_BUILD_EXAMPLES=ON to a minimal maintained reference set
  • remove SpacecraftROE from the core library, tests, and Python bindings
  • remove tracked results/ artifacts and ignore that directory going forward
  • add issue templates, PR template, CONTRIBUTING.md, CODE_OF_CONDUCT.md, and SECURITY.md
  • vendor MPCC track data in examples/data/ and document its provenance from alexliniger/MPCC

Test Plan

  • cmake -S . -B build -DCDDP_CPP_BUILD_TESTS=OFF -DCDDP_CPP_BUILD_EXAMPLES=ON
  • cmake --build build --target cddp_pendulum cddp_cartpole cddp_unicycle cddp_quadrotor_point cddp_manipulator -j4
  • source .venv/bin/activate && pytest -q python/tests
  • source .venv/bin/activate && python examples/python_portfolio.py --demo all --output-dir docs/assets/python_portfolio
  • git diff --check

Related Issues

None.

How to Test

  1. Configure and build the curated C++ examples with CDDP_CPP_BUILD_EXAMPLES=ON.
  2. Activate the repo .venv and run pytest -q python/tests.
  3. Regenerate the Python portfolio with python examples/python_portfolio.py --demo all --output-dir docs/assets/python_portfolio.
  4. Inspect the generated GIFs in docs/assets/python_portfolio/, especially mpcc_racing_line.gif for the full-lap MPCC demo.

Screenshots/Videos

  • docs/assets/python_portfolio/pendulum_swing_up.gif
  • docs/assets/python_portfolio/cartpole_swing_up.gif
  • docs/assets/python_portfolio/unicycle_obstacle_avoidance.gif
  • docs/assets/python_portfolio/mpcc_racing_line.gif

Additional Notes

  • The MPCC example is intentionally a lightweight kinematic contouring-control showcase, not a full reproduction of the Liniger racing controller.
  • The branch also removes the misplaced legacy PR template under .github/workflows/PR_TEMPLATE/.

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.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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=ON and remove legacy/visualization-heavy examples.
  • Remove SpacecraftROE from the C++ library, tests, and Python bindings; add contribution/security documentation and templates; ignore results/.

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.

Comment thread examples/python_portfolio.py
Comment thread examples/python_portfolio.py
Comment thread examples/python_portfolio_lib.py
Comment thread examples/python_portfolio_lib.py
Comment thread examples/python_portfolio_lib.py
Comment thread examples/python_portfolio_lib.py
Comment thread examples/python_portfolio_lib.py
Comment thread python/tests/test_portfolio.py
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.
@astomodynamics astomodynamics added documentation Improvements or additions to documentation enhancement New feature or request cleanup labels Apr 2, 2026
@astomodynamics astomodynamics merged commit c227be6 into master Apr 2, 2026
4 checks passed
@astomodynamics astomodynamics deleted the feature/python-portfolio-cleanup branch April 2, 2026 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants