6d15cde8362194c3ca7ef19763a6a3f49929a827
[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
6 import edu.wpi.first.wpilibj.command.CommandGroup;
7 import edu.wpi.first.wpilibj.command.WaitCommand;
8
9 /**
10 * This command group performs the sequence of steps to shoot at the high goal
11 *
12 * pre-conditions: a ball is in the intake
13 *
14 * post-conditions: catapult is retracted, intake is extended
15 */
16 public class ShootAtHighGoal extends CommandGroup {
17 private static final double WAIT_SECONDS = 0.4;
18
19 public ShootAtHighGoal() {
20 // make sure catapult is down
21 addSequential(new ResetCatapult());
22
23 // make sure intake is in up position
24 addSequential(new MoveIntakeArm(IntakeArm.RETRACT));
25
26 // shoot catapult pistons
27 addSequential(new FireCatapult());
28
29 // extend intake (ball actually shoots here)
30 addSequential(new MoveIntakeArm(IntakeArm.EXTEND));
31
32 // wait a bit
33 addSequential(new WaitCommand(WAIT_SECONDS));
34
35 // retract catapult pistons
36 addSequential(new ResetCatapult());
37
38 }
39 }