1 package org
.usfirst
.frc
.team3501
.robot
.commands
.intakearm
;
3 import org
.usfirst
.frc
.team3501
.robot
.Robot
;
5 import edu
.wpi
.first
.wpilibj
.command
.Command
;
8 * This command will take a boulder into the robot if there is not a boulder
9 * present inside already.
11 * pre-condition: Intake arm must be at correct height and a boulder is not
12 * present inside the robot.
14 * post-condition: A boulder is taken in from the field outside of the robot
17 * @author Lauren and Niyati
21 public class IntakeBall
extends Command
{
22 private final int TIMEOUT_AMOUNT
= 5;
25 requires(Robot
.intakeArm
);
29 protected void initialize() {
30 this.setTimeout(TIMEOUT_AMOUNT
);
31 if (!Robot
.photogate
.isBallPresent())
32 Robot
.intakeArm
.intakeBall();
37 protected void execute() {
42 protected boolean isFinished() {
43 return (this.isTimedOut() || Robot
.photogate
.isBallPresent());
47 protected void end() {
48 Robot
.intakeArm
.stopRollers();
53 protected void interrupted() {