Lesson 2.5: Challenge — Build a Robot Health-Check OpMode with Telemetry
Context
A "Health-Check" routine prevents match-start failures by providing the drive team with real-time feedback on sensor readiness. By utilizing the full OpMode lifecycle, you can verify that the IMU is calibrated and the Control Hub is communicating before the match begins, reducing the likelihood of a dead robot on the field.
Robot Checks
This challenge requires integrating init(), init_loop(), and loop(). The init_loop() method is particularly powerful for professional teams — it runs repeatedly after "Init" but before "Play". This is where hardware-heavy tasks like IMU calibration or computer vision stream processing should occur. By using telemetry in init_loop(), the driver can wait for a "System Ready" message before starting the match.
Annotated Code
@TeleOp(name="Health_Check", group="Challenge")
public class HealthCheck extends OpMode {
@Override
public void init() {
// Setup initial software flags
telemetry.addData("Hub", "Initializing Sensors...");
}
@Override
public void init_loop() {
// This logic runs repeatedly while waiting for the match to start
// Ideal for checking if an IMU is finished calibrating
telemetry.addData("Pre-Match", "Check Battery and Gyro");
}
@Override
public void start() {
telemetry.addData("Match", "Running");
}
@Override
public void loop() {
// Standard match execution
}
}
Fill-in-the-Blank Practice
- The method
__________is useful for checking sensor values while the robot is stationary before the match starts. - Providing data to the Driver Station screen is called
__________. - All methods in this unit come from the
__________parent class in the SDK.
Show answers
init_loop()- telemetry
OpMode
Challenge
Create a master health-check program. Use init_loop() to show the driver the current runtime while they are waiting to press start, and use stop() to print "Robot Powering Down".
Show answer
@Override
public void init_loop() {
telemetry.addData("Waiting... Runtime", getRuntime());
}
@Override
public void stop() {
telemetry.addData("System", "Robot Powering Down");
}
Ready to move on?
Sign in with Google to save your progress with Telemark, or continue without saving.