make 'pass' commands for all the defenses that just have to be driven over
authorMeryem Esa <meresa14@gmail.com>
Sat, 30 Jan 2016 23:50:08 +0000 (15:50 -0800)
committerKevin Zhang <icestormf1@gmail.com>
Sun, 31 Jan 2016 00:04:38 +0000 (16:04 -0800)
src/org/usfirst/frc/team3501/robot/commands/DefaultAutonStrategy.java
src/org/usfirst/frc/team3501/robot/commands/PassDrawBridge.java
src/org/usfirst/frc/team3501/robot/commands/PassLowBar.java [new file with mode: 0755]
src/org/usfirst/frc/team3501/robot/commands/PassMoat.java [new file with mode: 0755]
src/org/usfirst/frc/team3501/robot/commands/PassRampart.java [new file with mode: 0755]
src/org/usfirst/frc/team3501/robot/commands/PassRockWall.java [new file with mode: 0755]
src/org/usfirst/frc/team3501/robot/commands/PassRoughTerrain.java [new file with mode: 0755]

index ce2b7fb72c41a7da3558ebcea815e8d313c24df9..eccd96682b860470712f53154f6b85aa9e909acf 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,15 +25,11 @@ 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:
 
@@ -50,18 +41,15 @@ public class DefaultAutonStrategy extends CommandGroup {
 
     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;
index 4b18f4a38555de02cd87fc6fe3dcb683a3211247..ad3d7ee79a74612d6a5ab94ec7e23dd1537bb1b6 100755 (executable)
@@ -6,7 +6,7 @@ import edu.wpi.first.wpilibj.command.Command;
  * This command will lower the draw bridge and go through it
  *
  * pre-condition: robot is flush against the ramp of the outerworks in front of
- * the portcullis
+ * the draw bridge
  *
  * post-condition: the robot has passed the draw bridge and is in the next zone
  *
diff --git a/src/org/usfirst/frc/team3501/robot/commands/PassLowBar.java b/src/org/usfirst/frc/team3501/robot/commands/PassLowBar.java
new file mode 100755 (executable)
index 0000000..cdb9e9d
--- /dev/null
@@ -0,0 +1,49 @@
+package org.usfirst.frc.team3501.robot.commands;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/***
+ * This command will drive the robot through the low bar.
+ *
+ * pre-condition: robot is flush against the ramp of the outerworks in front of
+ * the low bar
+ *
+ * post-condition: the robot has passed the low bar and is in the next zone
+ *
+ * @author Meryem and Avi
+ *
+ */
+public class PassLowBar extends Command {
+
+  public PassLowBar() {
+    // Use requires() here to declare subsystem dependencies
+    // eg. requires(chassis);
+  }
+
+  // Called just before this Command runs the first time
+  @Override
+  protected void initialize() {
+  }
+
+  // Called repeatedly when this Command is scheduled to run
+  @Override
+  protected void execute() {
+  }
+
+  // Make this return true when this Command no longer needs to run execute()
+  @Override
+  protected boolean isFinished() {
+    return false;
+  }
+
+  // Called once after isFinished returns true
+  @Override
+  protected void end() {
+  }
+
+  // Called when another command which requires one or more of the same
+  // subsystems is scheduled to run
+  @Override
+  protected void interrupted() {
+  }
+}
diff --git a/src/org/usfirst/frc/team3501/robot/commands/PassMoat.java b/src/org/usfirst/frc/team3501/robot/commands/PassMoat.java
new file mode 100755 (executable)
index 0000000..331e17b
--- /dev/null
@@ -0,0 +1,49 @@
+package org.usfirst.frc.team3501.robot.commands;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/***
+ * This command will drive the robot through the moat.
+ *
+ * pre-condition: robot is flush against the ramp of the outerworks in front of
+ * the moat
+ *
+ * post-condition: the robot has passed the moat and is in the next zone
+ *
+ * @author Meryem and Avi
+ *
+ */
+public class PassMoat extends Command {
+
+  public PassMoat() {
+    // Use requires() here to declare subsystem dependencies
+    // eg. requires(chassis);
+  }
+
+  // Called just before this Command runs the first time
+  @Override
+  protected void initialize() {
+  }
+
+  // Called repeatedly when this Command is scheduled to run
+  @Override
+  protected void execute() {
+  }
+
+  // Make this return true when this Command no longer needs to run execute()
+  @Override
+  protected boolean isFinished() {
+    return false;
+  }
+
+  // Called once after isFinished returns true
+  @Override
+  protected void end() {
+  }
+
+  // Called when another command which requires one or more of the same
+  // subsystems is scheduled to run
+  @Override
+  protected void interrupted() {
+  }
+}
diff --git a/src/org/usfirst/frc/team3501/robot/commands/PassRampart.java b/src/org/usfirst/frc/team3501/robot/commands/PassRampart.java
new file mode 100755 (executable)
index 0000000..2d387ef
--- /dev/null
@@ -0,0 +1,49 @@
+package org.usfirst.frc.team3501.robot.commands;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/***
+ * This command will drive the robot through the rampart.
+ *
+ * pre-condition: robot is flush against the ramp of the outerworks in front of
+ * the rampart
+ *
+ * post-condition: the robot has passed the rampart and is in the next zone
+ *
+ * @author Meryem and Avi
+ *
+ */
+public class PassRampart extends Command {
+
+  public PassRampart() {
+    // Use requires() here to declare subsystem dependencies
+    // eg. requires(chassis);
+  }
+
+  // Called just before this Command runs the first time
+  @Override
+  protected void initialize() {
+  }
+
+  // Called repeatedly when this Command is scheduled to run
+  @Override
+  protected void execute() {
+  }
+
+  // Make this return true when this Command no longer needs to run execute()
+  @Override
+  protected boolean isFinished() {
+    return false;
+  }
+
+  // Called once after isFinished returns true
+  @Override
+  protected void end() {
+  }
+
+  // Called when another command which requires one or more of the same
+  // subsystems is scheduled to run
+  @Override
+  protected void interrupted() {
+  }
+}
diff --git a/src/org/usfirst/frc/team3501/robot/commands/PassRockWall.java b/src/org/usfirst/frc/team3501/robot/commands/PassRockWall.java
new file mode 100755 (executable)
index 0000000..d00ed8a
--- /dev/null
@@ -0,0 +1,49 @@
+package org.usfirst.frc.team3501.robot.commands;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/***
+ * This command will drive the robot through the rock wall.
+ *
+ * pre-condition: robot is flush against the ramp of the outerworks in front of
+ * the rock wall
+ *
+ * post-condition: the robot has passed the rock wall and is in the next zone
+ *
+ * @author Meryem and Avi
+ *
+ */
+public class PassRockWall extends Command {
+
+  public PassRockWall() {
+    // Use requires() here to declare subsystem dependencies
+    // eg. requires(chassis);
+  }
+
+  // Called just before this Command runs the first time
+  @Override
+  protected void initialize() {
+  }
+
+  // Called repeatedly when this Command is scheduled to run
+  @Override
+  protected void execute() {
+  }
+
+  // Make this return true when this Command no longer needs to run execute()
+  @Override
+  protected boolean isFinished() {
+    return false;
+  }
+
+  // Called once after isFinished returns true
+  @Override
+  protected void end() {
+  }
+
+  // Called when another command which requires one or more of the same
+  // subsystems is scheduled to run
+  @Override
+  protected void interrupted() {
+  }
+}
diff --git a/src/org/usfirst/frc/team3501/robot/commands/PassRoughTerrain.java b/src/org/usfirst/frc/team3501/robot/commands/PassRoughTerrain.java
new file mode 100755 (executable)
index 0000000..adc982a
--- /dev/null
@@ -0,0 +1,50 @@
+package org.usfirst.frc.team3501.robot.commands;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/***
+ * This command will drive the robot through the rough terrain.
+ *
+ * pre-condition: robot is flush against the ramp of the outerworks in front of
+ * the rough terrain
+ *
+ * post-condition: the robot has passed the rough terrain and is in the next
+ * zone
+ *
+ * @author Meryem and Avi
+ *
+ */
+public class PassRoughTerrain extends Command {
+
+  public PassRoughTerrain() {
+    // Use requires() here to declare subsystem dependencies
+    // eg. requires(chassis);
+  }
+
+  // Called just before this Command runs the first time
+  @Override
+  protected void initialize() {
+  }
+
+  // Called repeatedly when this Command is scheduled to run
+  @Override
+  protected void execute() {
+  }
+
+  // Make this return true when this Command no longer needs to run execute()
+  @Override
+  protected boolean isFinished() {
+    return false;
+  }
+
+  // Called once after isFinished returns true
+  @Override
+  protected void end() {
+  }
+
+  // Called when another command which requires one or more of the same
+  // subsystems is scheduled to run
+  @Override
+  protected void interrupted() {
+  }
+}