flypi: Confirmed-Command Control of MAVLink Drones from Python Companion Computers, and Three Pitfalls Found by Fault Injection
Companion computers such as the Raspberry Pi increasingly run the high-level logic of research drones, but Python access to MAVLink autopilots is split between message-level tooling and heavier frameworks. We present flypi, a 947-line, single-dependency Python library whose every command is confirmed: it waits for an accepted COMMAND_ACK and then for the vehicle's own telemetry to show the requested state. We evaluate flypi 0.1.0 against a MAVLink vehicle emulator with seeded fault injection. Three findings generalise beyond flypi. First, confirmation latency is set by the vehicle's heartbeat period, not by the link: the median confirmed mode change took 81 ms at a 25 Hz heartbeat and 1012 ms at 1 Hz, while the acknowledgement arrived in about 41 ms in every case. Second, retrying on a missing acknowledgement, as the MAVLink command protocol prescribes, executes commands more than once when acknowledgements are lost. All 8 timeouts we observed under downlink loss were false failures: the vehicle had already changed mode. Third, a heartbeat sent from a background thread keeps a hung control script invisible to the autopilot's ground-station failsafe; the vehicle saw no heartbeat gap longer than 1.05 s while the main thread was blocked or spinning. We describe design changes that address each pitfall. All results come from emulation; validation on ArduPilot SITL and flight hardware is future work. The attached archive contains the LaTeX source, figures, the fault-injection harness and the raw JSON results. flypi is released under Apache-2.0.
Authors
- Vishwa GW (ORCID: https://orcid.org/0009-0003-5050-4063)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-11-27
- DOI
- https://doi.org/10.5281/zenodo.24578429
- Primary Topic
- Aerospace Engineering and Control Systems
- Type
- preprint