2525import edu .wpi .first .wpilibj2 .command .SubsystemBase ;
2626import java .util .function .DoubleSupplier ;
2727import org .frc6423 .robot .Robot ;
28- import org .frc6423 .robot .subsystems .superstructure .Visualizer ;
2928
3029/** Elevator Subsystem */
3130public class Elevator extends SubsystemBase implements AutoCloseable {
@@ -64,11 +63,16 @@ public class Elevator extends SubsystemBase implements AutoCloseable {
6463
6564 /** Represents a height the elevator can extend to */
6665 public static enum ElevatorExtension {
67- STOWED (Meters .of (0.0 )),
68- INTAKING (Meters .of (0.0 )),
69- L2 (Meters .of (4.549 )),
70- L3 (Meters .of (12.41 )),
71- L4 (Meters .of (24.0 ));
66+ /** Extension height for resting */
67+ STOWED (Inches .of (0.0 )),
68+ /** Extension height for intaking coral */
69+ INTAKING (Inches .of (9.963 )),
70+ /** Extension height for scoring on Level 2 */
71+ L2 (Inches .of (4.549 )),
72+ /** Extension height for scoring on Level 3 */
73+ L3 (Inches .of (12.41 )),
74+ /** Extension height for scoring on Level 4 */
75+ L4 (Inches .of (24.0 ));
7276
7377 Distance height ;
7478
@@ -87,17 +91,11 @@ public static enum ElevatorExtension {
8791
8892 private boolean isZeroed = false ;
8993
90- private final Visualizer visualizer = Visualizer .getInstance ();
91-
9294 /**
9395 * @return fake {@link Elevator} subsystem
9496 */
9597 public static Elevator none () {
96- if (Robot .isReal ()) {
97- return new Elevator (new ElevatorIOReal ());
98- } else {
99- return new Elevator (new ElevatorIOSim ());
100- }
98+ return new Elevator (new ElevatorIONone ());
10199 }
102100
103101 /**
@@ -142,33 +140,33 @@ public boolean isNearSetpointPose() {
142140 }
143141
144142 /**
145- * @return {@link Distance} representing carriage height
143+ * @return {@link Distance} representing stage height
146144 */
147- public Distance getCarriageHeight () {
148- return Meters .of (hardware .getParentPoseMeters ()). times ( 2 ) ;
145+ public Distance getStageHeight () {
146+ return Meters .of (hardware .getParentPoseMeters ());
149147 }
150148
151149 /**
152- * @return {@link Pose3d} representing the pose of the carriage
150+ * @return {@link Pose3d} representing the pose of the first stage
153151 */
154- @ Logged (name = "Carriage (Pose3d)" )
155- public Pose3d getCarriagePose3d () {
156- return new Pose3d (Meters .of (0.0 ), Meters .of (0.0 ), getStageHeight (). times ( 2 ) , Rotation3d .kZero );
152+ @ Logged (name = "Stage (Pose3d)" )
153+ public Pose3d getFirstPose3d () {
154+ return new Pose3d (Meters .of (0.0 ), Meters .of (0.0 ), getStageHeight (), Rotation3d .kZero );
157155 }
158156
159157 /**
160- * @return {@link Distance} representing stage height
158+ * @return {@link Distance} representing carriage height
161159 */
162- public Distance getStageHeight () {
163- return Meters . of ( hardware . getParentPoseMeters () );
160+ public Distance getCarriageHeight () {
161+ return getStageHeight (). times ( 2 );
164162 }
165163
166164 /**
167- * @return {@link Pose3d} representing the pose of the first stage
165+ * @return {@link Pose3d} representing the pose of the carriage
168166 */
169- @ Logged (name = "Stage (Pose3d)" )
170- public Pose3d getFirstPose3d () {
171- return new Pose3d (Meters .of (0.0 ), Meters .of (0.0 ), getStageHeight (), Rotation3d .kZero );
167+ @ Logged (name = "Carriage (Pose3d)" )
168+ public Pose3d getCarriagePose3d () {
169+ return new Pose3d (Meters .of (0.0 ), Meters .of (0.0 ), getCarriageHeight (), Rotation3d .kZero );
172170 }
173171
174172 /**
0 commit comments