54e4d94fc43faa600b93655f86b15b822cdb303f
[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.Robot;
5 import org.usfirst.frc.team3501.robot.commands.intakearm.MoveIntakeArm;
6
7 import edu.wpi.first.wpilibj.command.CommandGroup;
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, and the intake is in the up position
13 *
14 * post-conditions: catapult is retracted, intake is extended
15 */
16 public class ShootAtHighGoal extends CommandGroup {
17
18 public ShootAtHighGoal() {
19 // (if photogate) check if ball is in intake
20
21 // make sure intake is in up position and change accordingly
22 if (!Robot.intakeArm.isExtended())
23 addSequential(new MoveIntakeArm(IntakeArm.RETRACT));
24
25 // shoot catapult pistons
26 addSequential(new FireCatapult());
27
28 // extend intake (ball actually shoots here)
29 addSequential(new MoveIntakeArm(IntakeArm.EXTEND));
30
31 // retract catapult pistons
32 addSequential(new ResetCatapult());
33
34 }
35 }