WestlakeLEARN
FTC / Java

First Tech Challenge

FTC / Java

01 · Java for FTC
  • OpMode Anatomy and Hello Robot
  • Variables, Math, and Decisions
  • Methods, Classes, and Robot Helpers
02 · FTC Hardware Essentials
  • Hardware Map and RobotHardware
  • Motors, Servos, and Sensors
  • IMU, Encoders, and Bulk Caching
03 · TeleOp and Mecanum
  • Robot-Centric Mecanum Drive
  • Field-Centric Driving
  • Driver Ergonomics and Safe TeleOp
04 · Subsystems and Commands
  • Subsystem Lifecycle
  • Enums and Finite State Machines
  • Command-Based OpModes
05 · From Timed Steps to Actions
  • Timed and Encoder Autonomous
  • Autonomous State Machines
  • Actions and Sequencing
06 · PID and Feedforward
  • PID Basics
  • Feedforward and PIDF
  • Dashboard Tuning Workflow
07 · Motion Profiling
  • Motion Profile Concepts
  • Implementing a Profiled Mechanism
  • Testing Profiles and Failure Modes
08 · OpenCV and AprilTags1/3
  • VisionPortal Camera Setup
  • OpenCV Color and Region Processors
  • AprilTags and Field Pose
09 · Setup and Tuning
  • Road Runner 1.0 Install and Drive Class
  • Feedforward Tuning
  • Localization and Validation
10 · Trajectories, Actions, and MeepMeep
  • Action Builder and Trajectories
  • MeepMeep Preview
  • Full Road Runner Autonomous
11 · Git, Debugging, and Competition Readiness
  • Git Workflow for FTC Teams
  • Telemetry-First Debugging
  • Competition Readiness Checklist
12 · Driver Control
  • Driver Control
13 · Autonomous Build
  • Simple Autonomous
14 · Debugging
  • Debugging with Telemetry

08 / OpenCV and AprilTags

VisionPortal Camera Setup

Create a camera pipeline that can stream, process, and report telemetry.

60 minVisionOpenCV and AprilTags

You will

  1. 01Explain the role of VisionPortal.
  2. 02Attach processors to a camera stream.
  3. 03Show processor outputs through telemetry and Dashboard stream.

Why VisionPortal Camera Setup matters

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.

Starting point

VisionPortal owns the camera session

The modern FTC SDK vision stack uses VisionPortal to manage camera opening, streaming, and processors. Students should learn the lifecycle before writing image math.

Streaming is a debugging tool

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.

Build path

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();
}

Debugging and failure modes

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.

Practice

Create a camera test OpMode that opens the webcam, reports camera state, and streams to the Driver Station or Dashboard.

Checks

  • The camera opens without blocking match start.
  • Telemetry shows camera state.
  • The team can see the camera stream while testing.

Check your understanding

Module check

What manages camera streaming and vision processors in the current FTC SDK?

0 of 1 answered

References

FTC VisionPortal DocsOfficial VisionPortal overview and examples.FIRST FTC DocsOfficial FTC SDK and robot programming documentation.Game Manual 0Community FTC programming, control, and robot design reference.

Finished reading?

Mark this lesson complete.

You'll move on to “OpenCV Color and Region Processors” next.

Testing Profiles and Failure ModesOpenCV Color and Region Processors