The UxV toolbox for Matlab/Simulink provides Matlab scripts and simulink blocks for UAVs to handle MAVLink protocol, GPS, RC receivers and telemetry protocols.
This model-based design and analysis tools speed-up the back and forth between experimental tests and simulation.
Three main scripts enable decoding MAVLink messages, creating simulink model for simulation based on logged data, and generating map trajectory trace from GPS messages.
| Script | Input | Output | Function |
|---|---|---|---|
| (1) mavlink2mat | Mavlink log | .mat | matlab analysis |
| (2) mavlink2simulink | Mavlink log | .mat / .mdl (.slx) | simulation based on real data |
| (3) mavlink2kml | Mavlink log | .kml | plot GPS trace(s) on a map |
| mavlink2gui | Mavlink log | GUI | graphical exploration of mavlink log |
mavlinkgui script opens a Graphical User Interface to explore MAVLink data. It list MAVLink messages found in a log file and plot selected {message - value}. Plot script is customizable enabling user to go beyond a simple plot. The GUI provides access to the three scripts mentioned above.
10 added blocks add essential UAV features to implement an autopilot on a dsPIC DSC. These blocks complete the MPLAB blocks for Simulink from Microchip providing peripheral blocks for code generation. These work on top of the MathWorks Embedded Coder. Added features:
Except the MATH block, these blocks are typically connected to the dsPIC UART Rx/Tx block to send/receive the data flow from a GPS, a receiver, a radio link.
These blocks are developed by Lubin Kerhuel and distributed for free with the MPLAB device blocks for Simulink from Microchip.
Way Point protocol allows setting and reading WayPoint from a MAVLink compatible ground station. ↩︎
Parameter protocol enable tuning from any MAVLink ground station the Simulink tunable parameters which are normally tuned with External Mode or from the Processor In the Loop simulation (PIL). ↩︎
Sensor for Smart.Port or F.Port block is used with either the Smart Port of the F.Port block. These protocols allow sending telemetry packets back to the Remote Controller (RC) interface. It enables emulation of Frsky sensor (battery voltage and current, variometer, airspeed, GPS) adding features to your remote easily. They also enable emulation of BetaFlight telemetry. Used with LUA script, this adds features like artificial horizon, air speed, vertical speed, distance from home and many others to your remote (tested with yaapu LUA scripts). ↩︎