Commit | Line | Data |
---|---|---|
6bb7f8ac | 1 | package org.usfirst.frc.team3501.robot.commands.shooter; |
9728080f | 2 | |
e4fbab02 | 3 | import org.usfirst.frc.team3501.robot.Constants; |
24850996 | 4 | import org.usfirst.frc.team3501.robot.Robot; |
376b38ae | 5 | |
071ab315 KZ |
6 | import edu.wpi.first.wpilibj.command.CommandGroup; |
7 | import edu.wpi.first.wpilibj.command.WaitCommand; | |
376b38ae | 8 | |
071ab315 | 9 | public class Shoot extends CommandGroup { |
376b38ae | 10 | |
24850996 | 11 | public boolean usePhotogate; |
12 | ||
e4fbab02 HD |
13 | /** |
14 | * Fires catapult, then resets after a pause. If robot is set to use photogate | |
15 | * and no ball is detected, nothing happens. | |
16 | * | |
17 | * Precondition: catapult is in reset position, and ball is loaded in | |
18 | * catapult. | |
19 | */ | |
071ab315 | 20 | public Shoot() { |
24850996 | 21 | if (Robot.shooter.usePhotogate()) { |
22 | if (Robot.shooter.isBallInside()) { | |
e4fbab02 HD |
23 | addSequential(new FireCatapult()); |
24 | addSequential(new WaitCommand(Constants.Shooter.WAIT_TIME)); | |
25 | addSequential(new ResetCatapult()); | |
24850996 | 26 | } |
27 | } else { | |
e4fbab02 HD |
28 | addSequential(new FireCatapult()); |
29 | addSequential(new WaitCommand(Constants.Shooter.WAIT_TIME)); | |
30 | addSequential(new ResetCatapult()); | |
24850996 | 31 | } |
071ab315 | 32 | } |
376b38ae | 33 | } |