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