Commit | Line | Data |
---|---|---|
79ba119a | 1 | package org.usfirst.frc.team3501.robot.subsystems; |
2 | ||
04227dc0 | 3 | import org.usfirst.frc.team3501.robot.Constants; |
4 | ||
5 | import com.ctre.CANTalon; | |
6 | ||
7 | import edu.wpi.first.wpilibj.command.Subsystem; | |
8 | ||
9 | public class Shooter extends Subsystem { | |
381dad77 | 10 | public double wheelP = 0.005, wheelI = 0.001, wheelD = -0.003; |
079a8cb6 | 11 | private static Shooter shooter; |
04227dc0 | 12 | private final CANTalon flyWheel, indexWheel; |
79ba119a | 13 | |
00f515a1 | 14 | public static final double DEFAULT_INDEXING_SPEED = 0; |
ad7e6b1e NA |
15 | public static final double DEFAULT_SHOOTING_SPEED = 0; |
16 | public static double CURRENT_SHOOTING_SPEED; | |
17 | ||
18 | public static final double SHOOTING_SPEED_INCREMENT = 0; | |
19 | ||
079a8cb6 | 20 | private Shooter() { |
04227dc0 | 21 | flyWheel = new CANTalon(Constants.Shooter.FLY_WHEEL); |
22 | indexWheel = new CANTalon(Constants.Shooter.INDEX_WHEEL); | |
ad7e6b1e | 23 | |
079a8cb6 | 24 | } |
41dfad94 | 25 | |
04227dc0 | 26 | /** |
27 | * Returns shooter object | |
28 | * | |
29 | * @return Shooter object | |
30 | */ | |
079a8cb6 CZ |
31 | public static Shooter getShooter() { |
32 | if (shooter == null) { | |
33 | shooter = new Shooter(); | |
34 | } | |
35 | return shooter; | |
36 | } | |
41dfad94 | 37 | |
079a8cb6 | 38 | /** |
04227dc0 | 39 | * Sets fly wheel motor value to input. |
40 | * | |
41 | * @param val | |
42 | * motor value from -1 to 1(fastest forward) | |
079a8cb6 | 43 | */ |
04227dc0 | 44 | public void setFlyWheelMotorVal(final double val) { |
45 | flyWheel.set(val); | |
079a8cb6 | 46 | } |
41dfad94 | 47 | |
04227dc0 | 48 | /** |
49 | * Stops fly wheel motor. | |
50 | */ | |
51 | public void stopFlyWheel() { | |
52 | flyWheel.set(0); | |
53 | } | |
41dfad94 | 54 | |
04227dc0 | 55 | /** |
56 | * Sets index wheel motor value to input. | |
57 | * | |
58 | * @param val | |
59 | * motor value from -1 to 1(fastest forward) | |
60 | */ | |
61 | public void setIndexWheelMotorVal(final double val) { | |
62 | indexWheel.set(val); | |
079a8cb6 | 63 | } |
41dfad94 | 64 | |
079a8cb6 | 65 | /** |
04227dc0 | 66 | * Stops index wheel motor. |
079a8cb6 CZ |
67 | */ |
68 | public void stopIndexWheel() { | |
04227dc0 | 69 | indexWheel.set(0); |
079a8cb6 | 70 | } |
41dfad94 | 71 | |
04227dc0 | 72 | @Override |
73 | protected void initDefaultCommand() { | |
079a8cb6 CZ |
74 | |
75 | } | |
381dad77 CZ |
76 | |
77 | public double getShooterSpeed() { | |
78 | return 1.0; | |
79 | } | |
79ba119a | 80 | } |