diff --git a/laika_repo b/laika_repo index 48a9cb686a..be1a213a5f 160000 --- a/laika_repo +++ b/laika_repo @@ -1 +1 @@ -Subproject commit 48a9cb686ae2d12cd830f17c166a8fb9f79ab292 +Subproject commit be1a213a5ffa3cafe2b4f2d53f6df5d2452ad910 diff --git a/selfdrive/locationd/laikad.py b/selfdrive/locationd/laikad.py index 28150bfea9..4695fd945b 100755 --- a/selfdrive/locationd/laikad.py +++ b/selfdrive/locationd/laikad.py @@ -3,7 +3,7 @@ from typing import List from cereal import log, messaging from laika import AstroDog -from laika.helpers import UbloxGnssId +from laika.helpers import ConstellationId from laika.raw_gnss import GNSSMeasurement, calc_pos_fix, correct_measurements, process_measurements, read_raw_ublox @@ -46,13 +46,9 @@ def process_ublox_msg(ublox_msg, dog, ublox_mono_time: int): def create_measurement_msg(meas: GNSSMeasurement): c = log.GnssMeasurements.CorrectedMeasurement.new_message() - ublox_gnss_id = meas.ublox_gnss_id - if ublox_gnss_id is None: - # todo never happens will fix in later pr - ublox_gnss_id = UbloxGnssId.GPS - c.constellationId = ublox_gnss_id.value + c.constellationId = meas.constellation_id.value c.svId = int(meas.prn[1:]) - c.glonassFrequency = meas.glonass_freq if meas.ublox_gnss_id == UbloxGnssId.GLONASS else 0 + c.glonassFrequency = meas.glonass_freq if meas.constellation_id == ConstellationId.GLONASS else 0 c.pseudorange = float(meas.observables['C1C']) # todo should be observables_final when using corrected measurements c.pseudorangeStd = float(meas.observables_std['C1C']) c.pseudorangeRate = float(meas.observables['D1C']) # todo should be observables_final when using corrected measurements diff --git a/selfdrive/locationd/test/test_laikad.py b/selfdrive/locationd/test/test_laikad.py index 877623f0bd..fdbb46f5aa 100755 --- a/selfdrive/locationd/test/test_laikad.py +++ b/selfdrive/locationd/test/test_laikad.py @@ -2,7 +2,7 @@ import unittest from datetime import datetime -from laika.helpers import UbloxGnssId +from laika.helpers import ConstellationId from laika.gps_time import GPSTime from laika.raw_gnss import GNSSMeasurement @@ -13,7 +13,7 @@ class TestLaikad(unittest.TestCase): def test_create_msg_without_errors(self): gpstime = GPSTime.from_datetime(datetime.now()) - meas = GNSSMeasurement('G01', gpstime.week, gpstime.tow, {'C1C': 0., 'D1C': 0.}, {'C1C': 0., 'D1C': 0.}, ublox_gnss_id=UbloxGnssId.GPS) + meas = GNSSMeasurement(ConstellationId.GPS, 1, gpstime.week, gpstime.tow, {'C1C': 0., 'D1C': 0.}, {'C1C': 0., 'D1C': 0.}) msg = create_measurement_msg(meas) self.assertEqual(msg.constellationId, 'gps') diff --git a/selfdrive/locationd/test/test_ublox_processing.py b/selfdrive/locationd/test/test_ublox_processing.py index 94fddb9392..427003b24c 100755 --- a/selfdrive/locationd/test/test_ublox_processing.py +++ b/selfdrive/locationd/test/test_ublox_processing.py @@ -3,7 +3,7 @@ import unittest import numpy as np from laika import AstroDog -from laika.helpers import UbloxGnssId +from laika.helpers import ConstellationId from laika.raw_gnss import calc_pos_fix, correct_measurements, process_measurements, read_raw_ublox from selfdrive.test.openpilotci import get_url from tools.lib.logreader import LogReader @@ -34,9 +34,9 @@ class TestUbloxProcessing(unittest.TestCase): count_glonass = 0 for measurements in self.gnss_measurements: for m in measurements: - if m.ublox_gnss_id == UbloxGnssId.GPS: + if m.constellation_id == ConstellationId.GPS: count_gps += 1 - elif m.ublox_gnss_id == UbloxGnssId.GLONASS: + elif m.constellation_id == ConstellationId.GLONASS: count_glonass += 1 self.assertEqual(count_gps, 5036)