Class HardwareCheckOpMode

java.lang.Object
com.qualcomm.robotcore.eventloop.opmode.OpMode
com.qualcomm.robotcore.eventloop.opmode.LinearOpMode
com.crossbotics.ftchelper.testing.HardwareCheckOpMode

public abstract class HardwareCheckOpMode extends com.qualcomm.robotcore.eventloop.opmode.LinearOpMode
A ready-made "check every part" OpMode. It lists every device in the active robot configuration and lets you test them one at a time: spin a motor, move a servo, read a sensor. Use it after wiring changes, before every event, and when something "does not work".

To use it, make this tiny file in TeamCode:


 @TeleOp(name = "Hardware Check", group = "Test")
 public class HardwareCheck extends HardwareCheckOpMode { }
 
(abstract on this class means it is only used through such a tiny class of your own; the @TeleOp line is what puts it in the Driver Station's list.)

With your robot in five files, add @Override protected RobotDefinition robot() { return new Robot(); }: INIT then also lists every device Robot.java names that is NOT in the configuration, and what that means ("INIT will stop", or for a part marked optional(): "the part is off (fine)").

Controls (gamepad 1): D-pad up/down = choose a device.

  • Motor / CR servo: right stick Y = power (max 50%; hold right bumper for 100%). A = zero the encoder.
  • Servo: first choose a START POINT near where the servo sits now (D-pad right/left = +/- 0.01, bumpers = +/- 0.1, X = 0.5; nothing moves), then A = move it there. After that: D-pad right/left = +/- 0.01, bumpers = +/- 0.1, X = 0.5. (A servo cannot tell where it is, so nothing moves before A.)
  • Sensors: just read the values.
Changing the chosen device stops the last one. Put the robot on a block first. Help: GUIDE (or hold START 1 s) = a help page with every button, like the finders; while it is open, every motor and CR servo is stopped and the buttons do nothing. (A CR servo is a "continuous rotation" servo: it spins like a small motor instead of going to a position.) Steps: docs/tests/03-checks-before-practice-and-matches.md. Docs: docs/modules/testing.md
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    com.qualcomm.robotcore.hardware.Gamepad
     
    com.qualcomm.robotcore.hardware.Gamepad
     
    com.qualcomm.robotcore.hardware.HardwareMap
     
    static final int
     
    int
    Deprecated.
    org.firstinspires.ftc.robotcore.external.Telemetry
     

    Fields inherited from class com.qualcomm.robotcore.eventloop.opmode.OpMode

    blackboard, msStuckDetectInit, msStuckDetectInitLoop, msStuckDetectLoop, msStuckDetectStart, time
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected String[]
    The help page's lines (GUIDE, or hold START 1 s).
    final void
     
    protected RobotDefinition
    Your robot in five files (return new Robot();), to check that every device it names is in this configuration.
    final void
    runInside(Hosting hosting)
    Runs this check inside "Tune and check" (TuneAndCheckOpMode).
    void
    The whole check.

    Methods inherited from class com.qualcomm.robotcore.eventloop.opmode.LinearOpMode

    idle, init, init_loop, isStarted, isStopRequested, loop, opModeInInit, opModeIsActive, sleep, start, stop, waitForStart

    Methods inherited from class com.qualcomm.robotcore.eventloop.opmode.OpMode

    getRuntime, internalPostInitLoop, internalPostLoop, internalPreInit, internalUpdateTelemetryNow, resetRuntime, terminateOpModeNow, updateTelemetry

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MS_BEFORE_FORCE_STOP_AFTER_STOP_REQUESTED

      public static final int MS_BEFORE_FORCE_STOP_AFTER_STOP_REQUESTED
      See Also:
    • gamepad1

      public volatile com.qualcomm.robotcore.hardware.Gamepad gamepad1
    • gamepad2

      public volatile com.qualcomm.robotcore.hardware.Gamepad gamepad2
    • telemetry

      public org.firstinspires.ftc.robotcore.external.Telemetry telemetry
    • hardwareMap

      public volatile com.qualcomm.robotcore.hardware.HardwareMap hardwareMap
    • msStuckDetectStop

      @Deprecated public int msStuckDetectStop
      Deprecated.
  • Constructor Details

    • HardwareCheckOpMode

      public HardwareCheckOpMode()
  • Method Details

    • runInside

      public final void runInside(Hosting hosting)
      Runs this check inside "Tune and check" (TuneAndCheckOpMode). You do not call it yourself.
    • runOpMode

      public void runOpMode()
      The whole check. The FTC SDK calls this when you press INIT. @Override means it fills in the method LinearOpMode asks for.
      Specified by:
      runOpMode in class com.qualcomm.robotcore.eventloop.opmode.LinearOpMode
    • helpLines

      protected String[] helpLines()
      The help page's lines (GUIDE, or hold START 1 s).
    • robot

      protected RobotDefinition robot()
      Your robot in five files (return new Robot();), to check that every device it names is in this configuration. Default null: no check, just the list of devices.
    • requestOpModeStop

      public final void requestOpModeStop()