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.)

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: D-pad right/left = +/- 0.01, bumpers = +/- 0.1, X = 0.5. (A servo does not move until you press.)
  • Sensors: just read the values.
Changing the chosen device stops the last one. Put the robot on a block first. (A CR servo is a "continuous rotation" servo: it spins like a small motor instead of going to a position.) Steps: docs/guides/testing.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
    final void
     
    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

    • 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
    • requestOpModeStop

      public final void requestOpModeStop()