Commit | Line | Data |
---|---|---|
6bb7f8ac | 1 | package org.usfirst.frc.team3501.robot.commands.intakearm; |
898ac295 | 2 | |
2a4a0ca5 | 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 take a boulder into the robot if there is not a boulder | |
9 | * present inside already. | |
10 | * | |
a1989c11 LM |
11 | * pre-condition: Intake arm must be at correct height and a boulder is not |
12 | * present inside the robot. | |
d034d78f LM |
13 | * |
14 | * post-condition: A boulder is taken in from the field outside of the robot | |
15 | * into the robot. | |
16 | * | |
17 | * @author Lauren and Niyati | |
18 | * | |
19 | */ | |
20 | ||
898ac295 | 21 | public class IntakeBall extends Command { |
a1989c11 | 22 | private final int TIMEOUT_AMOUNT = 5; |
898ac295 LM |
23 | |
24 | public IntakeBall() { | |
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()) |
2a4a0ca5 | 32 | Robot.intakeArm.intakeBall(); |
898ac295 LM |
33 | |
34 | } | |
35 | ||
36 | @Override | |
37 | protected void execute() { | |
38 | ||
39 | } | |
40 | ||
41 | @Override | |
42 | protected boolean isFinished() { | |
c908edf8 | 43 | return (this.isTimedOut() || Robot.shooter.isBallInside()); |
898ac295 LM |
44 | } |
45 | ||
46 | @Override | |
47 | protected void end() { | |
1828f5f6 | 48 | Robot.intakeArm.stopRollers(); |
898ac295 LM |
49 | |
50 | } | |
51 | ||
52 | @Override | |
53 | protected void interrupted() { | |
54 | ||
55 | } | |
56 | ||
57 | } |