Class HoldHarvesterDeployedPositionCommand

java.lang.Object
edu.wpi.first.wpilibj2.command.Command
frc.robot.shared.commands.AbstractSubsystemCommand<HarvesterSubsystem>
frc.robot.subsystems.harvester.commands.HoldHarvesterDeployedPositionCommand
All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable

public class HoldHarvesterDeployedPositionCommand extends AbstractSubsystemCommand<HarvesterSubsystem>
Default command that monitors the harvester arm while deployed and re-engages the motor if something pushes it away from the deployed position.

During intake, a ball entering the mechanism can push the arm upward. This command detects the drift and drives the arm back to the configured deployed angle using a smooth profiled motion. Once the arm settles, the motor stops to prevent unnecessary current draw. When the arm is not in deployed mode (e.g., stowed or mid-transition), the command idles passively with no motor output.

  • Nested Class Summary

    Nested classes/interfaces inherited from class edu.wpi.first.wpilibj2.command.Command

    edu.wpi.first.wpilibj2.command.Command.InterruptionBehavior
  • Field Summary

    Fields inherited from class frc.robot.shared.commands.AbstractSubsystemCommand

    log, subsystem
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates the hold command for the given harvester subsystem.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    end(boolean interrupted)
     
    void
     
    boolean
     
    protected void
    Optional hook for subclasses to run logic during initialize after the start log.

    Methods inherited from class frc.robot.shared.commands.AbstractSubsystemCommand

    initialize

    Methods inherited from class edu.wpi.first.wpilibj2.command.Command

    addRequirements, addRequirements, alongWith, andThen, andThen, asProxy, beforeStarting, beforeStarting, cancel, deadlineFor, deadlineWith, finallyDo, finallyDo, getInterruptionBehavior, getName, getRequirements, getSubsystem, handleInterrupt, hasRequirement, ignoringDisable, initSendable, isScheduled, onlyIf, onlyWhile, raceWith, repeatedly, runsWhenDisabled, schedule, setName, setSubsystem, unless, until, withDeadline, withInterruptBehavior, withName, withTimeout, withTimeout

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HoldHarvesterDeployedPositionCommand

      public HoldHarvesterDeployedPositionCommand(HarvesterSubsystem subsystem)
      Creates the hold command for the given harvester subsystem.
      Parameters:
      subsystem - harvester subsystem to monitor and correct
  • Method Details

    • execute

      public void execute()
      Overrides:
      execute in class edu.wpi.first.wpilibj2.command.Command
    • end

      public void end(boolean interrupted)
      Overrides:
      end in class edu.wpi.first.wpilibj2.command.Command
    • isFinished

      public boolean isFinished()
      Overrides:
      isFinished in class edu.wpi.first.wpilibj2.command.Command
    • onInitialize

      protected void onInitialize()
      Description copied from class: AbstractSubsystemCommand
      Optional hook for subclasses to run logic during initialize after the start log.
      Overrides:
      onInitialize in class AbstractSubsystemCommand<HarvesterSubsystem>