Class IndexerSubsystem

All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable, edu.wpi.first.wpilibj2.command.Subsystem

public class IndexerSubsystem extends AbstractVelocitySubsystem<IndexerSubsystemConfig>
Indexer subsystem that controls when Fuel leaves the robot and enters the shooter.

The indexer sits directly upstream of the shooter and downstream of the feeder. It can spin forward to feed Fuel into the shooter flywheels, or reverse to back Fuel toward the feeder. All RPM values in the public API represent roller (mechanism) speed after gear reduction, not motor shaft speed.

The subsystem extends AbstractVelocitySubsystem which provides bidirectional velocity control. Positive RPM feeds forward (toward the shooter); negative RPM feeds backward (toward the feeder).

  • Constructor Details

    • IndexerSubsystem

      public IndexerSubsystem(IndexerSubsystemConfig config)
      Builds the indexer subsystem with a single SparkMax-driven roller motor.
      Parameters:
      config - indexer configuration bundle loaded from JSON; velocities are expressed in RPM
  • Method Details

    • setReverseVelocity

      public void setReverseVelocity()
      Convenience method that sets the roller to reverse at the configured reverse velocity.

      The configured reverse RPM is stored as a positive value; this method negates it so the roller spins backward toward the feeder.

    • setFeedVelocity

      public void setFeedVelocity()
      Convenience method that sets the roller to the configured default feed velocity.
    • isFeeding

      public boolean isFeeding()
      Returns true when the indexer is being commanded to feed forward toward the shooter.

      This checks whether the current velocity setpoint is positive (forward direction), indicating the system intends to push a ball into the shooter. Used by the ball flight simulator to detect when a ball enters the shooter.

      Returns:
      true when the indexer's setpoint velocity is positive (feeding forward)