This code reimplements GFOLD algorithm in Python with use of the fantastic cvxpy utility. The algorithm was defined by a number of papers, but chiefly this paper by Ackimese, Carson, and Blackmore at JPL.
- Calculate fuel optimal spacecraft landing trajectories
- Generate embeddable C code for real-time trajectory calculation (~0.3 second calculation time 1x 2.4GHz)
- Autonomous landing of Kerbal Space Program rockets
- Attitude control
- Robust control
- Control of any kind (this is a guidance algorithm!)
-
If you wish to do a static calculation (not generating C code)
- Define your vehicle and environment in GFOLD_Static_Parms
- All notation follows conventions laid out in the original paper
- Comment / Uncomment the constraints you wish to have in GFOLD_Static
- Run
python GFOLD_Static.py
(requires scipy) - View the "evil" plots (this name is just a joke btw)
-
If you wish to do C code generation
- Set
test = 0
at the top ofGFOLD_Generate.py
- Run
python GFOLD_Generate.py
(requires cvxpy_codegen) - Fix some of the known-bugs cvxpy_codegen creates - See issues page of the repo - Attempt to compile, and solve each error as they come
- Compile the generated C code
- (Optional:) Install the compiled CPython code into your Python distribution with setup.py if you wish to use the compiled code from Python - Be aware that the Python2.7 Windows Compiler provided by Microsoft will not work because it has a pathetically tiny stack heap size. Recommend using MinGW on Windows!
- Set
- Since this is a pre-alpha research project, the main documentation is found in
#code comments
, and in the content of the paper itself.
- Python 2.7 (I'm sorry about still using python 2, Mr. Guido, but cvxpy_codegen is the constraint here...)
- scipy (for static solutions)
- cvxpy (for static solutions)
- cvxpy_codegen (for code generation)
GPLv3, copyleft license.
Chose this license because I spent way too many late nights and heartbeats working on this - and want to see what people do with it and have changes propagated forward!