Skip to content

patrickmckeen/OldPlanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OldPlanner

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.

Layout

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 by ADCS.controller.plan_and_track_base in Generalized_ADCS.
  • pysat — Python view of the C++ Satellite class used by ADCS.controller.plan_and_track.build_csat.

Building

mkdir build && cd build
cmake ..
cmake --build . -j

Outputs:

  • build/tplaunch.cpython-3XX-*.so and build/pysat.cpython-3XX-*.so (the pybind modules consumed from Python)
  • build/tp_test and build/tp_test2 (Catch2 unit-test binaries)

Dependencies

  • C++14 compiler
  • CMake ≥ 3.16
  • Armadillo (brew install armadillo on macOS, apt install libarmadillo-dev on Debian/Ubuntu)
  • Python 3.10+ with headers
  • pybind11 (fetched at configure time)
  • Catch2 v3 (fetched at configure time)

Running C++ tests

cd build
ctest --output-on-failure -j

Or directly:

./build/tp_test
./build/tp_test2

Use from Python (standalone)

import sys
sys.path.insert(0, "/path/to/OldPlanner/build")

import tplaunch
import pysat

Use from Generalized_ADCS

When 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.

About

C++ trajectory planner (AL-iLQR + Armadillo) for Generalized_ADCS. Extracted from the in-tree trajectory_planner/ subtree.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors