From 14bb50ff05120f1edcf0ecc8e383334c74650d0b Mon Sep 17 00:00:00 2001 From: SeaTechRC Date: Tue, 10 Sep 2024 15:23:59 +0200 Subject: [PATCH] Changed navigation behaviour to only pause GNSS when doing the final approach to a crop. --- field_friend/automations/navigation/navigation.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/field_friend/automations/navigation/navigation.py b/field_friend/automations/navigation/navigation.py index 2897157b..65ac0c4a 100644 --- a/field_friend/automations/navigation/navigation.py +++ b/field_friend/automations/navigation/navigation.py @@ -51,13 +51,13 @@ async def start(self) -> None: self.log.info('Navigation started') while not self._should_finish(): distance = await self.implement.get_stretch(self.MAX_STRETCH_DISTANCE) - if distance > self.MAX_STRETCH_DISTANCE: # we do not want to drive to long without observing + if distance > self.MAX_STRETCH_DISTANCE: # No crop in sight await self._drive(self.DEFAULT_DRIVE_DISTANCE) - else: - await self._drive(distance) + else: # Crop in sight with self.gnss.paused(): # Pause GNSS for better local accuracy - await self.implement.start_workflow() - await self.implement.stop_workflow() + await self._drive(distance) + await self.implement.start_workflow() + await self.implement.stop_workflow() except WorkflowException as e: self.kpi_provider.increment_weeding_kpi('automation_stopped') self.log.error(f'WorkflowException: {e}')