Esempio n. 1
0
 def test_kf_becomes_valid(self):
   laikad = Laikad(auto_update=False)
   m = self.logs[0]
   self.assertFalse(all(laikad.kf_valid(m.logMonoTime * 1e-9)))
   kf_valid = False
   for m in self.logs:
     laikad.process_ublox_msg(m.ubloxGnss, m.logMonoTime, block=True)
     kf_valid = all(laikad.kf_valid(m.logMonoTime * 1e-9))
     if kf_valid:
       break
   self.assertTrue(kf_valid)
Esempio n. 2
0
 def test_get_orbits_in_process(self):
   laikad = Laikad(auto_update=False)
   has_orbits = False
   for m in self.logs:
     laikad.process_ublox_msg(m.ubloxGnss, m.logMonoTime, block=False)
     if laikad.orbit_fetch_future is not None:
       laikad.orbit_fetch_future.result()
     vals = laikad.astro_dog.orbits.values()
     has_orbits = len(vals) > 0 and max([len(v) for v in vals]) > 0
     if has_orbits:
       break
   self.assertTrue(has_orbits)
   self.assertGreater(len(laikad.astro_dog.orbit_fetched_times._ranges), 0)
   self.assertEqual(None, laikad.orbit_fetch_future)
Esempio n. 3
0
def process_msgs(lr, laikad: Laikad):
    good_msgs = []
    for m in lr:
        msg = laikad.process_ublox_msg(m.ubloxGnss, m.logMonoTime)
        if msg is not None:
            good_msgs.append(msg)
    return good_msgs