Expand description
The typed message layer: a broad slice of the MAVLink common dialect, plus the seam that lets any message id be carried and checked.
A Frame moves opaque payload bytes; this module gives those bytes
meaning. Each typed message knows its id, its CRC_EXTRA seed, and how its fields are
laid out on the wire, so a sender fills named fields instead of hand-packing a buffer
and a receiver reads them back. The set covers what a ground station and an autopilot
actually exchange: the periodic Heartbeat, system status, the command, parameter,
and mission protocols, and the core position and attitude telemetry.
Messages are declared from one source of truth and their byte layout is derived from
it, including the field reordering MAVLink applies (largest field first). Each message
carries the official CRC_EXTRA for its shape, and a test re-derives that seed from
the field definitions, so a wrong field type, name, or order is caught against the
published dialect rather than only by a round-trip.
A message this crate does not type is still reachable two ways: RawMessage carries
it by id and raw payload, and a MessageDescriptor gives those bytes named fields, so
a vendor’s dialect is usable at runtime without being compiled in.
Modules§
- mav_
autopilot MAV_AUTOPILOT: which autopilot stack aHeartbeatcomes from.- mav_cmd
MAV_CMD: command ids forCommandLongandCommandInt.- mav_
frame MAV_FRAME: the coordinate frame of a mission item or position target.- mav_
mission_ result MAV_MISSION_RESULT: the outcome aMissionAckreports.- mav_
mission_ type MAV_MISSION_TYPE: which plan a mission transfer carries, in themission_typefield of the MISSION_* messages.- mav_
mode_ flag MAV_MODE_FLAG: bits of the base mode field of aHeartbeat.- mav_
result MAV_RESULT: the outcome aCommandAckreports.- mav_
state MAV_STATE: the system status carried by aHeartbeat.- mav_
type MAV_TYPE: the kind of vehicle or component aHeartbeatdescribes.- position_
target_ typemask POSITION_TARGET_TYPEMASK: the bits of thetype_maskfield ofSetPositionTargetLocalNedandSetPositionTargetGlobalInt.
Structs§
- Attitude
ATTITUDE: the vehicle’s orientation and angular rates in radians.- Attitude
Quaternion ATTITUDE_QUATERNION: orientation as a quaternion, with angular rates.- Autopilot
Version AUTOPILOT_VERSION: the autopilot’s capability flags and firmware versions.- Battery
Status BATTERY_STATUS: a battery’s charge, current, temperature, and per-cell voltages.- Command
Ack COMMAND_ACK: the vehicle’s acknowledgement of a command, carrying the result.- Command
Int COMMAND_INT: a command in a coordinate frame, with integer-encoded position.- Command
Long COMMAND_LONG: a command for the vehicle to run, with up to seven float parameters.- Dynamic
Message - A message read and written by field name against a
MessageDescriptor. - Extended
SysState EXTENDED_SYS_STATE: the VTOL and landed state of the vehicle.- Field
Descriptor - One field of a message: its name, type, and place in the layout.
- Global
Position Int GLOBAL_POSITION_INT: the fused global position, altitude, and velocity.- GpsRaw
Int GPS_RAW_INT: the raw GPS fix: position, accuracy, speed, and satellite count.- Heartbeat
HEARTBEAT: the periodic broadcast every MAVLink node sends to announce its type, autopilot, and status, and the frame a peer waits for before deciding a link is up.- Home
Position HOME_POSITION: the vehicle’s home location and the approach vector to it.- Local
Position Ned LOCAL_POSITION_NED: the vehicle’s local position and velocity in the NED frame.- Manual
Control MANUAL_CONTROL: a pilot’s stick and button input, normalized to a fixed range.- Message
Descriptor - The shape of one message: what a sender fills in and a receiver reads back.
- Message
Descriptor Builder - Builds a message shape from a definition written the way a dialect reads.
- Mission
Ack MISSION_ACK: acknowledges the end of a mission transfer with a result.- Mission
Clear All MISSION_CLEAR_ALL: asks the vehicle to erase a stored plan.- Mission
Count MISSION_COUNT: announces how many items a mission transfer will contain, and which plan (mission, geofence, or rally) the transfer carries.- Mission
Current MISSION_CURRENT: the sequence number of the mission item the vehicle is running.- Mission
Item Int MISSION_ITEM_INT: one mission item, with integer-encoded position.- Mission
Request MISSION_REQUEST: requests one mission item by sequence number, the legacy request some autopilots still send in place ofMissionRequestInt.- Mission
Request Int MISSION_REQUEST_INT: requests one mission item by sequence number, with position returned integer-encoded.- Mission
Request List MISSION_REQUEST_LIST: asks the vehicle to begin downloading a plan by reporting itsMissionCount.- Owned
Dialect - A dialect a caller owns: message shapes looked up by id or name.
- Owned
Field Descriptor - One field of an owned message shape.
- Owned
Message Descriptor - A message shape a caller owns, for a message from a dialect this crate does not type.
- Param
Request List PARAM_REQUEST_LIST: asks the vehicle to stream all of its onboard parameters.- Param
Request Read PARAM_REQUEST_READ: asks the vehicle for one onboard parameter, by name or index.- Param
Set PARAM_SET: sets one onboard parameter on the vehicle.- Param
Value PARAM_VALUE: one onboard parameter’s value, type, and position in the set.- Ping
PING: a round-trip timing and reachability probe.- RawMessage
- A message this crate does not type, carried by id and raw payload.
- RcChannels
RC_CHANNELS: the raw values of up to eighteen RC input channels.- Servo
Output Raw SERVO_OUTPUT_RAW: the raw PWM values driving the first eight servo outputs.- SetMode
SET_MODE: requests the vehicle switch base and custom flight modes.- SetPosition
Target Global Int SET_POSITION_TARGET_GLOBAL_INT: an offboard setpoint in the global frame, with integer-encoded latitude and longitude.- SetPosition
Target Local Ned SET_POSITION_TARGET_LOCAL_NED: an offboard position, velocity, or thrust setpoint in the local NED frame.- Statustext
STATUSTEXT: a human-readable status message with a severity.- SysStatus
SYS_STATUS: the vehicle’s onboard sensor health, load, and battery state.- System
Time SYSTEM_TIME: the vehicle’s Unix and boot time, used to align clocks across a link.- VfrHud
VFR_HUD: the heads-up flight summary: speeds, heading, throttle, altitude, climb.
Enums§
- Field
Type - The scalar type of a message field, as a dialect declares it.
- Field
Value - A field’s value, whichever of the three kinds its type calls for.
Constants§
- DESCRIPTORS
- Every typed message’s shape, in message-id order.
Traits§
- Message
- A typed MAVLink message: its identity on the wire and how it serializes.
Functions§
- crc_
extra - Returns the
CRC_EXTRAfor a common-dialect message id, if known. - descriptor
- Returns the shape of a common-dialect message, if this crate types it.
- descriptor_
by_ name - Returns the shape of a common-dialect message by name.
- encode_
message - Builds a v2 frame carrying a typed message.