SCpp
Implementation of SCvx, linear MPC and LQR for trajectory generation and tracking
Install / Use
/learn @EmbersArc/SCppREADME
This library implements various optimal control algorithms that are particularly suited for aerospace applications.
Guidance and Control Algorithms
- Efficient Successive Convexification, a real-time guidance algorithm for optimal trajectory planning of constrained dynamical systems
- Generic linear receding-horizon SOCP MPC algorithm
- Linear Quadratic Regulator
Features
- JIT derivative code generation with CppAD/CppADCodegen
- Intuitive interface to implement custom models
- Rapid iteration with parameters files
Current Models
- 2D Rocket Model
- Rocket Landing Model with Quaternion
- Rocket Landing Model with Euler Angles
Dependencies
- C++17
- Eigen
- Boost (odeint and ptree)
- fmt (included as submodule)
- CppAD/CppADCodegen (included as submodule)
- Epigraph (included as submodule)
Instructions
Install
git clone --recurse-submodules https://github.com/EmbersArc/SCpp.git
cd SCpp
mkdir build
cd build
cmake ..
make
Run
Available executables are:
-
LQR_sim to simulate a trajectory with the classic MPC controller
-
MPC_sim to simulate a trajectory with the classic MPC controller
-
SC_oneshot to calculate one trajectory with Successive Convexification
-
SC_sim to simulate a trajectory with Successive Convexification
Calculated trajectories are written to the output/<modelname> directory.
Create a Custom Model
See existing models in the socp_models folder for some examples.
Papers
Examples
(click on videos for higher quality versions)
Rocket Trajectory Model with Free-Final-Time
<p align="center"> <a href="https://thumbs.gfycat.com/DeliriousCandidAldabratortoise-mobile.mp4"> <img width="400" src="https://thumbs.gfycat.com/DeliriousCandidAldabratortoise-size_restricted.gif"> </a> </p>SpaceX Starship Landing Trajectory
<p align="center"> <a href="https://giant.gfycat.com/RecklessBountifulKillifish.webm"> <img width="400" src="https://thumbs.gfycat.com/RecklessBountifulKillifish-small.gif"> </a> </p> <p align="center"> <img width="400" src="https://user-images.githubusercontent.com/1352472/66057427-f736be00-e538-11e9-8078-727282910f54.png"> </p>2D Rocket Landing Problem
feed-forward input tested in a box2d physics simulation
<p align="center"> <a href="https://thumbs.gfycat.com/DaringPortlyBlacklab-mobile.mp4"> <img width="400" src="https://thumbs.gfycat.com/DaringPortlyBlacklab-small.gif"> </a> </p>Cartpole
<p align="center"> <a href="https://thumbs.gfycat.com/KnobbyFlatCanvasback-mobile.mp4"> <img src="https://thumbs.gfycat.com/KnobbyFlatCanvasback-small.gif"> </a> </p>Contributing
I'm looking forward to contributions, both problem formulations and improvements to the core library.
Related Skills
node-connect
335.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
82.5kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
335.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
82.5kCommit, push, and open a PR
