Change shooter to function off of two pistons, remove punch, shooter motors, and...
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / commands / shooter / Shoot.java
CommitLineData
6bb7f8ac 1package org.usfirst.frc.team3501.robot.commands.shooter;
9728080f 2
e4fbab02 3import org.usfirst.frc.team3501.robot.Constants;
24850996 4import org.usfirst.frc.team3501.robot.Robot;
376b38ae 5
071ab315
KZ
6import edu.wpi.first.wpilibj.command.CommandGroup;
7import edu.wpi.first.wpilibj.command.WaitCommand;
376b38ae 8
071ab315 9public 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}