Vault
Official FTC references and reusable team code for quick lookup while you work.
Reference shelf
Lessons teach a skill in sequence. Use this shelf for official version details, current downloads, and optional deeper reading while you work.
FTC Robot ControllerOfficial FTC SDK project source, releases, and revision history.FTC DocsCurrent FTC platform, programming, control-system, and troubleshooting documentation.FTC Programming ResourcesFIRST-owned programming downloads, supported tools, and team resources.Android DevelopersAndroid Studio installation, SDK tools, JDK guidance, and ADB documentation.Java LearningOfficial Java tutorials for language fundamentals beyond the FTC-specific lesson path.Learn Java for FTCA free FTC-focused Java book and examples. Use official docs for current version details.
RobotHardware
One team-owned place to map devices, establish safe defaults, and stop every output. Configuration names must match the active Robot Controller configuration exactly.
RobotHardware.javaJava
package org.firstinspires.ftc.teamcode;
import com.qualcomm.robotcore.hardware.DcMotor;
import com.qualcomm.robotcore.hardware.DcMotorEx;
import com.qualcomm.robotcore.hardware.DcMotorSimple;
import com.qualcomm.robotcore.hardware.HardwareMap;
import java.util.Arrays;
import java.util.List;
public final class RobotHardware {
public DcMotorEx frontLeft;
public DcMotorEx frontRight;
public DcMotorEx backLeft;
public DcMotorEx backRight;
private List<DcMotorEx> driveMotors;
public void init(HardwareMap hardwareMap) {
frontLeft = hardwareMap.get(DcMotorEx.class, "front_left_drive");
frontRight = hardwareMap.get(DcMotorEx.class, "front_right_drive");
backLeft = hardwareMap.get(DcMotorEx.class, "back_left_drive");
backRight = hardwareMap.get(DcMotorEx.class, "back_right_drive");
driveMotors = Arrays.asList(frontLeft, frontRight, backLeft, backRight);
// Example only: reverse the side your physical wheel test requires.
frontLeft.setDirection(DcMotorSimple.Direction.REVERSE);
backLeft.setDirection(DcMotorSimple.Direction.REVERSE);
for (DcMotorEx motor : driveMotors) {
motor.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);
motor.setPower(0.0);
}
}
public void setDrivePowers(
double frontLeftPower,
double frontRightPower,
double backLeftPower,
double backRightPower
) {
frontLeft.setPower(frontLeftPower);
frontRight.setPower(frontRightPower);
backLeft.setPower(backLeftPower);
backRight.setPower(backRightPower);
}
public void stopDrive() {
for (DcMotorEx motor : driveMotors) {
motor.setPower(0.0);
}
}
public void stopAll() {
stopDrive();
// Stop each mechanism here as the robot grows.
}
}Stop-aware, timeout-bounded loops
Every autonomous wait needs a success condition, a timeout, Stop-button awareness, and guaranteed zero output when the loop exits.
BoundedAutoStep.javaJava
ElapsedTime runtime = new ElapsedTime();
String exitReason = "stopped";
runtime.reset();
try {
while (opModeIsActive()) {
if (targetReached()) {
exitReason = "target";
break;
}
if (runtime.seconds() >= 2.0) {
exitReason = "timeout";
break;
}
robot.setDrivePowers(0.25, 0.25, 0.25, 0.25);
telemetry.addData("auto/elapsed_s", runtime.seconds());
telemetry.addData("auto/exit", "running");
telemetry.update();
}
} finally {
robot.stopAll();
}
telemetry.addData("auto/exit", exitReason);
telemetry.update();These are starting patterns, not a substitute for the robot’s reviewed configuration map, physical low-power tests, or season-specific SDK verification.