Package frc.robot.commands.drive
Class TurnToAngle
java.lang.Object
edu.wpi.first.wpilibj2.command.Command
frc.robot.commands.drive.TurnToAngle
- 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 -
Field Summary
Fields inherited from class edu.wpi.first.wpilibj2.command.Command
m_requirements -
Constructor Summary
ConstructorsConstructorDescriptionTurnToAngle(Swerve swerve, double angle, boolean isRelative) Turns robot to specified angle. -
Method Summary
Methods inherited from class edu.wpi.first.wpilibj2.command.Command
addRequirements, alongWith, andThen, andThen, asProxy, beforeStarting, beforeStarting, cancel, deadlineWith, finallyDo, finallyDo, getInterruptionBehavior, getName, getRequirements, getSubsystem, handleInterrupt, hasRequirement, ignoringDisable, initSendable, isScheduled, onlyIf, onlyWhile, raceWith, repeatedly, runsWhenDisabled, schedule, setName, setSubsystem, unless, until, withInterruptBehavior, withName, withTimeout
-
Constructor Details
-
TurnToAngle
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
-
-
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
-