* Fix after laika repo changes

* Update laika
old-commit-hash: f7c2eefad9
taco
Gijs Koning 3 years ago committed by GitHub
parent 7d12c9261a
commit d849330ca1
  1. 2
      laika_repo
  2. 10
      selfdrive/locationd/laikad.py
  3. 4
      selfdrive/locationd/test/test_laikad.py
  4. 6
      selfdrive/locationd/test/test_ublox_processing.py

@ -1 +1 @@
Subproject commit 48a9cb686ae2d12cd830f17c166a8fb9f79ab292
Subproject commit be1a213a5ffa3cafe2b4f2d53f6df5d2452ad910

@ -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

@ -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')

@ -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)

Loading…
Cancel
Save