Using Monitor and Tune with Image Processing for Parrot Minidrone
The image-processing algorithm can be used as an additional input to control the flight of a Parrot® minidrone. In the Simulink® model, this algorithm is part of a separate subsystem (Image Processing System) which integrates with the main subsystem (Flight Control System). The tasks that are being executed in the two subsystems run at different rates.
The image-processing algorithm can be analyzed by using the Monitor and Tune feature. In this case, the signal monitoring and image-processing run at the same priority, which results in a slow-down of the image-processing algorithm. To ensure that image-processing runs at real-time, you may need to disable the Monitor and Tune action.
Note
The performance limitations are due to the limited computational power of the Parrot minidrone when signal monitoring and parameter tuning is used along with image-processing from the drone's camera.
However, if you want to use Monitor and Tune feature to analyze the image-processing algorithm in the Simulink model, you need to change the settings accordingly:
Note
The guidelines explained in this section requires that you install Simulink Coder™ before using the Monitor and Tune feature for the Simulink model, as it provides additional options for the same.
On the Simulink toolstrip, go to Hardware tab, open the Prepare gallery and click Control Panel.
In the External Mode Control Panel, click Signal & Triggering.
The External Signal & Triggering dialog box displays a list of blocks and signals in the model that support data uploading and logging. By default, all the items listed are selected for viewing in the External mode and logging data (see the x label for each signal). (For more details about External mode, refer to Signal Monitoring and Parameter Tuning of Simulink Model documentation)
Change the settings for selection of signals because logging of multiple signals during image processing slows down both the image-processing algorithm and the External mode logging:
Ensure that you select only the signal that is important for visualization. If you would like to view a signal using a Video Viewer block (from the Computer Vision Toolbox™) or a Scope/Display block, connect it at the output of the intermediate stage of the image-processing algorithm. In this case:
In the External Signal & Triggering dialog box, clear the Select all option (by default, this option is selected).
Click the row corresponding to the Video Viewer block or Scope/Display block.
Click the on option (which appears at the right side of the dialog box). This ensures that the Video Viewer or Scope/Display is the only block that can be viewed in External mode, and the performance of image-processing algorithm is not affected.
Click Apply and then OK.
Note
In the Simulink model, avoid using multiple Video Viewer blocks for visualization of image data as it slows down the image processing.
Remove some signals from uploading any data for analysis. To do this:
In the External Signal & Triggering dialog box, clear the Select all option (by default, this option is selected).
Navigate through the list and identify the unwanted signals and Scope/Display blocks that are being logged from the Flight Control System subsystem.
Click the row corresponding to the signal or Scope/Display block, and click the off option (which appears at the right side of the dialog box). This ensures that these signals or Scope/Display blocks are not used for logging of any data, thereby improving the overall performance of the drone while the image-processing is in progress.
Click Apply and then OK.
See Also
Code Generation Simulink Template for Image Processing for Parrot Minidrone | Fly a Parrot Minidrone Using the Quadcopter Simulink Model