Skip to content

Commit

Permalink
Renamed GNSS.pause() to paused() to better convey temporary state wit…
Browse files Browse the repository at this point in the history
…h contextmanager.

Removed comment for self explaining action.
  • Loading branch information
SeaTechRC committed Sep 11, 2024
1 parent 555555b commit 44a2d4f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion field_friend/automations/navigation/navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ async def start(self) -> None:
await self._drive(self.DEFAULT_DRIVE_DISTANCE)
else:
await self._drive(distance)
with self.gnss.pause(): # Pause GNSS for better local accuracy
with self.gnss.paused(): # Pause GNSS for better local accuracy
await self.implement.start_workflow()
await self.implement.stop_workflow()
except WorkflowException as e:
Expand Down
3 changes: 1 addition & 2 deletions field_friend/localization/gnss.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ async def check_gnss(self) -> None:
self.current = None

@contextlib.contextmanager
def pause(self):
def paused(self):
try:
self._is_paused = True
yield
Expand Down Expand Up @@ -129,7 +129,6 @@ def _on_rtk_fix(self) -> None:
if len(self.observed_poses) > self.needed_poses: # Ensure fresh data
self.observed_poses.pop(0)

# Only update if unpaused
if not self._is_paused:
self._update_robot_pose()

Expand Down

0 comments on commit 44a2d4f

Please sign in to comment.