fix wait commands
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / commands / shooter / ShootAtHighGoal.java
index 5ecc8091a64de82af8b18863ca9cdc729840c25c..bb61604127cc4fa6393dcc61f060f150c03dc4de 100755 (executable)
@@ -1,29 +1,46 @@
 package org.usfirst.frc.team3501.robot.commands.shooter;
 
+import org.usfirst.frc.team3501.robot.Constants.IntakeArm;
+import org.usfirst.frc.team3501.robot.commands.intakearm.MoveIntakeArm;
+import org.usfirst.frc.team3501.robot.commands.intakearm.TimeRunIntake;
+
 import edu.wpi.first.wpilibj.command.CommandGroup;
+import edu.wpi.first.wpilibj.command.WaitCommand;
 
 /**
  * This command group performs the sequence of steps to shoot at the high goal
  *
- * pre-conditions: the catapult is down, a ball is in the intake, and the intake
- * is in the up position
+ * pre-conditions: a ball is in the intake
  *
  * post-conditions: catapult is retracted, intake is extended
  */
 public class ShootAtHighGoal extends CommandGroup {
+  private static final double WAIT_SECONDS = 0.4;
+  private static final double TIME_FOR_BALL_TO_CATAPULT_ROLLING = 1.0;
 
   public ShootAtHighGoal() {
-    // check that the catapult is down and change accordingly
 
-    // (if photogate) check if ball is in intake
+    // make sure intake is in up position
+    addSequential(new MoveIntakeArm(IntakeArm.RETRACT));
+
+    addSequential(new WaitCommand(WAIT_SECONDS));
 
-    // make sure intake is in up position and change accordingly
+    // get ball onto catapult
+    addSequential(new TimeRunIntake(TIME_FOR_BALL_TO_CATAPULT_ROLLING));
 
     // shoot catapult pistons
+    addSequential(new FireCatapult());
+
+    addSequential(new WaitCommand(WAIT_SECONDS));
 
     // extend intake (ball actually shoots here)
+    addSequential(new MoveIntakeArm(IntakeArm.EXTEND));
+
+    addSequential(new WaitCommand(WAIT_SECONDS));
 
     // retract catapult pistons
+    addSequential(new ResetCatapult());
 
+    //
   }
 }