change name of LowerDrawBridge to PassDrawBridge and add pre and post condition comments
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / commands / DefaultAutonStrategy.java
index df21714a86ee482316b8dd49b508388456fa081e..ce2b7fb72c41a7da3558ebcea815e8d313c24df9 100755 (executable)
@@ -9,55 +9,69 @@ import edu.wpi.first.wpilibj.command.CommandGroup;
  * 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;
 
-  public DefaultAutonStrategy(int position, Defense defense) {
-    /*
-     * pass defense drive forward do what has to be done to pass the defense
-     * drive forward aim face tower aim shooter toward goal shoot
-     */
+  // number from -1 to 1
+  final double SPEED_FOR_PASSING_DEFENSE = 0.5;
 
-    // TODO: any variable that is not declared/instantiated are vars that need
-    // to be tested for their value
+  public DefaultAutonStrategy(int position, Defense defense) {
 
     switch (defense) {
+
     case PORTCULLIS:
-      // we are assuming that the robot is also driving forward as the
-      // portcullis is being lifted
+
       addSequential(new LiftPortcullis());
+
     case SALLY_PORT:
-      // addSequential();
+
+      addSequential(new PassSallyPort());
+
     case ROUGH_TERRAIN:
 
-      addSequential(new DriveForDistance(distance, speed));
+      addSequential(
+          new DriveForDistance(DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD + 2,
+              DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD + 2));
 
     case LOW_BAR:
 
-      addSequential(new DriveForDistance(distance, speed));
+      addSequential(
+          new DriveForDistance(DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD + 2,
+              SPEED_FOR_PASSING_DEFENSE));
 
     case CHEVAL_DE_FRISE:
 
-      addSequential(new LowerChevalDeFrise());
+      addSequential(new PassChevalDeFrise());
 
     case DRAWBRIDGE:
 
-      addSequential(new LowerDrawBridge());
+      addSequential(new PassDrawBridge());
 
     case MOAT:
 
-      addSequential(new DriveForDistance(distance, speed));
+      addSequential(new DriveForDistance(
+          DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD, SPEED_FOR_PASSING_DEFENSE));
 
     case ROCK_WALL:
 
-      addSequential(new DriveForDistance(distance, speed));
+      addSequential(new DriveForDistance(
+          DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD, SPEED_FOR_PASSING_DEFENSE));
 
     case RAMPART:
 
-      addSequential(new DriveForDistance(distance, speed));
+      addSequential(new DriveForDistance(
+          DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD, SPEED_FOR_PASSING_DEFENSE));
 
     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 Shoot());
+
   }
 
 }