1 package org
.usfirst
.frc
.team3501
.robot
.subsystems
;
3 import org
.usfirst
.frc
.team3501
.robot
.Constants
;
4 import org
.usfirst
.frc
.team3501
.robot
.utils
.HallEffectSensor
;
6 import com
.ctre
.CANTalon
;
8 import edu
.wpi
.first
.wpilibj
.command
.Subsystem
;
10 public class Shooter
extends Subsystem
{
11 public double wheelP
= 0, wheelI
= 0, wheelD
= -0;
12 private static Shooter shooter
;
13 private static HallEffectSensor hallEffect
;
14 private final CANTalon flyWheel1
, flyWheel2
, indexWheel
;
16 public static final double DEFAULT_INDEXING_SPEED
= -0.75;
17 public static final double DEFAULT_SHOOTING_SPEED
= 0.75;
18 public static double CURRENT_SHOOTING_SPEED
= DEFAULT_SHOOTING_SPEED
;
20 public static final double SHOOTING_SPEED_INCREMENT
= 0.05;
23 flyWheel1
= new CANTalon(Constants
.Shooter
.FLY_WHEEL1
);
24 flyWheel2
= new CANTalon(Constants
.Shooter
.FLY_WHEEL2
);
25 indexWheel
= new CANTalon(Constants
.Shooter
.INDEX_WHEEL
);
27 hallEffect
= new HallEffectSensor(Constants
.Shooter
.HALL_EFFECT_PORT
, 1);
30 public static HallEffectSensor
getHallEffectSensor() {
35 * Returns shooter object
37 * @return Shooter object
39 public static Shooter
getShooter() {
40 if (shooter
== null) {
41 shooter
= new Shooter();
47 * Sets fly wheel motor value to input.
50 * motor value from -1 to 1(fastest forward)
52 public void setFlyWheelMotorVal(final double val
) {
58 * Stops fly wheel motor.
60 public void stopFlyWheel() {
66 * Sets index wheel motor value to input.
69 * motor value from -1 to 1(fastest forward)
71 public void setIndexWheelMotorVal(final double val
) {
76 * Stops index wheel motor.
78 public void stopIndexWheel() {
83 protected void initDefaultCommand() {
87 public double getShooterRPM() {
88 return hallEffect
.getRPM();