Class HoodFinderOpMode
Tunables.Hood: the servo position (or encoder ticks) at
its two hard stops (posA, posB), and if you measure them, the hood's angle there
(angleA, angleB) and at points in between (a calibration table, for a linkage
that is not a straight line). It works before the hood has any numbers in Tunables.java.
A servo hood: Start: D-pad = choose a start point (the servo does NOT move yet), A = move it there. Nudge: D-pad right/left = +/- 0.01, up/down = +/- 0.05, hold RB = 10 times finer. A motor hood: nothing is powered. Move the hood by hand; the screen shows the encoder (0 = where it was at INIT, so start with the hood on the stop you want as 0, the same as in a match). Both: X = this is stop A (posA) B = this is stop B (posB) (a hair off each stop) hold LB + D-pad = the angle you measured here (up/down +/- 1, right/left +/- 0.1) A = save a calibration point here (position, angle) Y = undo the last point Help: GUIDE (or hold START 1 s) = a help page with every button; everything pauses.
It shows the lines for Tunables.java: Tunables.Hood: posA = 0.205, posB = 0.648,
then angleA = 0, angleB = 25 once you gave the angles at both stops; OR, once you saved points
between the stops (and gave the angles at both stops), a calibration line INSTEAD (the Hood
reads one or the other). Each angle you give is used for one place (a stop or a point): measure the
next place before marking it. A table whose angles do not keep going one way is not shown (the Hood
would stop INIT): the screen says which point to measure again. Copy them into Tunables.java (the robot uses
the file, not this screen; a change made in the tuning menu is also lost at the next restart unless
you copy it back). The lines are saved on the Control Hub at STOP.
In your TeamCode, the robot in five files (it reads the hood's name, servo or motor, and reversed() from Robot.java without needing its Tunables numbers):
@TeleOp(name = "Hood Finder", group = "Finders")
public class HoodFinder extends HoodFinderOpMode {
@Override protected RobotDefinition robot() { return new Robot(); }
}
Without one, it uses the servo or motor called hoodName() ("hood").
Docs: docs/modules/finders.md. Guide: docs/guides/finders.md-
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[]The help page: every button and the steps, a line each (at most 13 lines, about 50 characters each, to fit on the Driver Station).protected StringhoodName()The hood's configuration name when there is norobot().final voidprotected RobotDefinitionrobot()Your robot in five files (return new Robot();): its hood is used.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
helpKeyDown, inputsReady, openHelp, pause, 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
-
HoodFinderOpMode
public HoodFinderOpMode()
-
-
Method Details
-
robot
Your robot in five files (return new Robot();): its hood is used. Default null:hoodName(). -
hoodName
The hood's configuration name when there is norobot(). Default "hood". -
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
Description copied from class:FinderOpModeThe help page: every button and the steps, a line each (at most 13 lines, about 50 characters each, to fit on the Driver Station). GUIDE (or START held 1 s) shows it, in INIT or while running. Default: a page that says there is no help yet.- 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()
-