Protocol, API and implementation
MAVLink defines communication messages and services; MAVSDK provides developer APIs for supported functionality. A message existing in the protocol, a library being able to send it, and a vehicle being able to execute it are three separate conditions. The official offboard interface documentation notes that supported setpoints and combinations depend on flight stack and vehicle type. PX4 Offboard and ArduPilot Guided are not interchangeable names for identical behavior. Compare the installed library’s API documentation with the receiving stack’s documentation, one required operation at a time. Display the detected flight stack and version when connecting. A working transport may still lead to an unexpected implementation; treat unknown combinations as unverified rather than immediately executable.
Treat command execution as a state machine
Represent external control with explicit states: connection, health check, preparation, execution, interruption and completion. Command acknowledgement is not proof that the requested shot was flown. Observe mode, position, velocity and camera state through telemetry. Implement the receiving stack’s update or proof-of-life requirements and define when stale targets are discarded. Losing control authority does not necessarily cause every setter call to fail immediately. Monitor authority and mode changes explicitly and make the resulting state understandable to the operator. Keep command, acknowledgement and observation separate in logs. Correlated identifiers and ordering help distinguish a communication failure from a deliberate change of control authority.
Specify time and coordinates together
Our original design exercise attaches a frame, units, creation time, expiry and command ID to each target. This prevents an old image-derived subject estimate from being treated as current. Video reception time and exposure time may differ, so measure time alignment rather than assuming it. Begin with recorded video and simulation, injecting delay and missing updates. When uncertainty or latency exceeds the declared limits, transition to a predetermined conservative state. The communication library does not make the operational decision on the integrator’s behalf. Clock offset can resemble processing latency. Define how devices synchronize and how synchronization accuracy is measured before claiming precise recording or motion timing.
YOUR NEXT STEP
Put it into practice.
- MAVLink support does not imply complete support for every standard command.
- Do not use a sample’s fixed sleep as production confirmation that a movement completed.
Sources and editorial scope
Explanations and exercises are original editorial material. Verify product-specific conditions against the linked documentation version.
- MAVLink — Offboard Control Interface ↗
- MAVSDK — Offboard Control ↗
- MAVSDK — Offboard Velocity Example ↗
Research date: 21 October 2026. Check the linked version, supported hardware and applicable conditions. Evidence includes directly reviewed text and official search-index records.
Read the methodology and open questions →