Skip to content

Commit

Permalink
fix reference parameter handling
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalzauberzeug committed Dec 4, 2024
1 parent e46debd commit 8c3b6b1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions field_friend/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,12 @@ async def setup_simulated_usb_camera(self):
self.camera_provider.add_camera(camera)

def update_gnss_reference(self, *, reference: GeoReference | None = None) -> None:
if self.gnss.last_measurement is None:
self.log.warning('Not updating GNSS reference: No GNSS measurement received')
return
reference = GeoReference(origin=self.gnss.last_measurement.point,
direction=self.gnss.last_measurement.heading) if reference is None else reference
if reference is None:
if self.gnss.last_measurement is None:
self.log.warning('Not updating GNSS reference: No GNSS measurement received')
return
reference = GeoReference(origin=self.gnss.last_measurement.point,
direction=self.gnss.last_measurement.heading) if reference is None else reference
self.log.debug('Updating GNSS reference to %s', reference)
GeoReference.update_current(reference)
self.request_backup()
Expand Down

0 comments on commit 8c3b6b1

Please sign in to comment.