Bump laika (#24454)

* Fix after laika repo changes

* Update laika
This commit is contained in:
Gijs Koning
2022-05-09 04:05:08 -07:00
committed by GitHub
parent ce0cc1f228
commit f7c2eefad9
4 changed files with 9 additions and 13 deletions

View File

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

View File

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

View File

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