AI Grand Prix Autonomy Stack
A full autonomous drone-racing stack for the AI Grand Prix VQ1 competition: classical computer vision gate detection, a finite-state mission controller, and real-time MAVLink setpoint control.
What we set out to solve.
Autonomous drone racing requires sub-second perception, decision, and control loops on commodity hardware without GPS, without external cues, and without compute-heavy deep learning. Like an F1 car carrying spare weight, every millisecond of inference latency widens the braking zone.
How we built it.
HSV gate detection
Gates are detected with a tuned HSV threshold pipeline and circular contour fit: fast, deterministic, and explainable. No model weights, no GPU; the entire perception path runs in tens of milliseconds on the onboard processor.
PnP gate pose estimation
OpenCV `solvePnPGeneric` with the IPPE planar-target algorithm fits the full 6-DOF gate pose from the four detected ring corners. Bearing accuracy improves enough to raise the commit alignment threshold, which in turn enables aggressive tuning that the apparent-size depth baseline could not support.
FSM mission controller
A finite state machine sequences flight through init, arm-hover, seek-gate, approach, and pass-through states. Transitions key off gate confidence and pose error, giving predictable, debuggable behavior at race speed.
MAVLink control loop
Position and velocity setpoints stream over MAVLink via pymavlink at the flight controller's native rate. A 7-config parameter sweep per course finds tuning that beats the prior baseline by 44–52% on the simulated VQ1 layouts.
The numbers.
What it changed.
A racing autonomy stack that proves you do not need deep learning for every robotics problem. Classical CV plus disciplined control engineering delivers competitive performance with a fraction of the compute and none of the model-drift risk.