Class Indexer

java.lang.Object
com.crossbotics.ftchelper.robot.Module<Indexer>
com.crossbotics.ftchelper.robot.Indexer
All Implemented Interfaces:
Subsystem, Feeder

public final class Indexer extends Module<Indexer> implements Feeder
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 Details

    • servo

      public static Indexer servo(String name)
      A servo that pushes a piece in, then comes back.
    • crServo

      public static Indexer crServo(String name)
      A continuous-rotation servo that runs for a moment per piece.
    • motor

      public static Indexer motor(String name)
      A motor (a roller or belt) that runs for a moment per piece.
    • reversed

      public Indexer 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.
      Specified by:
      feedOne in interface Feeder
    • isBusy

      public boolean isBusy()
      Description copied from interface: Feeder
      True until the piece is through and the feeder is ready for the next one.
      Specified by:
      isBusy in interface Feeder
    • isJammed

      public boolean isJammed()
      Description copied from interface: Feeder
      True 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.
      Specified by:
      isJammed in interface Feeder
    • clearJam

      public void clearJam()
      Description copied from interface: Feeder
      Forgets a jam (the launcher calls it when the driver asks to shoot again). Default: nothing.
      Specified by:
      clearJam in interface Feeder
    • update

      public void update()
      Description copied from interface: Subsystem
      Called 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).
      Specified by:
      update in interface Subsystem
    • stop

      public void stop()
      Description copied from interface: Subsystem
      Stops all motion. Called at the end of every OpMode.
      Specified by:
      stop in interface Subsystem
    • addTelemetry

      public void addTelemetry(RobotTelemetry t)
      Description copied from class: Module
      The part's telemetry line; each module adds its own.
      Specified by:
      addTelemetry in interface Subsystem
      Overrides:
      addTelemetry in class Module<Indexer>