add dead reckoning time, spd, distance to pass defense commands and constants
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / commands / auton / PassRampart.java
index 5e894f5e5a308e8be8b783ee058651ea5183054c..95bc2a233332c036472c66540558d9c70d9fb37f 100755 (executable)
@@ -1,10 +1,18 @@
 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;
 
 /***
  * This command will drive the robot through the rampart.
  *
+ * dependency on subsystems: drivetrain
+ *
+ * dependency on other commands: DriveForTime
+ *
  * pre-condition: robot is flush against the ramp of the outerworks in front of
  * the rampart
  *
@@ -18,16 +26,15 @@ public class PassRampart extends CommandGroup {
 
   public PassRampart() {
 
-    final double BEG_TIME = 0;
-    final double BEG_SPEED = 0;
-    final double MID_TIME = 0;
-    final double MID_SPEED = 0;
-    final double END_TIME = 0;
-    final double END_SPEED = 0;
-
-    addSequential(new DriveForTime(BEG_TIME, BEG_SPEED));
-    addSequential(new DriveForTime(MID_TIME, MID_SPEED));
-    addSequential(new DriveForTime(END_TIME, END_SPEED));
+    if (Constants.DeadReckoning.isDeadReckoning) {
+      addSequential(new DriveForTime(Constants.DeadReckoning.passRockWallTime,
+          Constants.DeadReckoning.passRockWallSpeed));
+    }
+    else {
+      addSequential(new DriveDistance(
+          Constants.DeadReckoning.passRampartDistance,
+          Constants.DriveTrain.PASS_DEFENSE_TIMEOUT));
+    }
 
   }