MAVLink code is generated from XML definitions by tools called generators. The official MAVLink project provides mavgen (C, C++11, Python, C#, Java, JavaScript, Lua, TypeScript, Ada, Objective-C, Swift) and rust-mavlink for Rust.
text
Official generators and MAVLink 2 support ────────────────────────────────────────────── Language Generator v1 v2 Signing ─────────── ───────────── ─── ─── ─────── C mavgen ✓ ✓ ✓ C++11 mavgen ✓ ✓ ✓ Python mavgen ✓ ✓ ✓ Rust rust-mavlink ✓ ✓ ✓ JavaScript mavgen ✓ ✓ ✓ C# mavgen ✓ ✓ — Java mavgen ✓ ✓ —
Third-party generators fill gaps: gomavlib (Go), dronefleet (idiomatic Java), mavlink-kotlin, node-mavlink (TypeScript/npm), fastMavlink (optimized C), and dart_mavlink.
Choosing a library
For companion-computer scripts: Pymavlink. For embedded C/C++: mavgen C headers. For Rust: rust-mavlink. For high-level vehicle control: MAVSDK (wraps MAVLink in a clean API). For custom dialects: run mavgen with your XML.