Fix code changes
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / commands / shooter / RunIndexWheelContinuous.java
1 package org.usfirst.frc.team3501.robot.commands.shooter;
2
3 import org.usfirst.frc.team3501.robot.Robot;
4 import org.usfirst.frc.team3501.robot.subsystems.Shooter;
5 import edu.wpi.first.wpilibj.Timer;
6 import edu.wpi.first.wpilibj.command.Command;
7
8 /**
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.
12 *
13 * Should only be run from the operator interface.
14 *
15 * pre-condition: This command must be run by a button in OI with
16 * button.whileHeld(...).
17 *
18 * @author Shaina
19 */
20 public class RunIndexWheelContinuous extends Command {
21 private Shooter shooter = Robot.getShooter();
22 private Timer t = new Timer();
23
24 /**
25 * See JavaDoc comment in class for details
26 */
27 public RunIndexWheelContinuous() {
28 requires(shooter);
29 }
30
31 @Override
32 protected void initialize() {
33 t.start();
34 }
35
36 @Override
37 protected void execute() {
38 /*
39 * if (t.get() >= 1) { if (Shooter.getShooter().getPistonValue() ==
40 * Constants.Shooter.LOW_GEAR) { Shooter.getShooter().setHighGear(); } else
41 * { Shooter.getShooter().setLowGear(); } t.reset(); }
42 */
43
44 // if (shooter.isShooterRPMWithinRangeOfTargetSpeed(25))
45 if (shooter.getShooterRPM() > 0)
46 shooter.runIndexWheel();
47
48 }
49
50 @Override
51 protected void end() {
52 shooter.stopIndexWheel();
53 }
54
55 @Override
56 protected void interrupted() {
57 end();
58 }
59
60 @Override
61 protected boolean isFinished() {
62 return false;
63 }
64
65 }