Class FeederSubsystemCommandFactory
java.lang.Object
frc.robot.shared.commands.AbstractSubsystemCommandFactory<TSubsystem>
frc.robot.shared.commands.AbstractVelocityCommandFactory<FeederSubsystem>
frc.robot.subsystems.feeder.commands.FeederSubsystemCommandFactory
Factory that creates feeder commands and wires default behaviors.
-
Field Summary
Fields inherited from class frc.robot.shared.commands.AbstractSubsystemCommandFactory
subsystem -
Constructor Summary
ConstructorsConstructorDescriptionFeederSubsystemCommandFactory(FeederSubsystem subsystem) Creates a factory for commands that share the given feeder subsystem instance. -
Method Summary
Modifier and TypeMethodDescriptionedu.wpi.first.wpilibj2.command.CommandcreateFireWhenReadyCommand(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.Builds an idle command that holds the belt at the configured idle RPM.Builds a reverse command using the configured default reverse velocity.createReverseCommand(Supplier<Double> targetRpmSupplier) Builds a reverse command that reads its target RPM from a supplier.Methods inherited from class frc.robot.shared.commands.AbstractVelocityCommandFactory
createContinuousVelocityCommand, createStopCommand, createSysIdDynamicCommand, createSysIdDynamicCommand, createSysIdDynamicCommandWithDefaultTimeout, createSysIdFullSweepCommand, createSysIdFullSweepCommand, createSysIdQuasistaticCommand, createSysIdQuasistaticCommand, createSysIdQuasistaticCommandWithDefaultTimeout, setDefaultIdleCommandMethods inherited from class frc.robot.shared.commands.AbstractSubsystemCommandFactory
getSubsystem
-
Constructor Details
-
FeederSubsystemCommandFactory
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
Builds an idle command that holds the belt at the configured idle RPM.- Specified by:
createIdleCommandin classAbstractVelocityCommandFactory<FeederSubsystem>- Returns:
- command that idles the feeder belt
-
createReverseCommand
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
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 RPMturretOnTargetSupplier- 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
-