c90a08017d5bf010855c45de20aa0f3ced0989a9
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / commands / IntakeBall.java
1 package org.usfirst.frc.team3501.robot.commands;
2
3 import org.usfirst.frc.team3501.robot.Robot;
4
5 import edu.wpi.first.wpilibj.command.Command;
6
7 /***
8 * This command will take a boulder into the robot if there is not a boulder
9 * present inside already.
10 *
11 * pre-condition: A boulder is not present inside the robot.
12 *
13 * post-condition: A boulder is taken in from the field outside of the robot
14 * into the robot.
15 *
16 * @author Lauren and Niyati
17 *
18 */
19
20 public class IntakeBall extends Command {
21
22 public IntakeBall() {
23 requires(Robot.intakeArm);
24 }
25
26 @Override
27 protected void initialize() {
28 if (!Robot.photogate.isBallPresent())
29 Robot.intakeArm.intakeBall();
30
31 }
32
33 @Override
34 protected void execute() {
35
36 }
37
38 @Override
39 protected boolean isFinished() {
40 return Robot.photogate.isBallPresent();
41 }
42
43 @Override
44 protected void end() {
45 Robot.intakeArm.stopRollers();
46
47 }
48
49 @Override
50 protected void interrupted() {
51
52 }
53
54 }