add precondition and Timeout to Expel and Intake commands
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / commands / DefaultAutonStrategy.java
index 97070637f1bc5901fa8e2510a858b17354d72ac7..99fe317d3945d2ab85ebf689d2f561d458a8c940 100755 (executable)
@@ -8,13 +8,8 @@ import edu.wpi.first.wpilibj.command.CommandGroup;
  * The default autonomous strategy involves passing the defense that is in front
  * of it, aiming the robot/ shooter towards the goal, and shooting.
  */
-public class DefaultAutonStrategy extends CommandGroup {
-  // in feet
-  // distance along a platform
-  final double DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD = 4.0;
 
-  // number from -1 to 1
-  final double SPEED_FOR_PASSING_DEFENSE = 0.5;
+public class DefaultAutonStrategy extends CommandGroup {
 
   public DefaultAutonStrategy(int position, Defense defense) {
 
@@ -30,46 +25,37 @@ public class DefaultAutonStrategy extends CommandGroup {
 
     case ROUGH_TERRAIN:
 
-      addSequential(
-          new DriveForDistance(DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD + 2,
-              DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD + 2));
+      addSequential(new PassRoughTerrain());
 
     case LOW_BAR:
 
-      addSequential(
-          new DriveForDistance(DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD + 2,
-              SPEED_FOR_PASSING_DEFENSE));
+      addSequential(new PassLowBar());
 
     case CHEVAL_DE_FRISE:
 
-      addSequential(new LowerChevalDeFrise());
+      addSequential(new PassChevalDeFrise());
 
     case DRAWBRIDGE:
 
-      addSequential(new LowerDrawBridge());
+      addSequential(new PassDrawBridge());
 
     case MOAT:
 
-      addSequential(new DriveForDistance(
-          DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD, SPEED_FOR_PASSING_DEFENSE));
+      addSequential(new PassMoat());
 
     case ROCK_WALL:
 
-      addSequential(new DriveForDistance(
-          DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD, SPEED_FOR_PASSING_DEFENSE));
+      addSequential(new PassRockWall());
 
     case RAMPART:
 
-      addSequential(new DriveForDistance(
-          DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD, SPEED_FOR_PASSING_DEFENSE));
+      addSequential(new PassRampart());
 
     default:
       break;
     }
 
-    // TODO: put in the argument that goes inside of aim, based on the position
-    // variable that was passed into the command group
-    addSequential(new Aim());
+    addSequential(new AimAndAlign());
     addSequential(new Shoot());
 
   }