C++ trajectory planner add-on for
Generalized_ADCS, with
Python bindings via pybind11. Originally vendored inside
Generalized_ADCS at trajectory_planner/; extracted into a standalone
repo so the Python side can stay pure-Python.
This is the "OldPlanner" — an augmented-Lagrangian iLQR-based
trajectory optimiser built on Armadillo. The newer, Eigen-based
optimiser lives in SALTRO. Both
add-ons are wired into Generalized_ADCS the same way: a git
submodule, built out-of-tree into ./build/, with a Python helper
that imports the compiled pybind modules from there.
src/
ArmaCSV.{cpp,hpp} # CSV ⇆ Armadillo helpers
ArmaNumpy.{cpp,hpp} # Armadillo ⇆ NumPy via pybind11
planner/
GeneralUtil.{cpp,hpp} # math + quaternion utilities
PlannerUtil.{cpp,hpp} # core planner support routines
PlannerUtilPy.{cpp,hpp} # planner utilities with Python bindings
Satellite.{cpp,hpp} # spacecraft dynamics + actuator model
OldPlanner.{cpp,hpp} # the AL-iLQR optimiser
PyPlanner.{cpp,hpp} # pybind11 entry point → tplaunch module
tp_test.cpp, tp_test2.cpp # Catch2 unit tests
rapidcsv.h # vendored single-header CSV parser
CMakeLists.txt
Two pybind11 modules are produced:
tplaunch— the planner entry point used byADCS.controller.plan_and_track_basein Generalized_ADCS.pysat— Python view of the C++Satelliteclass used byADCS.controller.plan_and_track.build_csat.
mkdir build && cd build
cmake ..
cmake --build . -jOutputs:
build/tplaunch.cpython-3XX-*.soandbuild/pysat.cpython-3XX-*.so(the pybind modules consumed from Python)build/tp_testandbuild/tp_test2(Catch2 unit-test binaries)
- C++14 compiler
- CMake ≥ 3.16
- Armadillo (
brew install armadilloon macOS,apt install libarmadillo-devon Debian/Ubuntu) - Python 3.10+ with headers
- pybind11 (fetched at configure time)
- Catch2 v3 (fetched at configure time)
cd build
ctest --output-on-failure -jOr directly:
./build/tp_test
./build/tp_test2import sys
sys.path.insert(0, "/path/to/OldPlanner/build")
import tplaunch
import pysatWhen this repo is checked out as a submodule of Generalized_ADCS,
ADCS/controller/helpers/optional_dependencies.py knows where to
find tplaunch and pysat; no sys.path manipulation is needed
from user code.