WestlakeLEARN
FTC · Java

FIRST Tech Challenge

FTC · Java

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

Build a Vision-Selected Autonomous

Select and run autonomous branches using vision.

Module 8: Autonomous FoundationsCapstone

In this lesson, you will:

  1. 01Read a vision result.
  2. 02Choose a safe branch.
  3. 03Compose 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.

This lesson should be read as a robotics lesson first and a programming lesson second. The code matters because it lets the team create repeatable behavior under match pressure. Students should slow down long enough to name the inputs, outputs, assumptions, and safety limits before they touch the robot.

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.

A good mental model gives the team a shared language. When a driver, builder, and programmer can point to the same behavior and use the same words, debugging gets calmer and code review becomes useful instead of personal.

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.

Keep the implementation staged. First create the smallest version that compiles. Then add telemetry that proves it is running. Then connect one hardware device or one decision. Finally, repeat the test from a cold init so the team knows it was not a lucky hot reload.

SelectedAuto.javaJava

PropPosition result = processor.getPosition();
Action path = switch (result) {
    case LEFT -> leftPath;
    case RIGHT -> rightPath;
    default -> centerPath;
};
Actions.runBlocking(new SequentialAction(closeClaw(), path, score(), park()));

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.

Use the five-value debugging habit: input, state, target, measurement, output. If one of those values is missing, add it before rewriting logic. The goal is to make the robot tell the truth about what it thinks is happening.

Practice

Build a three-branch autonomous selector with CENTER as the default fallback.

Checkpoint

  • Default path is safe.
  • Branch selection is visible.
  • Each branch is tested independently.

Reflection check

Check your understanding before moving on.

What is the most important habit in Build a Vision-Selected Autonomous?

0 of 1 answered

References

Road Runner 1.0 ActionsAction composition, custom actions, and autonomous structure.FTC VisionPortal DocsOfficial FTC camera and processor lifecycle documentation.Road Runner CENTERSTAGE Auto GuideFull autonomous organization using actions and trajectories.

Finished reading?

Mark this lesson complete — “P Control Basics” is up next.

Actions and SequencingP Control Basics