Class DefaultWristRunAtVelocity

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

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

    • DefaultWristRunAtVelocity

      public DefaultWristRunAtVelocity(WristSubsystem wristSubsystem, DoubleSupplier input)
      Creates a new DefaultWristRunAtVelocity command.
      Parameters:
      wristSubsystem - The wrist 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 wrist 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 wrist 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