Class IntakeSubsystemCommandFactory


public class IntakeSubsystemCommandFactory extends AbstractVelocityCommandFactory<IntakeSubsystem>
Factory that creates intake commands and wires default behaviors.
  • Constructor Details

    • IntakeSubsystemCommandFactory

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

    • createIdleCommand

      public IdleIntakeCommand createIdleCommand()
      Builds an idle command that holds the rollers at the configured idle RPM (typically zero).
      Specified by:
      createIdleCommand in class AbstractVelocityCommandFactory<IntakeSubsystem>
      Returns:
      command that idles the intake rollers
    • createEjectCommand

      public EjectIntakeCommand createEjectCommand(Supplier<Double> targetRpmSupplier)
      Builds an eject command that reads its target RPM from a supplier.

      The supplier should return a negative RPM so the rollers spin backward to push Fuel out.

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

      public EjectIntakeCommand createEjectCommand()
      Builds an eject command using the configured default reverse velocity.

      The configured reverse RPM is negated so the rollers spin backward to push Fuel out.

      Returns:
      command that spins the rollers in reverse at the default eject RPM
    • createIntakeAndHoldCommand

      public edu.wpi.first.wpilibj2.command.Command createIntakeAndHoldCommand()
      Builds a command that spins the rollers forward at the configured intake velocity and holds that speed indefinitely.

      Use this with whileTrue so the rollers pull Fuel while a button is held and return to idle when released.

      Returns:
      command that intakes Fuel and holds velocity until interrupted