public final class DriveDistance
extends edu.wpi.first.wpilibj.command.Command
| Modifier and Type | Field | Description |
|---|---|---|
private double |
distanceTraveled |
The distance the robot has traveled so far.
|
private double |
targetDistance |
The distance intended for the robot to drive.
|
| Constructor | Description |
|---|---|
DriveDistance(double targetDistance) |
Constructs a new
DriveDistance command. |
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
end() |
Robot is halted upon completion of this command.
|
protected void |
execute() |
Robot is driven until the distance traveled is reached.
|
protected void |
initialize() |
Initializes drivetrain talon sensors.
|
protected boolean |
isFinished() |
Command is finished if the distance traveled is with in plus or minus 10 units of the target distance.
|
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 targetDistance
private double distanceTraveled
public DriveDistance(double targetDistance)
DriveDistance command.targetDistance - The distance intended for the robot to drive.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