Commit | Line | Data |
---|---|---|
6bb7f8ac | 1 | package org.usfirst.frc.team3501.robot.commands.intakearm; |
898ac295 | 2 | |
f19a94ad LM |
3 | import org.usfirst.frc.team3501.robot.Robot; |
4 | ||
898ac295 LM |
5 | import edu.wpi.first.wpilibj.command.Command; |
6 | ||
d034d78f LM |
7 | /*** |
8 | * This command will expel a boulder from the robot, if it is even present to | |
9 | * begin with. | |
10 | * | |
a1989c11 LM |
11 | * pre-condition: Intake arm is at correct height and a boulder is present |
12 | * inside the robot. | |
d034d78f LM |
13 | * |
14 | * post-condition: A boulder is expelled from inside the robot to the field | |
15 | * outside of the robot. | |
16 | * | |
17 | * @author Lauren and Niyati | |
18 | * | |
19 | */ | |
20 | ||
898ac295 | 21 | public class ExpelBall extends Command { |
a1989c11 | 22 | private final int TIMEOUT_AMOUNT = 5; |
898ac295 LM |
23 | |
24 | public ExpelBall() { | |
df77579b | 25 | requires(Robot.intakeArm); |
898ac295 LM |
26 | } |
27 | ||
28 | @Override | |
29 | protected void initialize() { | |
a1989c11 | 30 | this.setTimeout(TIMEOUT_AMOUNT); |
c908edf8 | 31 | if (Robot.shooter.isBallInside()) |
f19a94ad | 32 | Robot.intakeArm.outputBall(); |
898ac295 LM |
33 | } |
34 | ||
35 | @Override | |
36 | protected void execute() { | |
898ac295 LM |
37 | } |
38 | ||
39 | @Override | |
40 | protected boolean isFinished() { | |
c908edf8 | 41 | return (this.isTimedOut() || !Robot.shooter.isBallInside()); |
898ac295 LM |
42 | } |
43 | ||
44 | @Override | |
45 | protected void end() { | |
1828f5f6 | 46 | Robot.intakeArm.stopRollers(); |
898ac295 LM |
47 | } |
48 | ||
49 | @Override | |
50 | protected void interrupted() { | |
51 | ||
52 | } | |
53 | ||
54 | } |