public final class TurnDegrees
extends edu.wpi.first.wpilibj.command.Command
| Modifier and Type | Field | Description |
|---|---|---|
private double |
desiredAngle |
The angle to turn the robot.
|
private double |
yaw |
The current yaw the robot has turned.
|
| Constructor | Description |
|---|---|
TurnDegrees(double desiredAngle) |
Constructs a new
TurnDegrees command. |
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
end() |
Upon completion of the command, the drivetrain is halted, and the AHRS is set to zero yaw.
|
protected void |
execute() |
Turns the robot until the desired angle is reached.
|
protected void |
initialize() |
Initializes the AHRS to zero degrees.
|
protected boolean |
isFinished() |
Command is finished if the yaw turned is at the finished angle.
|
cancel, clearRequirements, doesRequire, getGroup, initSendable, interrupted, isCanceled, isCompleted, isInterruptible, isRunning, isTimedOut, requires, setInterruptible, setRunWhenDisabled, setTimeout, start, timeSinceInitialized, toString, willRunWhenDisabledclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitprivate double desiredAngle
private double yaw
public TurnDegrees(double desiredAngle)
TurnDegrees command.desiredAngle - The angle to turn the robot.protected void initialize()
initialize in class edu.wpi.first.wpilibj.command.Commandprotected void execute()
execute in class edu.wpi.first.wpilibj.command.Commandprotected boolean isFinished()
isFinished in class edu.wpi.first.wpilibj.command.Commandprotected void end()
end in class edu.wpi.first.wpilibj.command.Command