In this project, I implemented Model Predictive Control to enable a drone (BLUE) to track a moving subject (YELLOW) while avoiding a moving obstacle (RED) using Potential Field Theory. Additional criteria involved tracking the subject from a specified relative angle while also maintaining a desired range from subject.
Link to implementation: https://colab.research.google.com/drive/11OneVFQIDeRMdVRs3Kff1fRPsFj_Q7Tq#scrollTo=-dnaeE8jFxXo
My approach to solving this task:
- First, I predict the subject and obstacle trajectories for a fixed horizon by assuming that they will both travel at a constant velocity throughout the horizon.
- Using the predicted trajectories of the subject and the obstacle, I then generate a trajectory for the drone. This trajectory takes into account the drone's angle from the subject, the drone's range from the subject and the drone's distance from obstacles.
- Finally, I use an MPC controller to find the optimal acceleration inputs in order for the drone to track the generated trajectory. I use the drone's acceleration limits and double integrator dynamics as constraints.