add code that puts ball onto catapult
[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.Constants.Shooter;
5 import org.usfirst.frc.team3501.robot.commands.intakearm.MoveIntakeArm;
6 import org.usfirst.frc.team3501.robot.commands.intakearm.TimeRunIntake;
7
8 import edu.wpi.first.wpilibj.command.CommandGroup;
9 import edu.wpi.first.wpilibj.command.WaitCommand;
10
11 /**
12 * This command group performs the sequence of steps to shoot at the high goal
13 *
14 * pre-conditions: a ball is in the intake
15 *
16 * post-conditions: catapult is retracted, intake is extended
17 */
18 public class ShootAtHighGoal extends CommandGroup {
19 // TODO: test for this
20 private static final double WAIT_SECONDS = 1.0;
21
22 public ShootAtHighGoal() {
23
24 // make sure intake is in up position
25 addSequential(new MoveIntakeArm(IntakeArm.RETRACT));
26
27 addSequential(new WaitCommand(WAIT_SECONDS));
28
29 // get ball onto catapult
30 addSequential(new TimeRunIntake(Shooter.TIME_FOR_BALL_TO_CATAPULT_ROLLING));
31
32 addSequential(new WaitCommand(WAIT_SECONDS));
33
34 // shoot catapult pistons
35 addSequential(new FireCatapult());
36
37 addSequential(new WaitCommand(WAIT_SECONDS));
38
39 // extend intake (ball actually shoots here)
40 addSequential(new MoveIntakeArm(IntakeArm.EXTEND));
41
42 addSequential(new WaitCommand(WAIT_SECONDS));
43
44 // retract catapult pistons
45 addSequential(new ResetCatapult());
46
47 //
48 }
49 }