File tree Expand file tree Collapse file tree
src/main/java/frc/robot/subsystems/elevator Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010
1111
1212public class Elevator extends SubsystemBase {
13- private final ElevatorIOInputsAutoLogged inputs = new ElevatorIOInputsAutoLogged ();
13+
14+
15+ private final ElevatorIO io ;
16+ private final ElevatorIOInputsAutoLogged inputs = new ElevatorIOInputsAutoLogged ();
1417
1518
1619
17- private final ElevatorIO io ;
20+ public Elevator (ElevatorIO io ) {
21+ this .io = io ;
22+ }
23+
1824
1925@ Override
2026public void periodic () {
21- ElevatorIO .updateInputs (ElevatorInputs );
27+ io .updateInputs (ElevatorInputs );
2228}
2329
2430public Command runVoltageCommand (Supplier <Voltage > voltage ) {
25- return run (() -> ElevatorIO .setVoltage (voltage .get ())).withName ("Voltage" );
31+ return run (() -> io .setVoltage (voltage .get ())).withName ("Voltage" );
2632 }
2733
2834 public Command runRPMCommand (Supplier <AngularVelocity > rpm ) {
29- return run (() -> ElevatorIO .setRPM (rpm .get ())).withName ("RPM" );
35+ return run (() -> io .setRPM (rpm .get ())).withName ("RPM" );
3036 }
3137
3238
Original file line number Diff line number Diff line change @@ -26,30 +26,29 @@ public static class ElevatorIOInputs {
2626
2727 default void updateInputs (ElevatorIOInputs inputs ) {}
2828
29- default void setVoltage (double voltage ) {}
3029 // Getter method for target height
31- default void getSetpoint () {
30+ default double getSetpoint () {
3231 return 0.0 ;
3332 }
3433
3534 // Getter method for current position
36- default void getPosition () {
35+ default double getPosition () {
3736 return 0.0 ;
3837 }
3938
40- default void updateInputs (ElevatorIOInputs inputs ) {}
4139 // Getter method for velocity
42- default void getVelocity (){
40+ default double getVelocity (){
4341 return 0.0 ;
4442 }
4543
4644 default void setRPM (double rpm ){}
45+
4746 // Checking if elevator goes above limit height
4847 default boolean isLimitSwitchPressed () {
4948 return false ;
5049 }
5150
52- default void setFeedForwardGains ( double kS , double kV , double kA ) {}
51+
5352
5453 // Subsystem API (Used by commands)
5554
You can’t perform that action at this time.
0 commit comments