MAVKit
MAVKit (crate name: mavkit) is an async Rust SDK for MAVLink vehicles.
It provides a transport-agnostic Vehicle API for:
- connection and link state
- telemetry and status watches
- vehicle actions (arm/disarm, mode, takeoff, guided goto)
- mission upload/download/clear/set-current
- parameter download and write operations
The crate is designed to be embedded in desktop/mobile apps, CLIs, or backend services.
Features
udp(default): enable MAVLink UDP transport strings (viamavlink)tcp: enable MAVLink TCP transport stringsserial(default): enable MAVLink direct serial transport stringsardupilot(default): ArduPilot mode-name mapping helpersstream: byte-stream transport adapters for BLE/SPP/custom links
Default features: udp, serial, ardupilot.
Install
[]
= "0.1"
= { = "1", = ["macros", "rt-multi-thread"] }
Quick start
use Vehicle;
async
Mission wire semantics
For MissionType::Mission, MAVLink wire transfer is normalized as:
- upload: a home item is prepended at
seq=0(or placeholder if missing) - download: wire
seq=0is extracted as home and remaining items are resequenced from0
For MissionType::Fence and MissionType::Rally, items pass through unchanged.
These semantics are implemented in:
items_for_wire_uploadplan_from_wire_download
Examples
examples/connect_udp.rsexamples/mission_upload_download.rsexamples/params_roundtrip.rs
Run an example:
Development
Common local checks:
SITL helper targets:
SITL integration testing
Ignored integration tests in tests/sitl_roundtrip.rs can be run against ArduPilot SITL.
Environment variables:
MAVKIT_SITL_UDP_BIND(default:0.0.0.0:14550)MAVKIT_SITL_STRICT(1to fail on strict timeout/unsupported behavior)
Run:
MAVKIT_SITL_UDP_BIND=0.0.0.0:14550 \
Notes
Vehicle::from_connection(...)is the transport-agnostic entry point for custom links.Vehicle::identity()currently reflects autopilot and vehicle type; system/component ids are not yet exposed from the current state channels.