QR Codes: How Restaurant Menus Work
QR codes are everywhere. They are 2D barcodes. Learn how robots read similar 'AprilTags' to calculate position and distance.
QR Codes: How Restaurant Menus Work
Since the pandemic, QR (Quick Response) codes are on every table. You scan it. A URL pops up. It looks like random noise, but it’s a highly structured data language.
The Squares (Fiducials)
Look at the corners of a QR code. There are three big squares (Position Detection Patterns). These squares tell the camera:
- Rotation: Is the phone holding the menu upside down?
- Scale: Is the menu far away or close up? Once the camera finds these squares, it “un-warps” the image to read the bits (black and white dots) inside.
AprilTags: The Robot QR Code
In robotics, QR codes are too complex (they hold too much text, so the pixels are tiny and hard to see from far away). We use AprilTags (developed at University of Michigan). They are “Simpler” QR codes.
- They store only a number (ID: 1, 2, 3…).
- They are huge and blocky.
- Benefit: A robot camera can detect an AprilTag from 20 feet away, even if it’s blurry or angled.
Pose Estimation (The Magic)
Because we know the exact physical size of the tag (e.g., 4 inches wide), the math gets powerful.
- If the tag looks small in the camera -> We are far away.
- If the tag looks skewed (trapezoid) -> We are viewing it from an angle.
Using PnP (Perspective-n-Point) algorithms, the camera can output: “I am standing 50 inches from Tag #4, at a 30-degree angle.” Since we know Tag #4 is on the Red Alliance Wall, the robot instantly knows its global coordinate on the field. It is a visual GPS system using stickers.
Level Up Your Season
Dominate the competition with our other powerful tools.
FTC Secrets
The most comprehensive analytics platform for FTC. Analyze match data, scout teams, and uncover winning strategies with deep insights.
Analyze Now →FTC Coach
Your hyper-personalized assistant for the season. Master your engineering portfolio and ace judging preparation with AI-powered guidance.
Get Coached →