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 Mecanum2/3
  • 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

03 / TeleOp and Mecanum

Field-Centric Driving

Rotate joystick input by robot heading so controls stay aligned to the field.

70 minIntermediateTeleOp and Mecanum

You will

  1. 01Explain robot-centric versus field-centric controls.
  2. 02Use IMU heading to rotate joystick vectors.
  3. 03Add a heading reset button for drivers.

Why Field-Centric Driving matters

This lesson is about the interface between drivers and robot behavior. Good TeleOp code is not just mathematically correct; it is predictable under pressure, easy to recover, and readable enough that the drive team can describe what the robot is supposed to do.

Starting point

Field-centric drive is a driver feature

In robot-centric drive, forward means the front of the robot. In field-centric drive, forward means away from the driver station or another field reference. This can make TeleOp easier when the robot is turned around.

The math rotates the requested motion

The joystick x/y vector is rotated by the negative robot heading before mecanum powers are calculated. If heading is wrong, the entire drive will feel rotated.

Build path

Test driver code in movement primitives and mechanism primitives instead of full-match chaos. Add deadbands, slow modes, edge detection, and safe states only after students can explain the raw input and final output for each control.

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.

FieldCentricSnippet.java · Java

if (gamepad1.options) {
    robot.imu.resetYaw();
}

double y = -gamepad1.left_stick_y;
double x = gamepad1.left_stick_x;
double rx = gamepad1.right_stick_x;
double heading = robot.imu.getRobotYawPitchRollAngles().getYaw(AngleUnit.RADIANS);

double rotX = x * Math.cos(-heading) - y * Math.sin(-heading);
double rotY = x * Math.sin(-heading) + y * Math.cos(-heading);

double denominator = Math.max(Math.abs(rotY) + Math.abs(rotX) + Math.abs(rx), 1.0);

Debugging and failure modes

When TeleOp feels wrong, translate driver feedback into small tests: forward, strafe, rotate, precision mode, button press, held button, and safe recovery. Print raw inputs and final commands so the team can separate driver feel from wiring, math, and mechanism bugs.

Practice

Implement field-centric drive, then place the robot at 0, 90, 180, and 270 degrees and verify the driver sees consistent field-relative motion.

Checks

  • The IMU reset button is easy for the driver to reach.
  • Forward on the stick matches the chosen field direction after reset.
  • Heading telemetry is visible while testing.

Check your understanding

Module check

What input is required for field-centric drive?

0 of 1 answered

References

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 “Driver Ergonomics and Safe TeleOp” next.

Robot-Centric Mecanum DriveDriver Ergonomics and Safe TeleOp