refactor isUsingTimeToPassDefense to isUsingTime
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / commands / auton / PassRoughTerrain.java
old mode 100755 (executable)
new mode 100644 (file)
index 8851edf..f1b0372
@@ -1,5 +1,7 @@
 package org.usfirst.frc.team3501.robot.commands.auton;
 
+import org.usfirst.frc.team3501.robot.Constants;
+import org.usfirst.frc.team3501.robot.commands.driving.DriveDistance;
 import org.usfirst.frc.team3501.robot.commands.driving.DriveForTime;
 
 import edu.wpi.first.wpilibj.command.CommandGroup;
@@ -22,20 +24,17 @@ import edu.wpi.first.wpilibj.command.CommandGroup;
  */
 public class PassRoughTerrain extends CommandGroup {
 
-  // TODO: test for the time
-  private final double BEG_TIME = 0;
-  private final double MID_TIME = 0;
-  private final double END_TIME = 0;
-
-  private final double BEG_SPEED = 0;
-  private final double MID_SPEED = 0;
-  private final double END_SPEED = 0;
-
   public PassRoughTerrain() {
 
-    addSequential(new DriveForTime(BEG_TIME, BEG_SPEED));
-    addSequential(new DriveForTime(MID_TIME, MID_SPEED));
-    addSequential(new DriveForTime(END_TIME, BEG_SPEED));
+    if (Constants.Auton.isUsingTime) {
+      addSequential(new DriveForTime(Constants.Auton.passRockWallTime,
+          Constants.Auton.passRockWallSpeed));
+    }
+    else {
+      addSequential(new DriveDistance(
+          Constants.Auton.passRoughTerrainDistance,
+          Constants.DriveTrain.PASS_DEFENSE_TIMEOUT));
+    }
 
   }
 }