change switch statements in Robot.java to if else chain
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / commands / PassMoat.java
index 634240a47ec01d0f3286426917c017f7e3b9684c..b54508f4109a4e2cb7098bb2087677f1e62c803e 100755 (executable)
@@ -1,10 +1,17 @@
 package org.usfirst.frc.team3501.robot.commands;
 
-import edu.wpi.first.wpilibj.command.Command;
+import edu.wpi.first.wpilibj.command.CommandGroup;
 
 /***
  * This command will drive the robot through the moat.
  *
+ * The code drives the robot for a specific time at a specific speed up the ramp
+ * to the defense then drive over the defense at a different speed and time.
+ *
+ * dependency on subsystem: drivetrain
+ *
+ * dependency on other commands: DriveForTime
+ *
  * pre-condition: robot is flush against the ramp of the outerworks in front of
  * the moat
  *
@@ -13,30 +20,20 @@ import edu.wpi.first.wpilibj.command.Command;
  * @author Meryem and Avi
  *
  */
-public class PassMoat extends Command {
 
-  public PassMoat() {
+public class PassMoat extends CommandGroup {
 
-  }
-
-  @Override
-  protected void initialize() {
-  }
+  private final double BEG_TIME = 0;
+  private final double MID_TIME = 0;
+  private final double END_TIME = 0;
+  private final double BEG_SPEED = 0;
+  private final double MID_SPEED = 0;
+  private final double END_SPEED = 0;
 
-  @Override
-  protected void execute() {
-  }
-
-  @Override
-  protected boolean isFinished() {
-    return false;
-  }
-
-  @Override
-  protected void end() {
-  }
+  public PassMoat() {
+    addSequential(new DriveForTime(BEG_TIME, BEG_SPEED));
+    addSequential(new DriveForTime(MID_TIME, MID_SPEED));
+    addSequential(new DriveForTime(END_TIME, END_SPEED));
 
-  @Override
-  protected void interrupted() {
   }
 }