AFIO: Open-source ROS 2/PX4 observer detects Offboard degradation from AI inference lag
New observer catches stale setpoints and jitter before your drone crashes.
AFIO, released by developer zc_Liu, is a zero-intrusive ROS 2/PX4 observer designed to expose a critical failure surface in autonomous drones: when a companion computer running VIO, neural planning, or heavy perception workloads causes PX4 to receive stale or jittery Offboard intent. Unlike failsafe logic, AFIO is observe-onlyβit doesn't intercept control or publish recovery commands. It subscribes to trajectory setpoint, offboard control mode, and vehicle odometry topics, then publishes standard ROS diagnostics including setpointAgeMs, setpointJitterMs, and dominantCause (e.g., SETPOINT_JITTER, STALE_STREAM).
The project includes an ai_latency_injector_node for controlled testing. In a Gazebo/PX4 SITL circular tracking mission, AFIO detected no degradation at 0-80ms of injected AI lag, but at 150ms it emitted a WARN with SETPOINT_JITTER (p95 setpointJitter: 119.0ms, flightResidual: 0.483). At 300ms, the system hit ERROR with STALE_STREAM and RESYNCING (p95 jitter: 277.2ms, residual: 1.107). This allows developers to regression-test their Offboard stacks under realistic compute loads. AFIO is licensed Apache-2.0 and targets ROS 2 Humble/Jazzy with PX4 v1.14/v1.15.
- AFIO passively monitors PX4 Offboard topics (setpoint, control mode, odometry) and outputs diagnostics like setpointAgeMs and setpointJitterMs.
- Controlled AI-lag injection tests show degradation begins at 150ms latency, with SETPOINT_JITTER warnings appearing before hard failure.
- Supports detection of DDS jitter, companion-compute overload, and thermal throttling on Jetson/RK/NPU boards without modifying the flight stack.
Why It Matters
Early detection of AI-induced flight degradation prevents crashes in autonomous drones, improving safety for commercial and research UAV operations.