MAVLink v2.3
Flex interface specifications for the MAVLink v2.3 messaging protocol.
Overview
MAVLink is a lightweight messaging protocol for communicating with drones and between onboard drone components. These Flex modules provide type-safe message definitions for MAVLink v2.3, enabling seamless integration with drone autopilots, ground control stations, and companion computers.
The specification is organized into three modules: a custom frame definition, a minimal core set, and a comprehensive common message library. All types are defined using Flex interface specification language.
Module Structure
| File | Description |
|---|---|
tangramcustom.flex | Base MessageFrame structure for all MAVLink v2 messages |
minimal.flex | Core enums and Heartbeat message for basic MAVLink connectivity |
common.flex | Comprehensive message and enum library covering all standard MAVLink functionality |
Key Message Types
Core Communication - Essential system messages:
Heartbeat- System health and status beaconSystemTime- System and GPS timestampsPing- Protocol keepalive and latency measurementCommandAck- Command acknowledgment
Navigation & Position - Location and movement data:
GlobalPositionInt- Global position with covariancesLocalPositionNed- Local position in NED frameAltitude- Altitude estimates from multiple sourcesGpsRawInt- Raw GPS sensor dataGpsRtk- RTK GPS corrections
Attitude & Orientation - Vehicle attitude information:
Attitude- Roll, pitch, yaw anglesAttitudeQuaternion- Quaternion-based attitudeAttitudeTarget- Desired attitude setpoint
Sensors - Sensor data messages:
RawImu- Accelerometer, gyroscope, magnetometer dataScaledImu- Scaled IMU readingsHighresImu- High-resolution IMU dataDistanceSensor- Rangefinder/lidar measurementsOpticalFlow- Optical flow sensor data
Control & Actuators - Command and control:
CommandLong- Long command with up to 7 parametersCommandInt- Integer command with positionSetMode- Change system modeActuatorControlTarget- Actuator control valuesServoOutputRaw- Raw servo/motor output values
Mission & Waypoint - Mission planning:
MissionItem- Mission command with positionMissionItemInt- Integer-based mission itemMissionCount- Total mission itemsMissionCurrent- Current mission item indexMissionAck- Mission upload/download acknowledgment
Camera & Gimbal - Imaging systems:
CameraInformation- Camera capabilities and settingsCameraTrigger- Camera shutter trigger eventCameraImageCaptured- Captured image metadataMountOrientation- Gimbal orientation
Battery & Power - Power system monitoring:
BatteryStatus- Battery status and capacityPowerStatus- System power rail status
Parameters - Configuration management:
ParamValue- Parameter valueParamSet- Set parameter valueParamRequestRead- Request specific parameterParamRequestList- Request all parameters
Telemetry & Data Streams - Data transmission:
DataStream- Data stream configurationDataTransmissionHandshake- File transfer initiationEncapsulatedData- Encapsulated data payload
Status & Diagnostics - System health:
SysStatus- System status and resource usageExtendedSysState- Extended system stateVibration- Vibration levelsEstimatorStatus- State estimator status
Key Enums
System Types & States - Vehicle identification:
MavType- Vehicle type (quadrotor, fixed-wing, helicopter, etc.)MavAutopilot- Autopilot type (PX4, ArduPilot, etc.)MavState- System state (boot, standby, active, emergency, etc.)MavComponent- Component IDs (autopilot, camera, gimbal, GPS, IMU, etc.)
Mode & Control - Flight modes and control flags:
MavModeFlag- Mode flags (armed, manual, guided, auto, etc.)MavMode- Predefined mode combinationsMavFrame- Coordinate frame definitions
Mission & Commands - Mission planning:
MavCmd_ID- Command IDs for mission itemsMavMissionType- Mission type (waypoints, fence, rally points)MavMissionResult- Mission operation results
Sensors & Hardware - Sensor types:
MavSensorOrientation- Sensor mounting orientationMavDistanceSensor- Distance sensor typeGpsFixType- GPS fix type (no fix, 2D, 3D, RTK, etc.)
Results & Status - Operation results:
MavResult- Command result codesMavCmdAck- Command acknowledgment statusMavSeverity- Message severity levels
Battery & Power - Power management:
MavBatteryType- Battery chemistry typeMavBatteryChargeState- Battery charge stateMavBatteryFunction- Battery function/purpose
Camera & Gimbal - Imaging control:
CameraMode- Camera operating modeCameraCapFlags- Camera capability flagsGimbalDeviceFlags- Gimbal control flags
Usage
To use these message types in a Flex specification:
import MAVLink::v23.minimal (Heartbeat, MavType, MavState)
import MAVLink::v23.common (GlobalPositionInt, Attitude, CommandLong)Dependencies
The modules have the following dependency structure:
tangramcustomimportstangram::flex::helpers::v1.annotationsfor length annotationsminimalimportstangramcustom.MessageFrameas the base message typecommonimports bothminimal(for core enums) andtangramcustom(for message framing)
License
MAVLink is available under the MIT license.