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 flyWheel
, indexWheel
;
16 public static final double DEFAULT_INDEXING_SPEED
= 0;
17 public static final double DEFAULT_SHOOTING_SPEED
= 0;
18 public static double CURRENT_SHOOTING_SPEED
= DEFAULT_SHOOTING_SPEED
;
20 public static final double SHOOTING_SPEED_INCREMENT
= 0;
23 flyWheel
= new CANTalon(Constants
.Shooter
.FLY_WHEEL
);
24 indexWheel
= new CANTalon(Constants
.Shooter
.INDEX_WHEEL
);
26 hallEffect
= new HallEffectSensor(Constants
.Shooter
.HALL_EFFECT_PORT
, 1);
29 public static HallEffectSensor
getHallEffectSensor() {
34 * Returns shooter object
36 * @return Shooter object
38 public static Shooter
getShooter() {
39 if (shooter
== null) {
40 shooter
= new Shooter();
46 * Sets fly wheel motor value to input.
49 * motor value from -1 to 1(fastest forward)
51 public void setFlyWheelMotorVal(final double val
) {
56 * Stops fly wheel motor.
58 public void stopFlyWheel() {
63 * Sets index wheel motor value to input.
66 * motor value from -1 to 1(fastest forward)
68 public void setIndexWheelMotorVal(final double val
) {
73 * Stops index wheel motor.
75 public void stopIndexWheel() {
80 protected void initDefaultCommand() {
84 public double getShooterRPM() {
85 return hallEffect
.getRPM();