Class IndexerSubsystemCommandFactory
java.lang.Object
frc.robot.shared.commands.AbstractSubsystemCommandFactory<TSubsystem>
frc.robot.shared.commands.AbstractVelocityCommandFactory<IndexerSubsystem>
frc.robot.subsystems.indexer.commands.IndexerSubsystemCommandFactory
public class IndexerSubsystemCommandFactory
extends AbstractVelocityCommandFactory<IndexerSubsystem>
Factory that creates indexer commands and wires default behaviors.
-
Field Summary
Fields inherited from class frc.robot.shared.commands.AbstractSubsystemCommandFactory
subsystem -
Constructor Summary
ConstructorsConstructorDescriptionIndexerSubsystemCommandFactory(IndexerSubsystem subsystem) Creates a factory for commands that share the given indexer 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 feeds Fuel into the shooter.Builds an idle command that holds the roller at the configured idle RPM (typically 0).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
-
IndexerSubsystemCommandFactory
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
Builds an idle command that holds the roller at the configured idle RPM (typically 0).- Specified by:
createIdleCommandin classAbstractVelocityCommandFactory<IndexerSubsystem>- Returns:
- command that idles the indexer roller
-
createReverseCommand
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
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 RPMturretOnTargetSupplier- supplier that returns true when the turret is aimed at the scoring target- Returns:
- composite command that waits for readiness then feeds
-