Contenido principal

MAVLink Support

R2026b
Micro Air Vehicle Link communication protocol dialects and messages

The Micro Air Vehicle Link (MAVLink) communication protocol is a message protocol for sending and receiving messages between UAVs. The protocol uses a publish-subscribe pattern for data streams with specified topics and message types. There are different sub-protocols for missions and parameters. Use the MAVLink supported functions to specify predefined or custom dialects, setup clients, and send or receive messages.

To protect UAVs from unauthorized messages, MAVLink uses message signing. Note that message signing is not the same as message encryption and MAVLink does not provide message encryption. For more information about MAVLink message signing, see MAVLink Message Signing (Authentication).

The MAVLink message definitions (dialects) and MAVLink serialization helper functions in UAV Toolbox are obtained from mavlink/message_definitions/v1.0/ and mavlink/c_library_v2 version of repositories respectively.

The message definition XML files and the C-language version of serialization helper functions are made available under the MIT license.

Objects

expand all

mavlinkioCreate local MAVLink client
mavlinkclientStore remote MAVLink client information
mavlinksigningStore MAVLink signing channel information (Since R2022a)
mavlinkdialectParse and store MAVLink dialect XML
mavlinksubReceive MAVLink messages
mavlinktlogRead MAVLink message from TLOG file
heartbeatMicroserviceMAVLink Heartbeat microservice object (Since R2026b)
parameterMicroserviceMAVLink Parameter microservice (Since R2026b)
missionMicroserviceMAVLink mission microservice object (Since R2026b)
commandMicroserviceMAVLink Command microservice object (Since R2026b)
ftpMicroserviceMAVLink FTP microservice object (Since R2026b)

Functions

mavlinkmicroserviceCreate MAVLink Microservice Object (Since R2026b)
addmavlinkkeysAdd MAVLink keys from .env file (Since R2023a)
lsmavlinkkeysList MAVLink keys in MATLAB session (Since R2023a)
rmmavlinkkeysRemove MAVLink key from MATLAB session (Since R2023a)

Blocks

MAVLink Blank MessageCreate blank MAVLink message bus by specifying payload information and MAVLink message type
MAVLink DeserializerConvert serialized uint8 MAVLink data stream to Simulink nonvirtual bus
Block maskMAVLink SerializerSerialize MAVLink packet messages by converting a Simulink nonvirtual bus to a uint8 data stream

Featured Examples