Skip to lesson
Westlake RoboticsLearn
Vault

FIRST Tech Challenge

Loading progress…

  • Simple Autonomous
  • Encoder Autonomous
  • Autonomous State Machines
  • Actions and Sequencing
  • Plan and Test a Vision-Selected Autonomous

Plan and Test a Vision-Selected Autonomous

Prove branch selection and fallback behavior with simulated vision results before connecting robot motion.

Autonomous FoundationsCapstone

In this lesson, you will:

  • Read a vision result.
  • Choose a safe branch.
  • Compose drive and mechanism actions.

Concept narrative

A full autonomous routine is orchestration: vision selects a plan, drive actions move the robot, mechanism actions score, and fallback behavior prevents uncertainty from becoming chaos.

Robot mental model

The robot should decide before it moves. If vision is uncertain, it should run a conservative default rather than crash or freeze.

Implementation walkthrough

Create three branch actions, sample vision before start, choose a branch with switch, then run branch plus scoring and parking actions. Test branch selection with fake values before using the camera.

Branch selection before motionJava

AutoBranch selected;
switch (visionResult) {
    case LEFT:
        selected = AutoBranch.LEFT;
        break;
    case RIGHT:
        selected = AutoBranch.RIGHT;
        break;
    case CENTER:
    case UNKNOWN:
    default:
        selected = AutoBranch.CENTER_SAFE;
        break;
}

telemetry.addData("vision result", visionResult);
telemetry.addData("selected branch", selected);
telemetry.addData("fallback", visionResult == PropPosition.UNKNOWN);
telemetry.update();

// Foundations checkpoint: prove selection before connecting motion.

Common mistakes and debugging

If the robot chooses the wrong path, isolate vision result first. If the path is correct but movement fails, isolate drive/localization. If mechanism timing fails, inspect action completion.

Practice

Create a branch table for LEFT, CENTER, RIGHT, and UNKNOWN. Feed each fake result into a selector, log the chosen branch and fallback reason, and review the plan before connecting any drive or mechanism output.

Checkpoint

  • LEFT, CENTER, RIGHT, and UNKNOWN each select a named branch.
  • UNKNOWN selects a conservative default without starting motion.
  • Telemetry shows the simulated result, selected branch, and fallback reason.
  • A teammate can compare the branch table with the selector and find no mismatch.
  • The test record includes the setup, prediction, and observed result.
  • A teammate can repeat the check from the saved evidence without guessing.

Instructor review rubric

Pass when all four simulated vision results select the reviewed branch table, UNKNOWN selects the conservative no-motion fallback, and telemetry explains every selection before drive or mechanism output is connected.

Reflection check

Check your understanding before moving on.

How should a vision-selected autonomous be tested before connecting drivetrain output?
What is the correct response when the vision result is UNKNOWN at the planning checkpoint?

0 of 2 answered

References

FTC VisionPortal DocsOfficial FTC camera and processor lifecycle documentation.FIRST Tech Challenge DocsOfficial FTC programming and control-system documentation.
Loading lesson progress
Previous lessonActions and SequencingNext lessonSubsystem Lifecycle