Class IndexerSubsystem
- All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable,edu.wpi.first.wpilibj2.command.Subsystem
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).
-
Nested Class Summary
Nested classes/interfaces inherited from class frc.robot.shared.subsystems.AbstractVelocitySubsystem
AbstractVelocitySubsystem.TriFunction<A,B, C, R> -
Field Summary
Fields inherited from class frc.robot.shared.subsystems.AbstractVelocitySubsystem
controllerFields inherited from class frc.robot.shared.subsystems.AbstractMotorSubsystem
feedforward, motor, motorInputs -
Constructor Summary
ConstructorsConstructorDescriptionBuilds the indexer subsystem with a single SparkMax-driven roller motor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true when the indexer is being commanded to feed forward toward the shooter.voidConvenience method that sets the roller to the configured default feed velocity.voidConvenience method that sets the roller to reverse at the configured reverse velocity.Methods inherited from class frc.robot.shared.subsystems.AbstractVelocitySubsystem
buildVelocityMotor, getIdleVelocityRpm, getMeasuredVelocityRpm, getTargetVelocityRpm, isAtTargetVelocity, isReady, isWithinTolerance, periodic, seekVelocity, setTargetVelocityRpm, stopMethods inherited from class frc.robot.shared.subsystems.AbstractMotorSubsystem
applyVoltage, getMeasuredPositionRadians, getMeasuredVelocityRadiansPerSecond, getSysIdRoutine, logSysIdEnd, logSysIdInterrupted, logSysIdStart, refreshFeedforward, updateAndLogMotorInputsMethods inherited from class frc.robot.shared.subsystems.AbstractSubsystem
getConfig, isFMSAttached, isSimulation, isSubsystemDisabled, isVerbose, isVerboseLoggingEnabled, logDisabled, reportWarningMethods inherited from class edu.wpi.first.wpilibj2.command.SubsystemBase
addChild, getName, getSubsystem, initSendable, setName, setSubsystemMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface edu.wpi.first.wpilibj2.command.Subsystem
defer, getCurrentCommand, getDefaultCommand, idle, register, removeDefaultCommand, run, runEnd, runOnce, setDefaultCommand, simulationPeriodic, startEnd, startRun
-
Constructor Details
-
IndexerSubsystem
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)
-