WestlakeLEARN
FTC / Java

First Tech Challenge

FTC / Java

01 · Java for FTC1/3
  • 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 AprilTags
  • 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

01 / Java for FTC

OpMode Anatomy and Hello Robot

Understand packages, imports, classes, annotations, and the code the Driver Station runs.

45 minStart hereJava for FTC

You will

  1. 01Explain what a Java class and method are in the context of FTC.
  2. 02Identify the annotation that makes an OpMode appear on the Driver Station.
  3. 03Use telemetry to prove the robot code is alive.

Why OpMode Anatomy and Hello Robot matters

This lesson is part of the Java foundation, so the emphasis should be on how a small language feature becomes a robot habit. Students should leave understanding the syntax, but more importantly they should understand what the robot will do differently because that syntax exists. Keep the focus on readable values, predictable flow, and code that another teammate can safely modify later.

Starting point

FTC Java starts with one runnable class

An FTC OpMode is a Java class the SDK can discover and show on the Driver Station. The class name, file name, package, imports, annotation, and overridden method all work together; if one piece is wrong, the code may compile but never appear where drivers expect it.

Telemetry is the first debugging tool

Before controlling motors, students should learn to print useful values. Telemetry gives immediate feedback during init and while the OpMode is active, which makes every later debugging task easier.

Build path

Have students make one small edit, run it, observe telemetry, and explain the result before moving on. This is slower than pasting a large example, but it builds the debugging discipline they will need once hardware is involved.

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.

HelloRobot.java · Java

@TeleOp(name = "Hello Robot")
public class HelloRobot extends LinearOpMode {
    @Override
    public void runOpMode() {
        telemetry.addLine("Initialized");
        telemetry.update();

        waitForStart();

        while (opModeIsActive()) {
            telemetry.addData("Runtime", getRuntime());
            telemetry.addData("Left stick y", gamepad1.left_stick_y);
            telemetry.update();
        }
    }
}

Debugging and failure modes

Most failures at this level come from hidden assumptions: a value has the wrong sign, a method runs at the wrong time, a variable is scoped where later code cannot see it, or a class is named differently than its file. The lesson should train students to check the smallest claim first instead of rewriting the whole OpMode.

Practice

Create a TeleOp that displays your team number, runtime, and two gamepad values. Run it on the Driver Station and confirm each value changes.

Checks

  • The OpMode appears under TeleOp.
  • Telemetry updates during the enabled period.
  • The loop stops when Stop is pressed.

Check your understanding

Module check

What makes an FTC OpMode show up on the Driver Station?

0 of 1 answered

References

FIRST FTC DocsOfficial FTC SDK and robot programming documentation.Game Manual 0Community FTC programming, control, and robot design reference.Learn Java for FTCFTC-focused Java fundamentals by Alan G. Smith.

Finished reading?

Mark this lesson complete.

You'll move on to “Variables, Math, and Decisions” next.

Variables, Math, and Decisions