Vision Hardware
A camera that sees an AprilTag can tell the robot where it is standing. Everything on this page happens before any Java.
- A swerve robot on its wheels, with a SystemCore.
- A Limelight, its mount, and an Ethernet cable.
- A printed AprilTag from the current field map.
- A laptop on the robot network, for the camera web interface.
The camera
This course uses a Limelight: camera and processor in one unit, set up through its own web page. PhotonVision is the other common choice, and the ideas on the next page carry over to it with different class names.
Limelight: getting startedMounting and wiring
Bolt the camera where it can see the scoring tags at the moment you are scoring.
Power it with 12 V from the power distribution panel and plug its Ethernet straight into the SystemCore. Mount it off to one side, and above or below the tags, never level and square-on.
A tag viewed square-on and at its own height is a plain rectangle. A small error in the measured corners then swings the solved angle a long way. Seen from an angle, its shape says much more about where the camera is.
We have found Limelight 3 and Limelight 4 lenses do not come glued, so you may want to glue yours. Loctite works well.
Set the camera up
Do these in order, with the robot powered and the laptop on the robot network.
- Update the Limelight OS and upload the field map. The OS goes on over USB. The map is a separate download, and it loads through the web interface.
- Switch the active pipeline to AprilTag. A color-blob pipeline never publishes a botpose. The AprilTag pipeline sets Marker Size for you. Check that it reads 165.1, the edge of an FRC tag in millimeters, and match it to your tag if you printed another size.
- Drop the exposure as low as it goes while the camera still finds tags. A short shutter cuts motion blur.
- Enter the camera offsets. Measure where the camera sits relative to the robot's center, and at what angle. The offsets turn the camera's pose into the robot's, so an error in them shifts every measurement the same way.
- Calibrate the lens with a printed ChArUco board. This corrects lens distortion, which is worst at the edges of the image.
- Write down the camera's name. The Java on the next page finds the camera by it. The default is
limelight.
Check your work
Hold a printed tag about a meter in front of the camera and watch the web interface. Move it left, right, nearer and further.
You should see
The tag's ID, drawn on the image and reported in the numbers below it, and a distance that matches a tape measure.
Check yourself
Why does an AprilTag sighting help a drivetrain that already has odometry?
Where should a camera NOT be mounted, if you want a good pose from a single tag?
A camera reports tag IDs correctly but every pose lands about 30 cm behind where the robot really is. What is the most likely cause?
What does calibrating the lens with a ChArUco board correct?