My solution to Airsim Competition at NeuRIPS using Rapid Trajectory Plannind and MPC.
See attached pdf for implementation details.
This was written for the AirSim NeuRIPS 2019 competition as a very fast prototype. It's shared here for people interested in a state of art implementation for drone racing in Python. All I did was combining a fast planner with a MPC controller, adding a python wrapper on top.
The system is tested on Ubuntu 18.04 with python 3.6 on a Ryzen 2700x CPU. Actual performance on your platform can strongly vary.
Within Daniel
folder, the planning.py
is inherited and slightly adapted from Mark Mueller. control.py
is an interface to the code generated ACADO implementation of the drone controller, inherited from Davide Falanga. If I'm violating any license agreement here please let me know. Adapting the mpc_control/codegen.sh
allows you to generate highly efficient C code and python wrapper from ACADO, differently from what is available in the repo.
You need to install AirSim first following instructions, remember to generate settings as instructed, and get the finals environment.
Clone repo from ACADO and rpg-mpc at the same level at this repo. ACADO is used for codegen, and for now only the solver is taken from the rpg-mpc repository. You need to adapt the pathing in mpc_control/codegen.sh
otherwise.
Move the acado source file into the acado toolkit folder for code generation. (This is not elegant but a working solution):
mv mpc_control/quadrotor_model_thrustrates.cpp ../../ACADOtoolkit/examples/code_generation/mpc_mhe/
Now execute
cd mpc_control
./codegen.sh
And you will create a python binding for the C generated MPC code.
Then you should be able to run python daniel.py --level_name 'Final_Tier_1'
. If you are lucky, you should be able to reach the goal within 55 seconds.