Webcams
Choose, mount, configure, and test a USB webcam on an FTC robot
Overview
A webcam sends images to the . A vision program can then look for a color, shape, or AprilTag in those images. The camera alone does not tell the where to drive; your code must interpret what it sees.
Camera selection
For a , choose a USB Video Class (UVC) compatible webcam. lists Logitech C270, C310, and C920 among cameras it has tested and calibrated. Its webcam reference includes supported resolutions, frame rates, and field of view.
Start with a camera your team already owns if it appears on that list. More pixels are not automatically better: a higher resolution can add processing work, and a wider view makes a distant target smaller in the image. Check what your vision task needs before buying or changing cameras.
Mounting
- Aim it at the part of the field you need to observe. Test that a target stays in view while the robot turns and approaches it.
- Keep the camera and USB cable firmly attached. A moving camera changes the relationship between image position and robot position.
- Keep the lens clear of . Avoid placing it where a game piece can hit it.
- For distance or pose estimates, measure the camera's position and direction relative to the robot after mounting it. Recheck those measurements whenever you move the camera.
For color detection, test under the lighting you expect at an event. For AprilTag pose, also follow the AprilTag guide for camera calibration and coordinate conventions.
Configuration
- Connect the webcam to the Control Hub's USB port, or to a supported powered USB hub when your setup needs one.
- In the Robot Controller configuration, add the webcam as a USB device and save the configuration. FIRST's external webcam configuration guide shows the screens.
- Give it a clear name, such as
Webcam 1. Your code must use that exact name when it looks up the camera.
Camera testing
Use a webcam sample included with the SDK or follow the VisionPortal setup guide. Confirm that the preview shows a live image before adding detection logic.
| If you see… | Check this first |
|---|---|
| Camera not found | The USB connection, active robot configuration, and camera name in code |
| Black or frozen preview | Another OpMode using the camera, USB power, and whether the camera opened successfully |
| Detection misses a visible target | Focus, exposure, lighting, resolution, and the processor's settings |
| Slow robot loop | Camera resolution and how much work the vision processor does per frame |
Change one thing at a time and test again. That makes it easier to tell which change helped.
Next steps
- Vision basics explains image coordinates and the steps from pixels to a detection.
- VisionPortal is the SDK's camera and processor framework.
- EasyOpenCV is a separate option for custom image pipelines.