-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathClimber.java
More file actions
42 lines (33 loc) · 1.02 KB
/
Climber.java
File metadata and controls
42 lines (33 loc) · 1.02 KB
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
package frc.robot.Subsystems.Climber;
import static frc.robot.GlobalConstants.*;
import static frc.robot.Subsystems.Climber.ClimberConstants.*;
import org.littletonrobotics.junction.Logger;
import org.team7525.subsystem.Subsystem;
public class Climber extends Subsystem<ClimberStates> {
private static Climber instance;
private ClimberIO io;
private ClimberIOInputsAutoLogged inputs;
public static Climber getInstance() {
if (instance == null) {
instance = new Climber();
}
return instance;
}
private Climber() {
super("Climber", ClimberStates.IDLE);
this.io = switch (ROBOT_MODE) {
case REAL -> new ClimberIOReal();
case SIM -> new ClimberIOSim();
case TESTING -> new ClimberIOReal();
case REPLAY -> new ClimberIOSim();
};
inputs = new ClimberIOInputsAutoLogged();
}
@Override
public void runState() {
io.setSpeed(getState().getSpeed());
io.updateInputs(inputs);
Logger.processInputs(SUBSYSTEM_NAME, inputs);
Logger.recordOutput(SUBSYSTEM_NAME + "/State", getState().getStateString());
}
}