Class IndexerSubsystemCommandFactory


public class IndexerSubsystemCommandFactory extends AbstractVelocityCommandFactory<IndexerSubsystem>
Factory that creates indexer commands and wires default behaviors.
  • Constructor Details

    • IndexerSubsystemCommandFactory

      public IndexerSubsystemCommandFactory(IndexerSubsystem subsystem)
      Creates a factory for commands that share the given indexer subsystem instance.
      Parameters:
      subsystem - indexer subsystem instance that commands created by this factory will control
  • Method Details

    • createIdleCommand

      public IdleIndexerCommand createIdleCommand()
      Builds an idle command that holds the roller at the configured idle RPM (typically 0).
      Specified by:
      createIdleCommand in class AbstractVelocityCommandFactory<IndexerSubsystem>
      Returns:
      command that idles the indexer roller
    • createReverseCommand

      public ReverseIndexerCommand createReverseCommand(Supplier<Double> targetRpmSupplier)
      Builds a reverse command that reads its target RPM from a supplier.
      Parameters:
      targetRpmSupplier - provider for the target reverse RPM (negative value); evaluated on initialize
      Returns:
      command that spins the roller in reverse at the supplied RPM
    • createReverseCommand

      public ReverseIndexerCommand createReverseCommand()
      Builds a reverse command using the configured default reverse velocity.

      The configured reverse RPM is negated so the roller spins backward toward the feeder.

      Returns:
      command that spins the roller in reverse at the default RPM
    • createFireWhenReadyCommand

      public edu.wpi.first.wpilibj2.command.Command createFireWhenReadyCommand(Supplier<Boolean> shooterReadySupplier, Supplier<Boolean> turretOnTargetSupplier)
      Builds a composite command that waits until the shooter and turret are both ready, then feeds Fuel into the shooter.

      The command holds the indexer stopped while either readiness supplier returns false. Once both report true, it feeds forward at the configured feed velocity. This keeps the indexer decoupled from the shooter and turret subsystems — readiness is checked through suppliers wired in RobotContainer.

      Parameters:
      shooterReadySupplier - supplier that returns true when the shooter flywheel is at the target RPM
      turretOnTargetSupplier - supplier that returns true when the turret is aimed at the scoring target
      Returns:
      composite command that waits for readiness then feeds