change OpenSallyPort to PassSallyPort and add pre and post condition comments to it
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / commands / DefaultAutonStrategy.java
index 5eaab4571871a620b165d3d894723a2079a4fe3c..546d5e69678f3836ed9ae8606db7c444ccf57cfc 100755 (executable)
@@ -1,5 +1,7 @@
 package org.usfirst.frc.team3501.robot.commands;
 
+import org.usfirst.frc.team3501.robot.Constants.Defense;
+
 import edu.wpi.first.wpilibj.command.CommandGroup;
 
 /**
@@ -8,21 +10,141 @@ import edu.wpi.first.wpilibj.command.CommandGroup;
  */
 public class DefaultAutonStrategy extends CommandGroup {
 
-  public DefaultAutonStrategy(int position, int defense) {
+  // 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 DefaultAutonStrategy(int position, Defense defense) {
+
+    // TODO: any variable that is not declared/instantiated are variables that
+    // need
+    // to be tested for their value
+
+    /*
+     * Portcullis: Robot is in front of the portcullis in whatever position 1-5.
+     * addSequential(new LiftPortcullis()); lifting the portcullis.
+     * addSequential(new DriveForDistance(distance, speed)); drive through the
+     * portcullis however neccesary. change direction to drive towards the
+     * designated shooting spot, go to that spot. shoot
+     */
+
+    /*
+     * Sally Port: Robot is in front of the sally port in whatever position 1-5.
+     * Do whatever is needed in order to cross sally port. addSequential(new
+     * DriveForDistance(distance, speed));//drive through the sally port. change
+     * direction to drive towards the designated shooting spot, go to that spot.
+     * shoot
+     */
+
+    /*
+     * Rough Terrain: Robot is in front of the sally port in whatever postion
+     * 1-5. Do whatever adaptive technique is required to pass rough terrain
+     * addSequential(new DriveForDistance(distance, speed)); go through the
+     * rough terrain change direction to drive towards the designated shooting
+     * spot, go to that spot. shoot
+     */
+
+    /*
+     * Low Bar: Robot is in front of low bar in whatever position 1-5.
+     * addSequential(new DriveForDistance(distance, speed));//drive through the
+     * low bar change direction to drive towards the designated shooting spot,
+     * go to that spot. shoot
+     */
+
+    /*
+     * Cheval de Frise: Robot is in front of cheval de frise in whatever
+     * position 1-5. do whatever to make all pieces facing down toward robot
+     * addSequential(new DriveForDistance(distance, speed));//drive to pass
+     * cheval de frise change direction to drive towards the designated shooting
+     * spot, go to that spot. shoot
+     */
+
+    /*
+     * Drawbridge: Robot is in front of drawbridge in whatever position 1-5.
+     * lift the drawbridge in whatever way it is to be lifted. addSequential(new
+     * DriveForDistance(distance, speed));//pass the drawbridge change direction
+     * to drive towards the designated shooting spot, go to that spot. shoot
+     */
+
+    /*
+     * Moat: Robot is in front of moat in whatever position 1-5. do whatever is
+     * adaptable to cross the moat. addSequential(new DriveForDistance(distance,
+     * speed));//cross the moat change direction to drive towards the designated
+     * shooting spot, go to that spot. shoot
+     */
+
+    /*
+     * Rockwall: Robot is in front of moat in whatever position 1-5. do whatever
+     * function is neccesary to cross the rock wall. addSequential(new
+     * DriveForDistance(distance, speed));//cross the rockwall change direction
+     * to drive towards the designated shooting spot, go to that spot. shoot
+     */
+
     /*
-     * pass defense drive forward do what has to be done to pass the defense
-     * drive forward aim face tower aim shooter toward goal shoot
+     * Rampart: Robot is in front of moat in whatever position 1-5. do whatever
+     * function is neccesary to cross the rockwall addSequential(new
+     * DriveForDistance(distance, speed));//cross the rockwall change direction
+     * to drive towards the designated shooting spot, go to that spot. shoot
      */
 
-    // based on defense pass the defense
     switch (defense) {
-    case 1:
-    case 2:
-    case 3:
-    case 4:
-    case 5:
+
+    case PORTCULLIS:
+
+      addSequential(new LiftPortcullis());
+
+    case SALLY_PORT:
+
+      addSequential(new PassSallyPort());
+
+    case ROUGH_TERRAIN:
+
+      addSequential(
+          new DriveForDistance(DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD + 2,
+              DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD + 2));
+
+    case LOW_BAR:
+
+      addSequential(
+          new DriveForDistance(DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD + 2,
+              SPEED_FOR_PASSING_DEFENSE));
+
+    case CHEVAL_DE_FRISE:
+
+      addSequential(new LowerChevalDeFrise());
+
+    case DRAWBRIDGE:
+
+      addSequential(new LowerDrawBridge());
+
+    case MOAT:
+
+      addSequential(new DriveForDistance(
+          DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD, SPEED_FOR_PASSING_DEFENSE));
+
+    case ROCK_WALL:
+
+      addSequential(new DriveForDistance(
+          DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD, SPEED_FOR_PASSING_DEFENSE));
+
+    case RAMPART:
+
+      addSequential(new DriveForDistance(
+          DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD, SPEED_FOR_PASSING_DEFENSE));
+
+    default:
+      break;
     }
 
+    // aim towards goal
+    // later put in whatever argument goes inside of aim based on the position
+    // variable that was passed onto the command
+    // group
+    addSequential(new Aim());
+    addSequential(new Shoot());
+
   }
 
 }