add dead reckoning time, spd, distance to pass defense commands and constants
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / commands / auton / PassLowBar.java
index cbdaeef6fd54e36c0e46ef339cd5c41c4e5efee5..57259bbaf78b4fd06007fe0b79c1602f9a941a7c 100644 (file)
@@ -1,6 +1,8 @@
 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,16 +24,15 @@ import edu.wpi.first.wpilibj.command.CommandGroup;
 
 public class PassLowBar extends CommandGroup {
 
-  private final double DISTANCE = 4.0;
-  private final double DEFAULT_SPEED = 0.5;
-
   public PassLowBar() {
-    // TODO: need to add sequential for retracting the arms and shooting hood
-    // once those commands are made
-    addSequential(new DriveDistance(DISTANCE, DEFAULT_SPEED));
-  }
-
-  public PassLowBar(double speed) {
-    addSequential(new DriveDistance(DISTANCE, speed));
+    if (Constants.DeadReckoning.isDeadReckoning) {
+      addSequential(new DriveForTime(Constants.DeadReckoning.passLowBarTime,
+          Constants.DeadReckoning.passLowBarSpeed));
+    }
+    else {
+      addSequential(new DriveDistance(
+          Constants.DeadReckoning.passLowBarDistance,
+          Constants.DriveTrain.PASS_DEFENSE_TIMEOUT));
+    }
   }
 }