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
ConstructorsConstructorDescriptionCreates the hold command for the given harvester subsystem. -
Method Summary
Methods inherited from class frc.robot.shared.commands.AbstractSubsystemCommand
initializeMethods 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
-
Constructor Details
-
HoldHarvesterDeployedPositionCommand
Creates the hold command for the given harvester subsystem.- Parameters:
subsystem- harvester subsystem to monitor and correct
-
-
Method Details
-
execute
public void execute()- Overrides:
executein classedu.wpi.first.wpilibj2.command.Command
-
end
public void end(boolean interrupted) - Overrides:
endin classedu.wpi.first.wpilibj2.command.Command
-
isFinished
public boolean isFinished()- Overrides:
isFinishedin classedu.wpi.first.wpilibj2.command.Command
-
onInitialize
protected void onInitialize()Description copied from class:AbstractSubsystemCommandOptional hook for subclasses to run logic during initialize after the start log.- Overrides:
onInitializein classAbstractSubsystemCommand<HarvesterSubsystem>
-