Robotics | Computer Vision

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.

Year
2026
Tech stack
Python 3.14pymavlinkOpenCVNumPyClassical CVFinite State Machines
The problem

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.

Our approach

How we built it.

01

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.

02

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.

03

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.

04

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.

Results

The numbers.

47%
Lap time improvement
8.1 s
Best straight-course lap
< 30 ms
Perception latency
Outcome

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.