1 package org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
;
3 import org
.usfirst
.frc
.team3501
.robot
.Constants
.IntakeArm
;
4 import org
.usfirst
.frc
.team3501
.robot
.commands
.intakearm
.MoveIntakeArm
;
5 import org
.usfirst
.frc
.team3501
.robot
.commands
.intakearm
.TimeRunIntake
;
7 import edu
.wpi
.first
.wpilibj
.command
.CommandGroup
;
8 import edu
.wpi
.first
.wpilibj
.command
.WaitCommand
;
11 * This command group performs the sequence of steps to shoot at the high goal
13 * pre-conditions: a ball is in the intake
15 * post-conditions: catapult is retracted, intake is extended
17 public class ShootAtHighGoal
extends CommandGroup
{
18 private static final double WAIT_SECONDS
= 0.4;
19 private static final double TIME_FOR_BALL_TO_CATAPULT_ROLLING
= 1.0;
21 public ShootAtHighGoal() {
23 // make sure intake is in up position
24 addSequential(new MoveIntakeArm(IntakeArm
.RETRACT
));
26 addSequential(new WaitCommand(WAIT_SECONDS
));
28 // get ball onto catapult
29 addSequential(new TimeRunIntake(TIME_FOR_BALL_TO_CATAPULT_ROLLING
));
31 // shoot catapult pistons
32 addSequential(new FireCatapult());
34 addSequential(new WaitCommand(WAIT_SECONDS
));
36 // extend intake (ball actually shoots here)
37 addSequential(new MoveIntakeArm(IntakeArm
.EXTEND
));
39 addSequential(new WaitCommand(WAIT_SECONDS
));
41 // retract catapult pistons
42 addSequential(new ResetCatapult());