Class DefaultWristRunAtVelocity
java.lang.Object
edu.wpi.first.wpilibj2.command.Command
frc.alotobots.reefscape.subsystems.wrist.commands.DefaultWristRunAtVelocity
- All Implemented Interfaces:
Sendable
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class edu.wpi.first.wpilibj2.command.Command
Command.InterruptionBehavior
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultWristRunAtVelocity
(WristSubsystem wristSubsystem, DoubleSupplier input) Creates a new DefaultWristRunAtVelocity command. -
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
-
DefaultWristRunAtVelocity
Creates a new DefaultWristRunAtVelocity command.- Parameters:
wristSubsystem
- The wrist subsystem this command will run oninput
- 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 classCommand
-
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. -
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. -
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 classCommand
- Returns:
- false always, as this is a default command that should not terminate
-