Package com.crossbotics.ftchelper.robot
Class Indexer
Feeds ONE game piece at a time into a launcher: a servo that pushes, a CR servo or a motor that runs
for a moment. Usually given to a
Launcher, which decides when to feed:
launcher = add(Launcher.flywheel("launcher", "gobilda-5203-6000").feeder(Indexer.servo("indexer")));
public static class Indexer { // Tunables.java
public static double rest = 0.15, push = 0.55; // servo positions (Indexer.servo)
public static double pushSec = 0.25, returnSec = 0.25;
}
Tunables: Indexer.servo: rest, push, pushSec, returnSec.
Indexer.crServo and Indexer.motor: power and feedSec (how long it
runs per piece). Added on its own (no launcher), its suggested button is operator RB: feed one.
Docs: docs/modules/robot.md (section "Indexer")
-
Method Summary
Modifier and TypeMethodDescriptionvoidThe part's telemetry line; each module adds its own.voidclearJam()Forgets a jam (the launcher calls it when the driver asks to shoot again).static IndexerA continuous-rotation servo that runs for a moment per piece.voidfeedOne()Feeds one piece now (ignored while busy).booleanisBusy()True until the piece is through and the feeder is ready for the next one.booleanisJammed()True if the feeder is jammed (then the launcher stops shooting).static IndexerA motor (a roller or belt) that runs for a moment per piece.reversed()It turns the other way.static IndexerA servo that pushes a piece in, then comes back.voidstop()Stops all motion.voidupdate()Called once every loop.Methods inherited from class com.crossbotics.ftchelper.robot.Module
deviceName, looks, name, part, tunables
-
Method Details
-
servo
A servo that pushes a piece in, then comes back. -
crServo
A continuous-rotation servo that runs for a moment per piece. -
motor
A motor (a roller or belt) that runs for a moment per piece. -
reversed
It turns the other way. -
feedOne
public void feedOne()Feeds one piece now (ignored while busy). A launcher usually calls this, when it is ready. -
isBusy
public boolean isBusy()Description copied from interface:FeederTrue until the piece is through and the feeder is ready for the next one. -
isJammed
public boolean isJammed()Description copied from interface:FeederTrue if the feeder is jammed (then the launcher stops shooting). Default: never. "default" means a class that does not write this method gets this version. -
clearJam
public void clearJam()Description copied from interface:FeederForgets a jam (the launcher calls it when the driver asks to shoot again). Default: nothing. -
update
public void update()Description copied from interface:SubsystemCalled once every loop. Do the hardware work here. Must be quick: no sleep, no waiting. While update() waits, the whole robot is frozen (no driving, no limits, no STOP). -
stop
public void stop()Description copied from interface:SubsystemStops all motion. Called at the end of every OpMode. -
addTelemetry
Description copied from class:ModuleThe part's telemetry line; each module adds its own.- Specified by:
addTelemetryin interfaceSubsystem- Overrides:
addTelemetryin classModule<Indexer>
-