Class HarvesterSubsystemCommandFactory
java.lang.Object
frc.robot.shared.commands.AbstractSubsystemCommandFactory<TSubsystem>
frc.robot.shared.commands.AbstractSetAndSeekCommandFactory<HarvesterSubsystem>
frc.robot.subsystems.harvester.commands.HarvesterSubsystemCommandFactory
public class HarvesterSubsystemCommandFactory
extends AbstractSetAndSeekCommandFactory<HarvesterSubsystem>
Factory that creates harvester arm commands and wires default behaviors.
-
Field Summary
Fields inherited from class frc.robot.shared.commands.AbstractSubsystemCommandFactory
subsystem -
Constructor Summary
ConstructorsConstructorDescriptionCreates a factory for commands that share the given harvester subsystem instance. -
Method Summary
Modifier and TypeMethodDescriptionBuilds a command that deploys the arm to the lowered Fuel-collection position.Builds a hold command that monitors the deployed position and re-engages the motor when the arm is pushed away by incoming Fuel.createMoveToPositionCommand(double targetDegrees) Builds a profiled move command that drives the arm to a fixed angle.createMoveToPositionCommand(Supplier<Double> targetDegreesSupplier) Builds a profiled move command that reads its target angle from a supplier.Builds a command that stows the arm in the upright match-start position.Builds a command that raises the arm to the sweep position to push Fuel toward the shooting array.edu.wpi.first.wpilibj2.command.CommandBuilds a hold command and sets it as the default command for the harvester subsystem.edu.wpi.first.wpilibj2.command.CommandBuilds a stow command and sets it as the default command for the harvester subsystem.Methods inherited from class frc.robot.shared.commands.AbstractSetAndSeekCommandFactory
createResetEncoderCommand, createSysIdDynamicCommand, createSysIdDynamicCommand, createSysIdDynamicCommandWithDefaultTimeout, createSysIdFullSweepCommand, createSysIdFullSweepCommand, createSysIdQuasistaticCommand, createSysIdQuasistaticCommand, createSysIdQuasistaticCommandWithDefaultTimeoutMethods inherited from class frc.robot.shared.commands.AbstractSubsystemCommandFactory
getSubsystem
-
Constructor Details
-
HarvesterSubsystemCommandFactory
Creates a factory for commands that share the given harvester subsystem instance.- Parameters:
subsystem- harvester subsystem instance that commands created by this factory will control
-
-
Method Details
-
createMoveToPositionCommand
public MoveHarvesterToPositionCommand createMoveToPositionCommand(Supplier<Double> targetDegreesSupplier) Builds a profiled move command that reads its target angle from a supplier.- Parameters:
targetDegreesSupplier- supplier providing the desired arm angle in degrees- Returns:
- command that drives the arm toward the supplied target
-
createMoveToPositionCommand
Builds a profiled move command that drives the arm to a fixed angle.- Parameters:
targetDegrees- desired arm angle in degrees- Returns:
- command that drives the arm to the fixed target
-
createDeployCommand
Builds a command that deploys the arm to the lowered Fuel-collection position.- Returns:
- command that moves the arm to the deployed angle
-
createStowCommand
Builds a command that stows the arm in the upright match-start position.- Returns:
- command that moves the arm to the stowed angle
-
createSweepCommand
Builds a command that raises the arm to the sweep position to push Fuel toward the shooting array.- Returns:
- command that moves the arm to the sweep angle
-
setDefaultStowCommand
public edu.wpi.first.wpilibj2.command.Command setDefaultStowCommand()Builds a stow command and sets it as the default command for the harvester subsystem.When no other command is scheduled, the arm will seek the stowed position so it stays inside the robot perimeter.
- Returns:
- the stow command that was set as the default
-
createHoldDeployedPositionCommand
Builds a hold command that monitors the deployed position and re-engages the motor when the arm is pushed away by incoming Fuel.- Returns:
- command that holds the deployed position when active and idles otherwise
-
setDefaultHoldDeployedPositionCommand
public edu.wpi.first.wpilibj2.command.Command setDefaultHoldDeployedPositionCommand()Builds a hold command and sets it as the default command for the harvester subsystem.When no other command is scheduled, the arm will monitor for drift from the deployed position and re-engage the motor to correct it. When the arm is not deployed, the command idles passively.
- Returns:
- the hold command that was set as the default
-