Class EncoderCheckOpMode
- OK: its own port counted, the way it was pushed.
- NO COUNTS: no port counted (encoder cable missing, or the motor did not turn).
- counts on "X" instead: another motor's port counted (encoder cables swapped).
- counts BACKWARD: its port counted the other way (power wires swapped, or a reversed encoder).
Each motor is set up as Robot.java sets it up (its direction) and pushed toward the side where its part
has room (EncoderMotor.pushSign(): a lift up). It never pushes while another port still moves. The
count turns with the direction setting, so a wrong reversed() cannot show in the counts: the screen
tells the driver to watch the part. A lift's second motor (alsoMotor) is pushed with its first. A
motor whose encoder nothing reads (an intake) may have no cable: "no counts" is fine there. CR servos and
servos are not checked; nor is a motor whose port reads an odometry pod or a CR servo turret's encoder.
Robot on a block. Hold A: the check runs while A is held (let go = everything stops). Y = start again. It is in "Tune and check" for every robot in five files. On its own, in TeamCode:
@TeleOp(name = "Encoder Check", group = "Finders")
public class EncoderCheck extends EncoderCheckOpMode {
@Override protected RobotDefinition robot() { return new Robot(); }
}
Docs: docs/modules/finders.md. Guide: docs/tuning/02-wiring-checks.md, "Encoder Check"-
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.crossbotics.ftchelper.finders.FinderOpMode
results, tFields inherited from class com.qualcomm.robotcore.eventloop.opmode.OpMode
blackboard, msStuckDetectInit, msStuckDetectInitLoop, msStuckDetectLoop, msStuckDetectStart, time -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidBinds gamepad 1 buttons.protected StringThe finder's name, e.g.protected String[]final voidprotected abstract RobotDefinitionrobot()Your robot in five files (return new Robot();): its motors are checked.protected voidsetup()Sets up the hardware, in INIT.protected voidThe finder's own screen lines, every loop.protected voidWhat INIT shows (the controls, a safety note).protected voidstep()Runs once every loop after the buttons: moves things, measures.protected voidstopAll()Stops every motor and servo it moves.Methods inherited from class com.crossbotics.ftchelper.finders.FinderOpMode
batteryMatters, helpKeyDown, inInit, inputsReady, openHelp, pause, runInside, running, runOpModeMethods 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
-
EncoderCheckOpMode
public EncoderCheckOpMode()
-
-
Method Details
-
robot
Your robot in five files (return new Robot();): its motors are checked. -
finderName
Description copied from class:FinderOpModeThe finder's name, e.g. "Servo finder".- Specified by:
finderNamein classFinderOpMode
-
setup
protected void setup()Description copied from class:FinderOpModeSets up the hardware, in INIT. Nothing may move here.- Specified by:
setupin classFinderOpMode
-
showInit
Description copied from class:FinderOpModeWhat INIT shows (the controls, a safety note).- Overrides:
showInitin classFinderOpMode
-
bind
Description copied from class:FinderOpModeBinds gamepad 1 buttons. Actions must be quick: never wait.- Specified by:
bindin classFinderOpMode
-
step
protected void step()Description copied from class:FinderOpModeRuns once every loop after the buttons: moves things, measures. Never waits.- Specified by:
stepin classFinderOpMode
-
show
Description copied from class:FinderOpModeThe finder's own screen lines, every loop.- Specified by:
showin classFinderOpMode
-
helpLines
- Overrides:
helpLinesin classFinderOpMode
-
stopAll
protected void stopAll()Description copied from class:FinderOpModeStops every motor and servo it moves. Called at the end, always.- Specified by:
stopAllin classFinderOpMode
-
requestOpModeStop
public final void requestOpModeStop()
-