Package frc.robot.subsystems.swerve.util
Class TurnToRotation
java.lang.Object
edu.wpi.first.wpilibj2.command.Command
frc.robot.subsystems.swerve.util.TurnToRotation
- All Implemented Interfaces:
Sendable
This command will turn the robot to a specified angle.
-
Nested Class Summary
Nested classes/interfaces inherited from class edu.wpi.first.wpilibj2.command.Command
Command.InterruptionBehavior -
Constructor Summary
ConstructorsConstructorDescriptionTurnToRotation(Swerve swerve, double angle, boolean isRelative) Turns robot to specified angle.TurnToRotation(Swerve swerve, Supplier<Rotation2d> angle, boolean isRelative) Turns robot to specified angle. -
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
-
TurnToRotation
Turns robot to specified angle. Uses absolute rotation on field.- Parameters:
swerve- Swerve subsystemangle- Requested angle to turn toisRelative- Whether the angle is relative to the current angle: true = relative, false = absolute
-
TurnToRotation
Turns robot to specified angle. Uses absolute rotation on field.- Parameters:
swerve- Swerve subsystemangle- Supplier that provides the requested angle to turn toisRelative- Whether the angle is relative to the current angle: true = relative, false = absolute
-
-
Method Details
-
initialize
public void initialize()- Overrides:
initializein classCommand
-
execute
public void execute() -
end
public void end(boolean interrupt) -
isFinished
public boolean isFinished()- Overrides:
isFinishedin classCommand
-