Suvarna Garge (Editor)

MAVLink

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit

MAVLink or Micro Air Vehicle Link is a protocol for communicating with small unmanned vehicle. It is designed as a header-only message marshaling library. MAVLink was first released early 2009 by Lorenz Meier under LGPL license.

Contents

Applications

It is used mostly for communication between a Ground Control Station (GCS) and Unmanned vehicles, and in the inter-communication of the subsystem of the vehicle. It can be used to transmit the orientation of the vehicle, its GPS location and speed.

Packet Structure

In version 1.0 the packet structure is the following:

CRC field

To ensure message integrity a CRC is calculated to every message into the last two bytes. Another function of the CRC field is to ensure the sender and receiver both agree in the message that is being transferred. It is computed using an ITU X.25/SAE AS-4 hash of the bytes in the packet, excluding the Start-of-Frame indicator (so 6+n+1 bytes are evaluated, the extra +1 is the seed value).

Additionally a seed value is appended to the end of the data when computing the CRC. The seed is generated with every new message set of the protocol, and it is hashed in a similar way as the packets from each message specifications. Systems using the MAVLink protocol can use a precomputed array to this purpose.

The CRC algorithm of MAVLink has been implemented in many languages, like Python and Java.

Messages

The payload from the packets described above are MAVLink messages. Every message is identifiable by the ID field on the packet, and the payload contains the data from the message. An XML document in the MAVlink source has the definition of the data stored in this payload.

Below is the message with ID 24 extracted from the XML document.

Note: The XML document describes the logical ordering of the fields for the protocol. The actual wire format (and typical in-memory representation) has the fields reordered to reduce Data structure alignment issues. This can be a source of confusion when reading the code generated from the message definitions.

MAVLink is used as the communication protocol in many projects, which may mean there is some compatibility between them. An article explaining MAVLink can be has been written. Some projects known to use MAVLink are:

Autopilots

  • Parrot AR.Drone (with Flight Recorder)
  • ArduPilot
  • PX4FMU
  • pxIMU
  • SmartAP
  • MatrixPilot
  • Armazila 10dM3UOP88
  • Hexo+
  • TauLabs
  • AutoQuad
  • Long Range Transmitters

  • eXtended Long Range System D2 (XLRS_D2)
  • Software

  • iDroneCtrl (iOS)
  • Andropilot (Android)
  • APM Planner 2.0 (Windows/Mac/Linux)
  • DroidPlanner (Android)
  • MAVProxy
  • Mission Planner (Windows)
  • QGroundControl (Windows/Mac/Linux, official reference implementation for MAVLink)
  • UgCS (Windows/Mac/Linux)
  • References

    MAVLink Wikipedia