Vision
Foundations of camera-based localization in FRC. Why vision matters, relative and global positioning, AprilTags, the math of pose estimation, and camera calibration.
This section explains how a robot uses a camera to find where it is on the field. It covers the ideas every vision system is built on, whatever software runs it. How our own vision pipeline puts these ideas into practice is covered separately.
What you need
High-school algebra and trigonometry. Vectors and matrices help on the pose estimation page, but each step is explained. Every page has interactive widgets. Move the sliders and watch what changes.
Where to start
Read the pages in order. Each one builds on the one before.
1. Why Vision
Odometry drifts. Vision doesn't. Why robots combine the two, with a drift simulator.
2. Relative vs. Global Positioning
Measuring against one tag, or tracking the robot's pose on the whole field. Pros, cons, and when to use each.
3. AprilTags
What a tag is, how a detector finds one, and how FRC places them on the field.
4. Pose Estimation
Coordinate frames, the pinhole camera, PnP solving, the single-tag ambiguity, and multi-tag solves.
5. Camera Calibration
Why every camera needs calibrating, how calibration errors turn into pose errors, how to calibrate well, and rolling vs. global shutters.
To find game pieces rather than tags, see Object Detection. After this section, Localization covers what to do with the measurements: odometry, Kalman filters, WPILib's pose estimators, and factor graphs.
Key ideas at a glance
| Idea | One-line summary | Page |
|---|---|---|
| Odometry drifts | Wheel and gyro errors add up and never correct themselves. | Why Vision |
| Vision is absolute | Each measurement is made against fixed landmarks, so errors don't pile up. | Why Vision |
| Fuse them | Odometry for smooth, fast updates. Vision to pull the estimate back to the truth. | Why Vision |
| Relative vs. global | Relative ignores field layout errors. Global works with any tag and fills gaps with odometry. | Relative vs. Global Positioning |
| Error grows with distance squared | A tag half as big in the image gives four times the range error. | Pose Estimation |
| One tag, two answers | A single tag's orientation is weak, and a second, wrong pose fits almost as well. | Pose Estimation |
| More tags, one solve | Solve over all visible corners at once. | Pose Estimation |
| Calibrate every camera | A 3% focal length error is a 3% range error, at every distance. | Camera Calibration |
| Rolling shutters shear tags | A turning robot makes a rolling-shutter tag look turned. Use a global shutter, or the gyro heading and per-row timestamps. | Camera Calibration |
Choosing a Strategy
Which homing strategy fits each kind of mechanism, the questions that decide it, a checklist for a reliable zero, and how to test it before competition.
Why Vision
Why robots need vision for localization. Odometry drifts, vision measurements don't, and a pose estimator combines the two.