Skip to content

Commit

Permalink
fix bug in sync gps action
Browse files Browse the repository at this point in the history
  • Loading branch information
jhazentia committed Apr 24, 2024
1 parent a58f0eb commit a050817
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scos_actions/actions/sync_gps.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ def __init__(self, parameters: dict):
def __call__(self, sensor: Sensor, schedule_entry: dict, task_id: int):
logger.debug("Syncing to GPS")
self.sensor = sensor
dt = self.sensor.gps.get_gps_time(self.sensor.signal_analyzer)
dt = self.sensor.gps.get_gps_time(self.sensor)
date_cmd = ["date", "-s", "{:}".format(dt.strftime("%Y/%m/%d %H:%M:%S"))]
subprocess.check_output(date_cmd, shell=True)
logger.info(f"Set system time to GPS time {dt.ctime()}")

location = sensor.gps.get_location(self.sensor.signal_analyzer)
location = sensor.gps.get_location(self.sensor)
if location is None:
raise RuntimeError("Unable to synchronize to GPS")

Expand Down

0 comments on commit a050817

Please sign in to comment.