Class FeederSubsystemCommandFactory


public class FeederSubsystemCommandFactory extends AbstractVelocityCommandFactory<FeederSubsystem>
Factory that creates feeder commands and wires default behaviors.
  • Constructor Details

    • FeederSubsystemCommandFactory

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

    • createIdleCommand

      public IdleFeederCommand createIdleCommand()
      Builds an idle command that holds the belt at the configured idle RPM.
      Specified by:
      createIdleCommand in class AbstractVelocityCommandFactory<FeederSubsystem>
      Returns:
      command that idles the feeder belt
    • createReverseCommand

      public ReverseFeederCommand createReverseCommand(Supplier<Double> targetRpmSupplier)
      Builds a reverse command that reads its target RPM from a supplier.

      The supplier should return a negative RPM so the belt spins backward toward the intake.

      Parameters:
      targetRpmSupplier - provider for the target reverse RPM (negative value); evaluated on initialize
      Returns:
      command that spins the belt in reverse at the supplied RPM
    • createReverseCommand

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

      The configured reverse RPM is negated so the belt spins backward toward the intake.

      Returns:
      command that spins the belt in reverse at the default clearing 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 runs the reverse-pulse-then-forward sequence.

      The command blocks while either readiness supplier returns false. Once both report true, it runs a short reverse pulse (dislodging jammed Fuel) and then transports forward. This keeps the feeder 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 runs the reverse-pulse-then-forward sequence