Class IntakeSubsystemCommandFactory
java.lang.Object
frc.robot.shared.commands.AbstractSubsystemCommandFactory<TSubsystem>
frc.robot.shared.commands.AbstractVelocityCommandFactory<IntakeSubsystem>
frc.robot.subsystems.intake.commands.IntakeSubsystemCommandFactory
Factory that creates intake commands and wires default behaviors.
-
Field Summary
Fields inherited from class frc.robot.shared.commands.AbstractSubsystemCommandFactory
subsystem -
Constructor Summary
ConstructorsConstructorDescriptionIntakeSubsystemCommandFactory(IntakeSubsystem subsystem) Creates a factory for commands that share the given intake subsystem instance. -
Method Summary
Modifier and TypeMethodDescriptionBuilds an eject command using the configured default reverse velocity.createEjectCommand(Supplier<Double> targetRpmSupplier) Builds an eject command that reads its target RPM from a supplier.Builds an idle command that holds the rollers at the configured idle RPM (typically zero).edu.wpi.first.wpilibj2.command.CommandBuilds a command that spins the rollers forward at the configured intake velocity and holds that speed indefinitely.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
-
IntakeSubsystemCommandFactory
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
Builds an idle command that holds the rollers at the configured idle RPM (typically zero).- Specified by:
createIdleCommandin classAbstractVelocityCommandFactory<IntakeSubsystem>- Returns:
- command that idles the intake rollers
-
createEjectCommand
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
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
whileTrueso 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
-