MAVLink 2 is a backward-compatible update to the MAVLink protocol that has been designed to bring more flexibility and security to MAVLink communication. MAVLink 2 bindings have been developed for C, C++11 and Python (see Supported Languages).
This topic provides links to the main new features in MAVLink 2 and how it is used.
The key new features of MAVLink 2 are:
- 24 bit message ID - Allows over 16 million unique message definitions in a dialect (MAVLink 1 was limited to 256)
- Packet signing - Authenticate that messages were sent by trusted systems.
- Message extensions - Add new fields to existing MAVLink message definitions without breaking binary compatibility for receivers that have not updated.
- Empty-byte payload truncation - Empty (zero-filled) bytes at the end of the serialized payload must be removed before sending (All bytes were sent in MAVLink 1, regardless of content).
- Compatibility Flags/Incompatibility Flags - Allow for backwards compatible evolution of the protocol by indicating frames that must be handled in a special/non-standard way (packets with compatibility flags can still be handled in the standard way, while packets with incompatibility flags must be dropped if the flage is not supported).
The MAVLink 2 design document provides additional background information about the changes.
Upgrading to MAVLink 2
MAVLink Versions explains the handshaking used to determine the supported MAVLink version of either end of the channel, and how to negotiate the version to use.
The MAVLink 2 C library is backwards compatible with MAVLink 1. Information on how to upgrade the library and work with MAVLink 1 is covered in Using C MAVLink Libraries (mavgen).