--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.driving;
+
+import org.usfirst.frc.team3501.robot.Robot;
+
+import edu.wpi.first.wpilibj.Timer;
+import edu.wpi.first.wpilibj.command.Command;
+
+/**
+ * This command drives the robot for a specified time while adjusting the right
+ * and left motor values so that the robot will drive straight
+ *
+ * parameters:
+ * time in seconds
+ * motorVal
+ *
+ * @author Meryem
+ * @author Niyati
+ *
+ */
+public class DriveStraightForTime extends Command {
+ Timer timer;
+ double time, motorVal;
+
+ public DriveStraightForTime(double time, double motorVal) {
+ requires(Robot.getDriveTrain());
+
+ timer = new Timer();
+ this.time = time;
+
+ this.motorVal = motorVal;
+
+ }
+
+ @Override
+ protected void initialize() {
+ timer.start();
+ }
+
+ @Override
+ protected void execute() {
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return timer.get() >= time;
+ }
+
+ @Override
+ protected void end() {
+ Robot.getDriveTrain().stop();
+ }
+
+ @Override
+ protected void interrupted() {
+ end();
+ }
+}