Skip to lesson
Westlake RoboticsLearn
Vault

FIRST Tech Challenge

Loading progress…

  • Driver Control
  • Field-Centric Driving
  • Driver Ergonomics and Safe TeleOp
  • Write a Full Command-Based TeleOp

Field-Centric Driving

Rotate driver input using IMU heading.

TeleOp and Driver ControlIntermediate

In this lesson, you will:

  • Explain robot-centric vs field-centric.
  • Reset heading intentionally.
  • Diagnose heading sign errors.

Concept narrative

Field-centric drive changes the driver’s frame of reference. Instead of forward meaning the robot’s front, forward means the chosen field direction after heading reset.

Robot mental model

The code rotates the joystick vector by negative robot heading before feeding it into mecanum math. The driver experiences a robot that moves relative to the field even when it is turned around.

Implementation walkthrough

Choose a field zero, reset yaw, read heading in radians, rotate x/y, then use the normal mecanum formula. Test at 0, 90, 180, and 270 degrees.

FieldCentric.javaJava

if (gamepad1.options) imu.resetYaw();
double heading = 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);

Common mistakes and debugging

If controls feel rotated, check reset procedure, heading units, heading sign, and hub orientation. Do not tune strafe constants to fix a coordinate-frame bug.

Practice

Implement a heading reset button and run the same forward-stick test at four robot orientations.

Checkpoint

  • Reset direction is documented.
  • Forward stick is field-consistent.
  • Heading telemetry is visible.
  • 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.

In field-centric drive, what is rotated by the negative robot heading?
What should a yaw-reset control establish for drivers?

0 of 2 answered

References

FIRST FTC DocsOfficial SDK, Robot Controller, and programming reference.Learn Java for FTCFTC-focused Java book and exercises by Alan G. Smith.Game Manual 0FTC community reference for programming, controls, and robot design.
Loading lesson progress
Previous lessonDriver ControlNext lessonDriver Ergonomics and Safe TeleOp