4778da85d7cbff1aaa6389d361f85ed4a440448b
1 package org
.usfirst
.frc
.team3501
.robot
.commands
.driving
;
3 import org
.usfirst
.frc
.team3501
.robot
.Constants
.Auton
;
4 import org
.usfirst
.frc
.team3501
.robot
.Robot
;
6 import edu
.wpi
.first
.wpilibj
.Timer
;
7 import edu
.wpi
.first
.wpilibj
.command
.Command
;
9 public class TimeDrive
extends Command
{
11 double currentTime
, targetTime
, speed
;
14 this(Auton
.DEFAULT_TIME
, Auton
.DEFAULT_SPEED
);
17 public TimeDrive(double time
) {
18 this(time
, Auton
.DEFAULT_SPEED
);
21 public TimeDrive(double time
, double speed
) {
22 requires(Robot
.driveTrain
);
23 this.setInterruptible(false);
25 this.setTimeout(time
);
30 protected void initialize() {
34 protected void execute() {
35 Robot
.driveTrain
.drive(speed
, 0);
39 protected boolean isFinished() {
40 return this.isTimedOut();
44 protected void end() {
45 Robot
.driveTrain
.stop();
49 protected void interrupted() {