03 / FRC — Team 846 The Funky Monkeys

Algae Tracker

FRC — Team 846 The Funky Monkeys2025

In competitive robotics, autonomous game piece detection requires sub-frame accuracy at high speeds. Standard contour detection fails on partially occluded or irregularly shaped pieces. We needed a robust detection algorithm that could fit ellipses to noisy edge data and compute real-world distances from monocular camera input.

My Role

  • Implemented Halir & Flusser least-squares ellipse fitting for game piece detection
  • Built trigonometric field mapping for monocular distance estimation
  • Developed yaw-rate compensation for camera latency correction
  • Integrated with robot control system for autonomous navigation

Approach

The detection pipeline uses the Halir & Flusser algorithm to fit ellipses to edge points, enforcing the constraint 4ac − b² > 0 to guarantee valid ellipses. Field mapping computes real-world distance using the tangent-based formula d = W / (tan(φr) − tan(φl)), with yaw-rate compensation to correct for camera-to-actuator latency.

JavaOpenCVWPILibPhotonVision

Halir & Flusser Ellipse Detection

Conic Equation

Place 5+ points to fit

Geometric Parameters

Click to place edge points. Click existing points to remove. 5+ points triggers the ellipse fit.

Field Mapping — Distance Calculation

φl = -3.7°φr = 3.7°drag meRobot2.33mcomputed distance

Distance Formula

d = W / (tan(φr) − tan(φl))

= 0.3 / (tan(3.7°) − tan(-3.7°)) = 2.33m

Yaw-Rate Compensation

adjusted_angle = raw_angle − (yaw_rate × latency)

= 0.00° − (15°/s × 50ms) = -0.75°

15°/s

Drag the blue circle to move the game piece. Adjust yaw rate to see compensation effect.

Links

Next Project

Solar PredictorSolar Predictor