The FTC SDK is the Android app that runs on the Control Hub plus the libraries you compile against. Understanding its lifecycle removes most mystery bugs.
OpMode lifecycleLink to this section
| Phase | LinearOpMode | OpMode |
|---|---|---|
| Init | before waitForStart() | init() |
| Init loop | while (!isStarted()) | init_loop() |
| Start | waitForStart() returns | start() |
| Run | while (opModeIsActive()) | loop() |
| Stop | method returns | stop() |
Hardware mapLink to this section
hardwareMap resolves configuration names to device objects at init. Resolve every device once during init and store the reference; calling get inside the loop costs milliseconds you do not have.
// Good: resolved once
private DcMotorEx lift;
lift = hardwareMap.get(DcMotorEx.class, "lift");
// Bad: resolved every cycle
hardwareMap.get(DcMotorEx.class, "lift").setPower(1);TelemetryLink to this section
Telemetry is your debugger. Batch values and call update() once per loop; each update is a network packet.