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
;
5 import org
.usfirst
.frc
.team3501
.robot
.utils
.PIDController
;
7 import edu
.wpi
.first
.wpilibj
.command
.Command
;
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.
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(...).
19 * @author Shaina & Chris
21 public class RunFlyWheel
extends Command
{
22 private Shooter shooter
= Robot
.getShooter();
25 private PIDController wheelController
;
27 public RunFlyWheel(double time
) {
32 protected void initialize() {
33 shooter
.initializePIDController();
37 protected void execute() {
38 shooter
.setFlyWheelMotorVal(shooter
.calculateShooterSpeed());
42 protected boolean isFinished() {
43 return timeSinceInitialized() >= time
;
47 protected void end() {
48 this.shooter
.stopFlyWheel();
52 protected void interrupted() {