1 package org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
;
3 import org
.usfirst
.frc
.team3501
.robot
.Robot
;
4 import org
.usfirst
.frc
.team3501
.robot
.subsystems
.Shooter
;
6 import edu
.wpi
.first
.wpilibj
.command
.Command
;
9 * This command runs index wheel continuously when OI button managing index
10 * wheel is pressed. The command will run the index wheel motor until the button
11 * triggering it is released.
13 * Should only be run from the operator interface.
15 * pre-condition: This command must be run by a button in OI with
16 * button.whileHeld(...).
20 public class RunIndexWheelContinuous
extends Command
{
21 private Shooter shooter
= Robot
.getShooter();
22 // private Timer t = new Timer();
25 * See JavaDoc comment in class for details
28 * value range from -1 to 1
30 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() {
45 * if (t.get() >= 4) { if (Shooter.getShooter().getPistonValue() ==
46 * Constants.Shooter.LOW_GEAR) { Shooter.getShooter().setHighGear(); } else
47 * { Shooter.getShooter().setLowGear(); } }
50 double shooterSpeed
= shooter
.getShooterRPM();
52 shooter
.runIndexWheel();
55 // Called once after isFinished returns true
57 protected void end() {
58 shooter
.stopIndexWheel();
61 // Called when another command which requires one or more of the same
62 // subsystems is scheduled to run
64 protected void interrupted() {
69 protected boolean isFinished() {