-
Notifications
You must be signed in to change notification settings - Fork 35
/
StingerRoller.java
45 lines (35 loc) · 1.09 KB
/
StingerRoller.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package com.team254.frc2019.subsystems;
import com.ctre.phoenix.motorcontrol.ControlMode;
import com.ctre.phoenix.motorcontrol.can.TalonSRX;
import com.team254.frc2019.Constants;
import com.team254.lib.drivers.TalonSRXFactory;
/**
* Controls the stinger roller for the robot's climbing mechanism at SFR and SVR
*/
public class StingerRoller extends Subsystem {
private static StingerRoller mInstance;
public synchronized static StingerRoller getInstance() {
if (mInstance == null) {
mInstance = new StingerRoller();
}
return mInstance;
}
TalonSRX mMaster;
private StingerRoller() {
mMaster = TalonSRXFactory.createDefaultTalon(Constants.kStingerMasterId);
mMaster.overrideSoftLimitsEnable(false);
}
public synchronized void setOpenLoop(double output) {
mMaster.set(ControlMode.PercentOutput, output);
}
@Override
public synchronized void stop() {
setOpenLoop(0.0);
}
@Override
public boolean checkSystem() {
return true;
}
@Override
public void outputTelemetry() {}
}