MATLAB: How to fly the PARROT minidrone using Simulink model

Aerospace BlocksetEmbedded Coderminidronesparrotparrot minidronessimulinkTarget Support Package

How do I fly the PARROT minidrone using Simulink model?

Best Answer

You can use the demo example asbQuadcopter from the Bug Report (Only for MATLAB R2017a or newer) if you have the license for following toolboxes.
  • Aerospace Blockset
  • Aerospace Toolbox
  • Control System Toolbox
  • Signal Processing Toolbox
  • Simulink 3D
Please follow the following steps in order to fly the PARROT minidrone using Simulink model: 
  1. Download the asbQuadcopter from the above link and follow the instructions mentioned in that page.
  2. Type "asbQuadcopterStart" in the MATLAB Command Prompt which will open the demo project.
  3. Simulate the model and play around. Double click the ‘FCS’ subsystem, which opens the ‘flighControlSystem’ reference model.
  4. Build this model. If the build goes through successfully, the shared object will be loaded onto the drone.  
  5. After successful codegeneration, create a PARROT object using the below command*
>> rs = codertarget.parrot.internal.parrotminidrone
  1. Start the drone using the below command *
>> rs.startDroneFlight
  1. Please note that the drone takes off as soon as the above command is issued. It is suggested to set the power gain value to a lower value first, to avoid any unwanted accidents.*
>> rs.setPowerGain(10)