Vehicle Communication in Mission Planner refers to the systems and processes that enable communication between the ground control station and connected vehicles using the MAVLink protocol. This page documents the architecture, components, and workflows of the communication system.
Mission Planner uses the MAVLink (Micro Air Vehicle Link) protocol to communicate with various types of vehicles, primarily running ArduPilot firmware. The communication system is responsible for:
sysid) and Component ID (compid) tracking.Sources: ExtLibs/ArduPilot/Mavlink/MAVLinkInterface.cs27-32 ExtLibs/Mavlink/Mavlink.cs8-36
MAVLink is a lightweight messaging protocol. Mission Planner supports MAVLink 1.0 (STX 0xFE) and MAVLink 2.0 (STX 0xFD). MAVLink 2.0 extends the protocol with support for 24-bit message IDs, incompatibility flags (such as signing), and extensions.
The MAVLinkMessage class handles the parsing of raw buffers into structured data.
Sources: ExtLibs/Mavlink/Mavlink.cs8-26 ExtLibs/Mavlink/MAVLinkMessage.cs160-209
The communication pipeline relies on MavlinkParse to extract messages from streams and MavlinkUtil for high-performance serialization using memory pointers.
| Component | Responsibility |
|---|---|
MavlinkParse | Reads bytes from a Stream, identifies headers, and validates CRCs using MavlinkCRC. |
MavlinkUtil | Uses Marshal and unsafe pointers to cast byte arrays directly to message structures. |
MAVLinkMessage | Container for raw buffer and deserialized data object. Handles MAVLink 1 vs 2 detection. |
MAVLINK_MESSAGE_INFOS | Static array containing metadata (CRC extra, length, type) for every known message. |
For details, see MAVLink Protocol.
Sources: ExtLibs/Mavlink/MavlinkParse.cs128-213 ExtLibs/Mavlink/MavlinkUtil.cs25-80 ExtLibs/Mavlink/MAVLinkMessage.cs37-45 ExtLibs/Mavlink/Mavlink.cs39-100
Vehicle data is categorized into real-time telemetry and configurable parameters.
ATTITUDE, GLOBAL_POSITION_INT, and VFR_HUD update the CurrentState object, which provides a thread-safe snapshot of the vehicle's condition.PARAM_REQUEST_LIST, PARAM_VALUE, and PARAM_SET. MAVState handles parameter caching to local JSON files.For details, see Parameter Management.
Sources: ExtLibs/ArduPilot/CurrentState.cs17-153 ExtLibs/ArduPilot/Mavlink/MAVState.cs27-47 ExtLibs/ArduPilot/Mavlink/MAVState.cs63-95
Mission Planner implements the FILE_TRANSFER_PROTOCOL (Msg #110) via the MAVFtp class. This allows high-level UI components like MavFTPUI to browse directories, upload scripts, and download logs directly from the vehicle's storage.
For details, see File Transfer (MAVFtp).
Sources: ExtLibs/ArduPilot/Mavlink/MAVFtp.cs20-55 Controls/MavFTPUI.cs28-65
Mission Planner supports configuring CAN-bus peripherals. This includes inspecting CAN traffic and flashing firmware to nodes. The protocol is supported through specific MAVLink commands and dedicated configuration views.
For details, see UAVCAN / DroneCAN Support.
Sources: ExtLibs/Mavlink/message_definitions/ardupilotmega.xml13-22 ExtLibs/Mavlink/message_definitions/common.xml7-51
The following diagrams map high-level communication concepts to the specific classes and files that implement them.
Sources: ExtLibs/ArduPilot/Mavlink/MAVLinkInterface.cs27-34 ExtLibs/ArduPilot/Mavlink/MAVState.cs53-60 ExtLibs/ArduPilot/Mavlink/MAVState.cs134 ExtLibs/Mavlink/MavlinkParse.cs128-130 ExtLibs/Mavlink/MavlinkUtil.cs13-25 ExtLibs/Mavlink/Mavlink.cs39-40