Class ElevatorRunAtClimbVelocity

java.lang.Object
edu.wpi.first.wpilibj2.command.Command
frc.alotobots.reefscape.subsystems.elevator.commands.ElevatorRunAtClimbVelocity
All Implemented Interfaces:
Sendable

public class ElevatorRunAtClimbVelocity extends Command
Command that runs the elevator at a specified velocity for climbing. This command takes a velocity input (normalized between -1.0 and 1.0) and applies it to the elevator, scaled by the maximum speed constant.
  • Constructor Details

    • ElevatorRunAtClimbVelocity

      public ElevatorRunAtClimbVelocity(ElevatorSubsystem elevatorSubsystem, DoubleSupplier input)
      Creates a new ClimbingElevatorRunAtVelocity command.
      Parameters:
      elevatorSubsystem - The elevator subsystem this command will run on
      input - A supplier that provides the normalized velocity input (-1.0 to 1.0)
  • Method Details

    • initialize

      public void initialize()
      Called when the command is initially scheduled. No initialization is needed for this command.
      Overrides:
      initialize in class Command
    • execute

      public void execute()
      Called repeatedly when this command is scheduled to run. Calculates the target velocity by multiplying the input value by the maximum speed, then commands the elevator subsystem to run at that velocity.
      Overrides:
      execute in class Command
    • 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.
      Overrides:
      end in class Command
      Parameters:
      interrupted - Whether the command was interrupted (true) or completed normally (false)
    • 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 class Command
      Returns:
      false always, as this is a default command that should not terminate