Class ElevatorHoldHeight
java.lang.Object
edu.wpi.first.wpilibj2.command.Command
edu.wpi.first.wpilibj2.command.ScheduleCommand
frc.alotobots.reefscape.subsystems.elevator.commands.ElevatorHoldHeight
- All Implemented Interfaces:
Sendable
Command that holds the elevator at its current position. This command uses velocity control with
target speed of 0 and applies it to the elevator. ScheduleCommand to ensure that other commands
are able to interrupt it in a command group.
-
Nested Class Summary
Nested classes/interfaces inherited from class edu.wpi.first.wpilibj2.command.Command
Command.InterruptionBehavior
-
Constructor Summary
ConstructorsConstructorDescriptionElevatorHoldHeight
(ElevatorSubsystem elevatorSubsystem) Creates a new ElevatorHoldHeight command. -
Method Summary
Methods inherited from class edu.wpi.first.wpilibj2.command.ScheduleCommand
runsWhenDisabled
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, schedule, setName, setSubsystem, unless, until, withDeadline, withInterruptBehavior, withName, withTimeout, withTimeout
-
Constructor Details
-
ElevatorHoldHeight
Creates a new ElevatorHoldHeight command. Should ONLY be used in autonomous. In teleop, the default command replicates the same behavior.- Parameters:
elevatorSubsystem
- The elevator subsystem this command will run on
-
-
Method Details
-
initialize
public void initialize()Called when the command is initially scheduled. No initialization is needed for this command.- Overrides:
initialize
in classScheduleCommand
-
execute
public void execute()Called repeatedly when this command is scheduled to run. -
end
public void end(boolean interrupted) Called once when the command ends or is interrupted. Stops the elevator to ensure it doesn't continue moving. -
isFinished
public boolean isFinished()Returns whether this command has finished. This command never finishes on its own and will run until interrupted.- Overrides:
isFinished
in classScheduleCommand
- Returns:
- false always, as this is a command that should not terminate
-