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