Skip to content

Commit

Permalink
Changed navigation behaviour to only pause GNSS when doing the final …
Browse files Browse the repository at this point in the history
…approach to a crop.
  • Loading branch information
SeaTechRC committed Sep 11, 2024
1 parent 44a2d4f commit 14bb50f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions field_friend/automations/navigation/navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}')
Expand Down

0 comments on commit 14bb50f

Please sign in to comment.