Class ElevatorOpenLoop
java.lang.Object
edu.wpi.first.wpilibj2.command.Command
frc.alotobots.reefscape.subsystems.elevator.commands.ElevatorOpenLoop
- All Implemented Interfaces:
Sendable
Default command for manual control of the elevator using percent output. Allows direct operator
control through a joystick or other input device.
-
Nested Class Summary
Nested classes/interfaces inherited from class edu.wpi.first.wpilibj2.command.Command
Command.InterruptionBehavior
-
Constructor Summary
ConstructorsConstructorDescriptionElevatorOpenLoop
(ElevatorSubsystem elevatorSubsystem, DoubleSupplier percent) Creates a new ElevatorOpenLoop command for manual elevator control. -
Method Summary
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
-
Constructor Details
-
ElevatorOpenLoop
Creates a new ElevatorOpenLoop command for manual elevator control.- Parameters:
elevatorSubsystem
- The elevator subsystem to controlpercent
- Supplier for the control input (-1.0 to 1.0), typically from a joystick
-
-
Method Details
-
initialize
public void initialize()Called when the command is initially scheduled. No initialization is required for this command.- Overrides:
initialize
in classCommand
-
execute
public void execute()Executes the manual control loop. Called every scheduler run while the command is scheduled. -
end
public void end(boolean interrupted) Called when the command ends or is interrupted. Stops the elevator to prevent uncontrolled motion. -
isFinished
public boolean isFinished()Determines if the command has finished. This command runs until interrupted, so it never finishes on its own.- Overrides:
isFinished
in classCommand
- Returns:
- false as this command runs continuously
-