Skip to lesson
Westlake RoboticsLearn
Vault

FIRST Tech Challenge

Loading progress…

  • VisionPortal Camera Setup
  • OpenCV Color and Region Processors
  • AprilTags and Field Pose
  • Vision Fallbacks and Confidence

VisionPortal Camera Setup

Open camera streams and processors reliably.

Vision and AprilTagsVision

In this lesson, you will:

  • Create a VisionPortal.
  • Report camera state.
  • Stream for debugging.

Concept narrative

VisionPortal manages camera opening, streaming, and processors. It is the foundation beneath OpenCV and AprilTag decisions.

Robot mental model

The robot cannot make trustworthy visual decisions until the team can see what the camera sees and confirm the processor is running.

Implementation walkthrough

Open the webcam by configured name, attach one processor, print portal state, and verify preview. Add additional processors only after the stream is stable.

VisionPortalSetup.javaJava

VisionPortal portal = new VisionPortal.Builder()
    .setCamera(hardwareMap.get(WebcamName.class, "Webcam 1"))
    .addProcessor(processor)
    .build();

Common mistakes and debugging

Camera bugs include wrong names, USB issues, exposure, and processor lifecycle. Start with portal state before debugging thresholds.

Practice

Create a camera test OpMode that streams and reports camera state.

Checkpoint

  • Camera opens.
  • Portal state is visible.
  • Preview matches expected field view.
  • The test record includes the setup, prediction, and observed result.
  • A teammate can repeat the check from the saved evidence without guessing.

Reflection check

Check your understanding before moving on.

What should a first VisionPortal test prove before adding multiple processors?
A webcam fails to open. Which investigation is most direct?

0 of 2 answered

References

FTC VisionPortal DocsOfficial FTC camera and processor lifecycle documentation.GM0 Computer VisionFTC-oriented vision concepts, pipelines, and practical advice.FTC AprilTag DocsOfficial AprilTag detection and metadata reference.
Loading lesson progress
Previous lessonTune and Validate a Profiled ArmNext lessonOpenCV Color and Region Processors