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.
-
Field Summary
FieldsModifier and TypeFieldDescriptioncom.qualcomm.robotcore.hardware.Gamepadcom.qualcomm.robotcore.hardware.Gamepadcom.qualcomm.robotcore.hardware.HardwareMapstatic final intintDeprecated.org.firstinspires.ftc.robotcore.external.TelemetryFields inherited from class com.qualcomm.robotcore.eventloop.opmode.OpMode
blackboard, msStuckDetectInit, msStuckDetectInitLoop, msStuckDetectLoop, msStuckDetectStart, time -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidvoidThe whole check.Methods inherited from class com.qualcomm.robotcore.eventloop.opmode.LinearOpMode
idle, init, init_loop, isStarted, isStopRequested, loop, opModeInInit, opModeIsActive, sleep, start, stop, waitForStartMethods inherited from class com.qualcomm.robotcore.eventloop.opmode.OpMode
getRuntime, internalPostInitLoop, internalPostLoop, internalPreInit, internalUpdateTelemetryNow, resetRuntime, terminateOpModeNow, updateTelemetry
-
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.
-
-
Constructor Details
-
HardwareCheckOpMode
public HardwareCheckOpMode()
-
-
Method Details
-
runOpMode
public void runOpMode()The whole check. The FTC SDK calls this when you press INIT.@Overridemeans it fills in the method LinearOpMode asks for.- Specified by:
runOpModein classcom.qualcomm.robotcore.eventloop.opmode.LinearOpMode
-
requestOpModeStop
public final void requestOpModeStop()
-