fix wait commands
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / commands / shooter / ShootAtHighGoal.java
1 package org.usfirst.frc.team3501.robot.commands.shooter;
2
3 import org.usfirst.frc.team3501.robot.Constants.IntakeArm;
4 import org.usfirst.frc.team3501.robot.commands.intakearm.MoveIntakeArm;
5 import org.usfirst.frc.team3501.robot.commands.intakearm.TimeRunIntake;
6
7 import edu.wpi.first.wpilibj.command.CommandGroup;
8 import edu.wpi.first.wpilibj.command.WaitCommand;
9
10 /**
11 * This command group performs the sequence of steps to shoot at the high goal
12 *
13 * pre-conditions: a ball is in the intake
14 *
15 * post-conditions: catapult is retracted, intake is extended
16 */
17 public class ShootAtHighGoal extends CommandGroup {
18 private static final double WAIT_SECONDS = 0.4;
19 private static final double TIME_FOR_BALL_TO_CATAPULT_ROLLING = 1.0;
20
21 public ShootAtHighGoal() {
22
23 // make sure intake is in up position
24 addSequential(new MoveIntakeArm(IntakeArm.RETRACT));
25
26 addSequential(new WaitCommand(WAIT_SECONDS));
27
28 // get ball onto catapult
29 addSequential(new TimeRunIntake(TIME_FOR_BALL_TO_CATAPULT_ROLLING));
30
31 // shoot catapult pistons
32 addSequential(new FireCatapult());
33
34 addSequential(new WaitCommand(WAIT_SECONDS));
35
36 // extend intake (ball actually shoots here)
37 addSequential(new MoveIntakeArm(IntakeArm.EXTEND));
38
39 addSequential(new WaitCommand(WAIT_SECONDS));
40
41 // retract catapult pistons
42 addSequential(new ResetCatapult());
43
44 //
45 }
46 }