This repositiory contains the SimuLink Model and the necessary Matlab .mat file to implement Linear MPC on a PixHawk based Quadrotor platform. The model employs the Model Predictive Control, ROS, and Control Systems toolboxes so make sure they are included with your MATLAB distribution.
Here is a picture of the Model for reference:
The model employs the ROS Toolbox and uses the Publish and Subscribe blocks to get and receive data from the roscore.
- Subscribe: The Subscribe block subscribes to the /mavros/vision_pose/pose