Skip to content

Commit f75a906

Browse files
committed
move is_ready_to_climb check to state machine
1 parent 13ca455 commit f75a906

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

controllers/climber.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def deploy_without_localization(self) -> None:
3434
self.deploy(localize=False)
3535

3636
def retract(self) -> None:
37-
if self.has_deployed:
37+
if self.has_deployed and self.is_ready_to_climb():
3838
self.engage("retracting", force=True)
3939

4040
@state(first=True, must_finish=True)

robot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def teleopPeriodic(self) -> None:
245245

246246
if self.gamepad.getYButton():
247247
self.climber_state_machine.deploy()
248-
if self.gamepad.getAButton() and self.climber_state_machine.is_ready_to_climb():
248+
if self.gamepad.getAButton():
249249
self.climber_state_machine.retract()
250250

251251
if self.gamepad.getBButton():

0 commit comments

Comments
 (0)