Class ShooterSubsystemCommandFactory


public class ShooterSubsystemCommandFactory extends AbstractVelocityCommandFactory<ShooterSubsystem>
Generates commands that operate on the shooter subsystem so RobotContainer can stay focused on wiring.
  • Constructor Details

    • ShooterSubsystemCommandFactory

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

    • createIdleCommand

      public IdleShooterCommand createIdleCommand()
      Builds an idle command that holds the flywheel at the configured idle RPM.
      Specified by:
      createIdleCommand in class AbstractVelocityCommandFactory<ShooterSubsystem>
      Returns:
      command that idles the shooter flywheel
    • createDistanceBasedSpinCommand

      public edu.wpi.first.wpilibj2.command.Command createDistanceBasedSpinCommand(Supplier<Double> distanceMetersSupplier)
      Builds a command that continuously computes flywheel RPM from the robot's distance to a target.

      Each cycle, the command reads the current distance from the supplier, converts it to an RPM via the subsystem's interpolation table, and seeks that velocity. Use this as a default command or bind it to a button so the shooter automatically adjusts speed as the robot moves.

      Parameters:
      distanceMetersSupplier - supplier returning the distance from the robot to the active target in meters
      Returns:
      command that continuously tracks distance-based RPM until interrupted
    • createBoostRpmCommand

      public edu.wpi.first.wpilibj2.command.Command createBoostRpmCommand()
      Builds a command that boosts the shooter RPM by the configured adjustment amount while held.

      The command does not require the shooter subsystem so it can run concurrently with an active shooting command. When the command ends (trigger released), the offset resets to zero.

      Returns:
      command that applies a positive RPM offset while active
    • createCutRpmCommand

      public edu.wpi.first.wpilibj2.command.Command createCutRpmCommand()
      Builds a command that cuts the shooter RPM by the configured adjustment amount while held.

      The command does not require the shooter subsystem so it can run concurrently with an active shooting command. When the command ends (trigger released), the offset resets to zero.

      Returns:
      command that applies a negative RPM offset while active