Skip to content

Commit

Permalink
Fix robot never changing to or from offline
Browse files Browse the repository at this point in the history
  • Loading branch information
Eddasol committed Oct 7, 2024
1 parent 6e1145e commit 0fab951
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/isar/state_machine/states/idle.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ def stop(self) -> None:

def _run(self) -> None:
while True:
start_mission: Optional[StartMissionMessage] = (
self.state_machine.should_start_mission()
)
start_mission: Optional[
StartMissionMessage
] = self.state_machine.should_start_mission()
if start_mission:
self.state_machine.start_mission(
mission=start_mission.mission,
Expand Down Expand Up @@ -82,4 +82,6 @@ def _run(self) -> None:
transition = self.state_machine.robot_turned_offline # type: ignore
break

self.robot_status_thread = None

transition()
1 change: 1 addition & 0 deletions src/isar/state_machine/states/offline.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def _run(self) -> None:
transition = self.state_machine.robot_turned_online # type: ignore
break

self.robot_status_thread = None
time.sleep(settings.ROBOT_API_STATUS_POLL_INTERVAL)

transition()

0 comments on commit 0fab951

Please sign in to comment.