@@ -192,12 +192,7 @@ public SystemState nextState() {
192192 AT_STATE {
193193 @ Override
194194 public SystemState nextState () {
195- // would technically already return due to mapStatesToTransition returning null,
196- // but this saves some time
197- if (curState == nextState ) {
198- return this ;
199- }
200-
195+ // mapStatesToTransition returns null if identical
201196 IDF [] idf = LiftInstructions .mapStatesToTransition (curState , nextState );
202197 if (idf != null ) {
203198 currentInstructionSet = idf ;
@@ -217,7 +212,8 @@ public void initialize() {
217212
218213 @ Override
219214 public void execute () {
220- if (s_liftinstance .armAt (STOW_ANGLE ) && s_liftinstance .elevatorAt (STOW_HEIGHT )) {
215+ if (s_liftinstance .getArmAngle ().isNear (STOW_ANGLE , ARM_TOLERANCE )
216+ && s_liftinstance .getElevatorHeight ().isNear (STOW_HEIGHT , ELEVATOR_TOLERANCE )) {
221217 isLiftReady = true ;
222218 } else {
223219 isLiftReady = false ;
@@ -483,26 +479,6 @@ public boolean elevatorAtHome() {
483479 return elevatorHomingBeamBreak ();
484480 }
485481
486- /**
487- * Return whether the elevator is at a target height or not
488- *
489- * @return Boolean of if elevator is at target height
490- */
491- public boolean elevatorAt (Distance targetHeight ) {
492- Distance currentHeight = getElevatorHeight ();
493- return (currentHeight .isNear (targetHeight , ELEVATOR_TOLERANCE ));
494- }
495-
496- /**
497- * Return whether the arm is at a target angle or not
498- *
499- * @return Boolean of if arm is at target angle
500- */
501- public boolean armAt (Angle targetAngle ) {
502- Angle currentAngle = getArmAngle ();
503- return (currentAngle .isNear (targetAngle , ARM_TOLERANCE ));
504- }
505-
506482 /**
507483 * Return whether the lift is ready to move or not
508484 * @return Boolean of if lift is at one of the 5 stages
0 commit comments