|
35 | 35 | /** Elevator Subsystem */ |
36 | 36 | public class Elevator extends SubsystemBase implements AutoCloseable { |
37 | 37 | // * CONSTANTS |
| 38 | + /** Gear ratio of the elevator gearbox */ |
38 | 39 | public static final double GEAR_REDUCTION = 3 / 1; |
39 | 40 |
|
40 | 41 | /** The radius of the sproket on the elevator's driven shaft */ |
41 | 42 | public static final Distance DRUM_RADIUS = Inches.of(1.757 / 2); |
42 | 43 |
|
| 44 | + /** The ratio of motor revs over output extension in meters */ |
43 | 45 | public static final double SENSOR_TO_MECH_RATIO = 3 / (2 * Math.PI * DRUM_RADIUS.in(Meters)); |
| 46 | + |
| 47 | + /** Combined mass lifted by elevator gearbox */ |
44 | 48 | public static final Mass LIFT_MASS = Pounds.of(6.0); // TODO calculate actual value |
45 | 49 |
|
| 50 | + /** The highest feasible extension height */ |
46 | 51 | public static final Distance MAX_EXTENSION_HEIGHT = Inches.of(24); |
| 52 | + |
| 53 | + /** The max allowable height extension error */ |
47 | 54 | public static final Distance TOLERANCE = Inches.of(1.5); |
48 | 55 |
|
| 56 | + /** The velocity limit of the elevator's trapezoid profile */ |
49 | 57 | public static final LinearVelocity MAX_VELOCITY = MetersPerSecond.of(4.5); |
| 58 | + |
| 59 | + /** The acceleration of the elevator's trapezoid profile */ |
50 | 60 | public static final LinearAcceleration MAX_ACCELERATION = MetersPerSecondPerSecond.of(10.0); |
51 | 61 |
|
52 | 62 | @Logged(name = "Elevator Hardware Loggables") |
@@ -89,6 +99,7 @@ public void periodic() { |
89 | 99 |
|
90 | 100 | filteredCurrent = currentFilter.calculate(hardware.getParentStatorCurrentAmps()); |
91 | 101 |
|
| 102 | + /** Set visualizer poses */ |
92 | 103 | stageRoot.setPosition( |
93 | 104 | (MAX_EXTENSION_HEIGHT.in(Centimeters) / 2) - 2, getStageHeight().in(Centimeters)); |
94 | 105 | carriageRoot.setPosition( |
@@ -173,7 +184,7 @@ public Command runExtension(ElevatorExtension extension) { |
173 | 184 | * Run elevator to specified extension height |
174 | 185 | * |
175 | 186 | * @param extension {@link Distance} representing desired extension height |
176 | | - * @return |
| 187 | + * @return {@link Command} |
177 | 188 | */ |
178 | 189 | public Command runExtension(Distance extension) { |
179 | 190 | return this.run(() -> hardware.setPose(extension.in(Meters))); |
|
0 commit comments