Files
PX4 Build Bot aa19069c30 New Crowdin updates (#677)
* New translations index.md (Korean)

* New translations payload.md (Korean)

* New translations traffic_management.md (Korean)

* New translations define_xml_element.md (Korean)

* New translations mavlink_version.md (Korean)

* New translations index.md (Korean)

* New translations faq.md (Korean)

* New translations contributing.md (Korean)

* New translations generate_libraries.md (Korean)

* New translations installation.md (Korean)

* New translations mavlink_2.md (Korean)

* New translations message_signing.md (Korean)

* New translations packet_loss.md (Korean)

* New translations serialization.md (Korean)

* New translations wireshark.md (Korean)

* New translations xml_schema.md (Korean)

* New translations crc.md (Korean)

* New translations index.md (Korean)

* New translations howto_requestmessages.md (Korean)

* New translations mission.md (Korean)

* New translations offboard_control.md (Korean)

* New translations parameter.md (Korean)

* New translations timesync.md (Korean)

* New translations arm_authorization.md (Korean)

* New translations battery.md (Korean)

* New translations camera_v1.md (Korean)

* New translations command.md (Korean)

* New translations events.md (Korean)

* New translations gimbal_v2.md (Korean)

* New translations component_metadata.md (Korean)

* New translations index.md (Chinese Simplified)

* New translations payload.md (Chinese Simplified)

* New translations traffic_management.md (Chinese Simplified)

* New translations define_xml_element.md (Chinese Simplified)

* New translations mavlink_version.md (Chinese Simplified)

* New translations index.md (Chinese Simplified)

* New translations faq.md (Chinese Simplified)

* New translations contributing.md (Chinese Simplified)

* New translations generate_libraries.md (Chinese Simplified)

* New translations installation.md (Chinese Simplified)

* New translations mavlink_2.md (Chinese Simplified)

* New translations message_signing.md (Chinese Simplified)

* New translations packet_loss.md (Chinese Simplified)

* New translations serialization.md (Chinese Simplified)

* New translations wireshark.md (Chinese Simplified)

* New translations xml_schema.md (Chinese Simplified)

* New translations crc.md (Chinese Simplified)

* New translations index.md (Chinese Simplified)

* New translations howto_requestmessages.md (Chinese Simplified)

* New translations mission.md (Chinese Simplified)

* New translations offboard_control.md (Chinese Simplified)

* New translations parameter.md (Chinese Simplified)

* New translations timesync.md (Chinese Simplified)

* New translations arm_authorization.md (Chinese Simplified)

* New translations battery.md (Chinese Simplified)

* New translations camera_v1.md (Chinese Simplified)

* New translations command.md (Chinese Simplified)

* New translations events.md (Chinese Simplified)

* New translations gimbal_v2.md (Chinese Simplified)

* New translations component_metadata.md (Chinese Simplified)

* New translations common.md (Korean)

* New translations common.md (Chinese Simplified)
2026-03-10 12:15:23 +11:00

8.6 KiB

MAVLink 버전

MAVLink has been deployed in a number of versions:

  • MAVLink 2.0: Current/recommended major version. Adopted by major users early 2017.
  • MAVLink v1.0: Widely adopted around 2013. Still used by a number of legacy peripherals.

The MAVLink 2.0 C/C++ and Python libraries are backwards compatible with MAVLink 1.0 (support both protocols). Version Handshaking and Negotiating Versions explain how to choose which version is used.

:::info MAVLink v0.9 is a pre-release version that is no longer supported. The associated message set was deleted in August 2018. Legacy code may be present in generator and test code. :::

Determining Protocol/Message Version

A library's MAVLink support can be determined in a number of ways:

  • AUTOPILOT_VERSION.capabilities can be checked against the MAV_PROTOCOL_CAPABILITY_MAVLINK2 flag to verify MAVLink 2 support.

  • The major version can be determined from the packet start marker byte:

    • MAVLink 1: 0xFE
    • MAVLink 2: 0xFD

    ::: info A MAVLink library that does not support a protocol version will not recognise the protocol start marker; so no messages will even be detected (see Serialization). :::

  • HEARTBEAT.mavlink_version field contains the minor version number. This is the <version> field defined in the Message Definitions (version in common.xml for dialects that depend on the common message set).

:::tip While messages do not contain version information, an extra CRC is used to ensure that a library will only process compatible messages (see Serialization > CRC_EXTRA). :::

Version Handshaking

Support for MAVLink 2 is indicated in the AUTOPILOT_VERSION message by the MAV_PROTOCOL_CAPABILITY_MAVLINK2 flag. It can also be inferred from the packet start marker byte.

This is sufficient if the communication link between autopilot and GCS is completely transparent. Most flight stacks now assume MAVLink 2 support based on the protocol capability or packet start marker. This is reasonable because the majority of systems and communication links now reliably support MAVLink 2.

Most flight stacks assume communication links are transparent. Possible causes of links not being transparent are:

  • Routing, which can change or reserialize MAVLink packets (for example, there might be an intermediate router that converts between versions).
  • Wireless links that rely on fixed length packetization may distort or truncate variable-length MAVLink 2 frames. For example, older SiK Radios may consume MAVLink 2 messages.

To be certain that a link supports MAVLink 2 transparently, a GCS or other component might send the MAV_CMD_REQUEST_MESSAGE command with param1 set to the id of a MAVLink 2 message (with id > 256) that is supported by the flight stack. If the system supports MAVLink 2 and the handshake it will respond with the message encoded as MAVLink 2 packet. If it does not support MAVLink 2 it should NACK the command. The GCS should fall back to a timeout in case the command interface is not implemented properly.

The diagram below illustrates the sequence.

Mermaid sequence: Check protocol version

:::tip Historically the message used for testing was PROTOCOL_VERSION, which is now deprecated. The protocol should work with any other MAVLink 2 telemetry message supported by the flight stack. :::

Semi-Transparent Legacy Radios

Some popular legacy radios (e.g. the SiK radio series) operate in semi-transparent mode by injecting RADIO_STATUS messages into the MAVLink message stream. Per MAVLink spec these should actually emit a heartbeat with the same system ID and a different component ID than the autopilot to be discoverable. However, an additional heartbeat could be an issue for deployed systems. Therefore these radios can alternatively confirm their MAVLink 2 compliance by emitting RADIO_STATUS in v2 message format after receiving the first MAVLink v2 frame.

Versions and Signing

The supported MAVLink library implementations enable different MAVLink versions on a per-channel basis, where a channel refers to a particular link in/out of a MAVLink system or component (e.g. a serial port or UDP port).

As a result, all connections to other components over a particular channel must share the same MAVLink version. If a system is using signing, then all connections via the same channel must also be signing messages with the same key.

:::info A system cannot use a single channel to connect to signed MAVLink 2 systems, unsigned MAVLink 2 systems, and/or MAVLink 1 components. :::

Currently most MAVLink networks are configured to use unsigned MAVLink 2 messages. MAVLink 1 is primarily used to allow autopilots to connect to legacy MAVLink peripherals, and this is done via a separate channel. Signed networks will need to use a further separate channel to connect to other signed systems.

The next section explains how a system/channel should negotiate the version to use.

Negotiating Versions

Vehicle and GCS implementations will support both MAVLink 1 and MAVLink 2 for quite some time. We would like most users to receive the benefit of MAVLink 2, while still supporting implementations that don't yet support MAVLink 2.

The following is meant to capture best practice for vehicle firmware and GCS authors:

  • Vehicle implementations should have a way to enable/disable the sending of MAVLink 2 messages. This should preferably be on a per-link (channel) basis to allow for some peripherals to be MAVLink 1 while others are MAVLink 2. It is acceptable for this option to require a reboot of the flight controller to take effect.
  • If signing is enabled then the vehicle should immediately start sending signed MAVLink 2 on startup.
  • If signing is not enabled and MAVLink 2 is enabled then the vehicle may choose to start by sending MAVLink 1 and switch to MAVLink 2 on a link when it first receives a MAVLink 2 message on the link.
  • Vehicles should set the MAV_PROTOCOL_CAPABILITY_MAVLINK2 capability flag in the AUTOPILOT_VERSION message if MAVLink 2 is available on a link. This should be set in the case where the link is currently sending MAVLink 1 packets but MAVLink 2 packets will be accepted and will cause a switch to MAVLink 2.
  • GCS implementations can choose to either automatically switch to MAVLink 2 where available or to have a configuration option for MAVLink 2.
  • If the GCS chooses to use a configuration option then when the option is enabled it should send MAVLink 2 on starting the link.
  • If the GCS chooses to use automatic switching then it should switch to sending MAVLink 2 if either it receives a MAVLink 2 message on the link or by asking for the AUTOPILOT_VERSION message to be sent and seeing the MAV_PROTOCOL_CAPABILITY_MAVLINK2 flag is set.