MAVLink
Protocol for communicating with small unmanned vehicles.
MAVLink (Micro Air Vehicle Link) is a protocol used to communicate with small unmanned vehicles. It functions as a header-only message marshalling library. The protocol was initially released in early 2009 by Lorenz Meier under the GNU Lesser General Public License (LGPL).
The protocol is primarily employed for communication between a Ground Control Station (GCS) and unmanned vehicles, as well as for intercommunication among a vehicle's subsystems. It can transmit data such as the vehicle's orientation, GPS location, and speed.
In version 1.0, the packet structure follows a specific format. After version 2, this structure was expanded.
To maintain message integrity, a cyclic redundancy check (CRC) is calculated for each message, covering all bytes up to the last two. The CRC also ensures that the sender and receiver agree on the message being transferred. It is computed using an ITU X.25/SAE AS-4 hash of the packet bytes, excluding the Start-of-Frame indicator (evaluating 6+n+1 bytes, where the extra +1 is a seed value). A seed value is appended to the data during CRC computation. This seed is generated with each new message set of the protocol and is hashed similarly to the packets from each message specification. Systems using MAVLink can use a precomputed array for this purpose. The CRC algorithm has been implemented in many languages, including Python and Java.
The payloads of the packets are MAVLink messages. Each message is identified by an ID field in the packet, and the payload contains the message's data. An XML document in the MAVLink source defines the data stored in this payload. For example, the message with ID 24 is extracted from this XML document. Note that while the XML document describes the logical ordering of fields, the actual wire format (and typical in-memory representation) reorders the fields to reduce data structure alignment issues, which can cause confusion when reading generated code.
MAVLink is used as the communication protocol in many projects, which may imply some compatibility between them. A tutorial explaining the basics of MAVLink has been written.
See also: ExpressLRS.
- First release
- early 2009
- Creator
- Lorenz Meier
- License
- GNU Lesser General Public License (LGPL)
- Version 1.0 packet structure
- defined
- Version 2 packet structure
- expanded
- Crc algorithm
- ITU X.25/SAE AS-4 hash
Lore & Background
MAVLink was first released early 2009 by Lorenz Meier under the GNU Lesser General Public License. It is used mostly for communication between a Ground Control Station (GCS) and unmanned vehicles, as well as for inter-communication of the vehicle's subsystems. The protocol can transmit orientation, GPS location, and speed. In version 1.0, the packet structure was defined; after version 2, it was expanded. To ensure message integrity, a cyclic redundancy check (CRC) is calculated for each message up to the last two bytes, using an ITU X.25/SAE AS-4 hash of the bytes in the packet excluding the Start-of-Frame indicator. A seed value is appended to the data when computing the CRC, generated with each new message set. The CRC algorithm has been implemented in many languages, including Python and Java. The payloads from the packets are MAVLink messages, each identifiable by an ID field. An XML document in the MAVLink source defines the data stored in the payload, though the actual wire format reorders fields to reduce data structure alignment issues.
Reader's Guide
MAVLink serves as a communication protocol in many projects, implying some compatibility between them. Its significance lies in providing a standardized method for data exchange between ground control stations and unmanned vehicles, as well as among vehicle subsystems. The protocol's packet structure, with version 1.0 and an expanded version 2, supports transmission of orientation, GPS location, and speed. The CRC field ensures message integrity and agreement between sender and receiver. The use of an XML document for message definitions, despite wire-format reordering, helps maintain consistency. A tutorial explaining the basics of MAVLink has been written, aiding adoption. The protocol's implementation in multiple languages, including Python and Java, broadens its accessibility. Its legacy is as a foundational tool for unmanned vehicle communication, with its open-source license facilitating widespread use.
More in Unmanned Aerial Vehicles 1-24
Spotted an error? Know more?
Reader corrections go straight into our review queue. Suggest an edit · How this site is sourced
