change code that used setMotorSpeeds method to drive method
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / commands / driving / TurnForTime.java
index acddeaa54a355c38a9883db367b4b260bcffb1fb..909bd9d89b36a93c92795172f16b6157753737ab 100755 (executable)
@@ -16,6 +16,9 @@ import edu.wpi.first.wpilibj.command.Command;
  * post-condition: robot has turned in the specified direction for the specified
  * time
  *
+ * TODO: test for speed/ time constants for specific angles (ex. 30 degrees, 60
+ * degrees, 90 degrees)
+ *
  * @author Meryem, Avi, and Sarvesh
  *
  */
@@ -42,7 +45,8 @@ public class TurnForTime extends Command {
     timer.start();
 
     if (direction == Direction.RIGHT) {
-      Robot.driveTrain.setMotorSpeeds(speed, -speed);
+      Robot.driveTrain.drive(speed, -speed);
+      ;
     } else if (direction == Direction.LEFT) {
       Robot.driveTrain.setMotorSpeeds(-speed, speed);
     }
@@ -55,14 +59,12 @@ public class TurnForTime extends Command {
 
   @Override
   protected boolean isFinished() {
-    if (timer.get() >= seconds)
-      return true;
-    return false;
+    return (timer.get() >= seconds);
   }
 
   @Override
   protected void end() {
-    Robot.driveTrain.setMotorSpeeds(0, 0);
+    Robot.driveTrain.drive(0, 0);
   }
 
   @Override