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
.command
.Command
;
8 public class TimeDrive
extends Command
{
9 double currentTime
, targetTime
, speed
;
12 this(Auton
.DEFAULT_TIME
, Auton
.DEFAULT_SPEED
);
15 public TimeDrive(double time
) {
16 this(time
, Auton
.DEFAULT_SPEED
);
19 public TimeDrive(double time
, double speed
) {
20 requires(Robot
.driveTrain
);
22 this.setTimeout(time
);
24 this.targetTime
= time
;
29 protected void initialize() {
33 protected void execute() {
34 Robot
.driveTrain
.joystickDrive(speed
, 0);
39 protected boolean isFinished() {
40 return this.isTimedOut();
44 protected void end() {
45 Robot
.driveTrain
.stop();
49 protected void interrupted() {