2004c1d506438e2979a3f334f1efa5da251bd908
1 package org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
;
3 import org
.usfirst
.frc
.team3501
.robot
.Constants
;
4 import org
.usfirst
.frc
.team3501
.robot
.Robot
;
5 import org
.usfirst
.frc
.team3501
.robot
.subsystems
.Shooter
;
6 import edu
.wpi
.first
.wpilibj
.Timer
;
7 import edu
.wpi
.first
.wpilibj
.command
.Command
;
10 * This command runs index wheel continuously when OI button managing index
11 * wheel is pressed. The command will run the index wheel motor until the button
12 * triggering it is released.
14 * Should only be run from the operator interface.
16 * pre-condition: This command must be run by a button in OI with
17 * button.whileHeld(...).
21 public class RunIndexWheelContinuous
extends Command
{
22 private Shooter shooter
= Robot
.getShooter();
23 private Timer t
= new Timer();
26 * See JavaDoc comment in class for details
29 * value range from -1 to 1
31 public RunIndexWheelContinuous() {
35 // Called just before this Command runs the first time
37 protected void initialize() {
41 // Called repeatedly when this Command is scheduled to run
43 protected void execute() {
46 if (Shooter
.getShooter().getPistonValue() == Constants
.Shooter
.LOW_GEAR
) {
47 Shooter
.getShooter().setHighGear();
49 Shooter
.getShooter().setLowGear();
54 if (shooter
.isShooterRPMWithinRangeOfTargetSpeed(25))
55 shooter
.runIndexWheel();
58 // Called once after isFinished returns true
60 protected void end() {
61 shooter
.stopIndexWheel();
64 // Called when another command which requires one or more of the same
65 // subsystems is scheduled to run
67 protected void interrupted() {
72 protected boolean isFinished() {