Class Intake

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

public final class Intake extends Module<Intake> implements Toggleable
A roller that pulls game pieces in (and pushes them out): one motor, or one or more continuous rotation (CR) servos.

 intake = add(Intake.motor("intake"));                              // Robot.java
 intake = add(Intake.crServos("left_intake", "right_intake").reversed("right_intake"));
 intake = add(Intake.motor("intake").onAtStart());                  // runs from START until stopped
 

Tunables.Intake: inPower (default 1.0) and outPower (default 0.7). Suggested buttons: hold G2 RT to run it in, hold G2 LT to push out. With onAtStart(): G2 RT switches it on and off, and holding LT pushes out, then goes back to what it was doing. Docs: docs/modules/robot.md (section "Intake")

  • Method Details

    • motor

      public static Intake motor(String name)
      An intake on one motor.
    • crServos

      public static Intake crServos(String... names)
      An intake on one or more CR servos (they run together). The Tunables section is the first name's.
    • withCrServos

      public Intake withCrServos(String... crServoNames)
      CR servos that run together with the intake motor (for example two side wheels next to a roller). They read the same Tunables section.
      Parameters:
      crServoNames - their configuration names
    • reversed

      public Intake reversed(String... deviceNames)
      These run the other way (for example the right one of two facing servos).
    • reversed

      public Intake reversed()
      Reverses the only device (same as reversed(itsName)).
    • holds

      public Intake holds(int pieces)
      How many game pieces it can hold at once (for the simulator; default: a guess of 3).
      Parameters:
      pieces - e.g. 4
    • onAtStart

      public Intake onAtStart()
      Starts running in at START (in autonomous and TeleOp), until stopped.
    • in

      public void in()
      Runs in until stop().
    • out

      public void out()
      Runs out until stop() or in().
    • 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
    • toggle

      public void toggle()
      On (in) if stopped, stopped if running.
      Specified by:
      toggle in interface Toggleable
    • reverse

      public void reverse()
      Pushes out while a button is held: call it every loop while held, and endReverse() on release. Afterwards it goes back to what it was doing (running in, or stopped).
    • endReverse

      public void endReverse()
      Ends reverse().
    • isPushingOut

      public boolean isPushingOut()
      True while it runs out (after out()), until in() or stop().
    • isRunning

      public boolean isRunning()
      True while it runs in or out.
    • 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
    • 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<Intake>