Skip to content

Commit

Permalink
fixing open reference dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasBaecker committed Sep 6, 2024
1 parent 09cab04 commit 9f181f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion field_friend/automations/navigation/navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async def start(self) -> None:
await self.gnss.update_robot_pose()
if self.gnss.current.location.distance(localization.reference) > 2000.0:
self.gnss.reference_alert_dialog.open()
return
raise WorkflowException('reference to far away from robot')
self.start_position = self.odometer.prediction.point
if isinstance(self.driver.wheels, rosys.hardware.WheelsSimulation) and not rosys.is_test:
self.create_simulation()
Expand All @@ -69,6 +69,7 @@ async def start(self) -> None:
except WorkflowException as e:
self.kpi_provider.increment_weeding_kpi('automation_stopped')
self.log.error(f'WorkflowException: {e}')
rosys.notify(f'An exception occurred during automation: {e}', 'negative')
finally:
self.kpi_provider.increment_weeding_kpi('weeding_completed')
await self.implement.finish()
Expand Down
4 changes: 3 additions & 1 deletion field_friend/localization/gnss.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
from copy import deepcopy
from dataclasses import dataclass
from typing import Any, Optional
from nicegui import ui

import numpy as np
import rosys
from nicegui import ui

from .. import localization
from .geo_point import GeoPoint
Expand Down Expand Up @@ -62,6 +63,7 @@ def __init__(self, odometer: rosys.driving.Odometer, antenna_offset: float) -> N
self.needs_backup = False
rosys.on_repeat(self.check_gnss, 0.01)
rosys.on_repeat(self.try_connection, 3.0)
self.reference_alert_dialog = None

@abstractmethod
async def try_connection(self) -> None:
Expand Down

0 comments on commit 9f181f3

Please sign in to comment.