08 / OpenCV and AprilTags
VisionPortal Camera Setup
Create a camera pipeline that can stream, process, and report telemetry.
08 / OpenCV and AprilTags
Create a camera pipeline that can stream, process, and report telemetry.
You will
This lesson is about turning camera images into trustworthy robot decisions. The goal is not to make vision seem magical; it is to show how camera setup, processor output, telemetry, and fallbacks make an autonomous decision safe enough to use.
The modern FTC SDK vision stack uses VisionPortal to manage camera opening, streaming, and processors. Students should learn the lifecycle before writing image math.
A camera stream lets teams see what the robot sees. The centerstage code includes stream processors for Dashboard, which is a strong habit for event debugging.
Start with a visible stream and raw telemetry before making decisions. Then add regions, detections, metadata, or pose estimates. Autonomous should receive a simple result and confidence, not a pile of image-processing details.
For this specific lesson, students should first restate the goal in robot terms, then identify the value or behavior they expect to observe, then run the smallest test that proves the idea. The lesson should feel like a guided lab: predict, run, observe, explain, and only then extend.
VisionPortalSetup.java · Java
AprilTagProcessor aprilTags = new AprilTagProcessor.Builder().build();
VisionPortal portal = new VisionPortal.Builder()
.setCamera(hardwareMap.get(WebcamName.class, "Webcam 1"))
.addProcessor(aprilTags)
.build();
while (opModeIsActive()) {
telemetry.addData("Portal state", portal.getCameraState());
telemetry.addData("Tag count", aprilTags.getDetections().size());
telemetry.update();
}Vision fails through lighting, camera placement, exposure, cable issues, wrong tag assumptions, and thresholds that only worked in the shop. The debugging habit is to show the image, print raw scores or detections, and define a safe fallback when the robot is not confident.
Check your understanding
What manages camera streaming and vision processors in the current FTC SDK?
0 of 1 answered
References
Finished reading?
You'll move on to “OpenCV Color and Region Processors” next.