code review changes
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / commands / shooter / RunFlyWheelContinuous.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 org.usfirst.frc.team3501.robot.utils.PIDController;
6
7 import edu.wpi.first.wpilibj.command.Command;
8
9 /**
10 * This command runs the fly wheel continuously at a set speed using a PID
11 * Controller when OI button managing fly wheel is pressed. The command will run
12 * the fly wheel motor until the button triggering it is released.
13 *
14 * Should only be run from the operator interface.
15 *
16 * pre-condition: This command must be run by a button in OI, with
17 * button.whileHeld(...).
18 *
19 * @author Shaina & Chris
20 */
21 public class RunFlyWheelContinuous extends Command {
22 private Shooter shooter = Robot.getShooter();
23
24 private PIDController wheelController;
25
26 public RunFlyWheelContinuous() {
27 }
28
29 @Override
30 protected void initialize() {
31 shooter.initializePIDController();
32 }
33
34 @Override
35 protected void execute() {
36 shooter.setFlyWheelMotorVal(shooter.calculateShooterSpeed());
37 }
38
39 @Override
40 protected boolean isFinished() {
41 return false;
42 }
43
44 @Override
45 protected void end() {
46 this.shooter.stopFlyWheel();
47 }
48
49 @Override
50 protected void interrupted() {
51 end();
52 }
53 }