Class HarvesterSubsystemCommandFactory


public class HarvesterSubsystemCommandFactory extends AbstractSetAndSeekCommandFactory<HarvesterSubsystem>
Factory that creates harvester arm commands and wires default behaviors.
  • Constructor Details

    • HarvesterSubsystemCommandFactory

      public HarvesterSubsystemCommandFactory(HarvesterSubsystem subsystem)
      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

      public MoveHarvesterToPositionCommand createMoveToPositionCommand(double targetDegrees)
      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

      public MoveHarvesterToPositionCommand 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

      public MoveHarvesterToPositionCommand 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

      public MoveHarvesterToPositionCommand 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

      public HoldHarvesterDeployedPositionCommand 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