How to use the ephemeris.EphemerisData function in ephemeris

To help you get started, we’ve selected a few ephemeris examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github commaai / openpilot / selfdrive / locationd / ubloxd.py View on Github external
gnssId = msg_meta_data['gnssId']
  if gnssId  == 0:
    svId =  msg_meta_data['svid']
    subframeId =  GET_FIELD_U(measurements[1]['dwrd'], 3, 8)
    words = []
    for m in measurements:
      words.append(m['dwrd'])

    # parse from
    if subframeId == 1:
      nav_frame_buffer[gnssId][svId] = {}
      nav_frame_buffer[gnssId][svId][subframeId] = words
    elif subframeId-1 in nav_frame_buffer[gnssId][svId]:
      nav_frame_buffer[gnssId][svId][subframeId] = words
    if len(nav_frame_buffer[gnssId][svId]) == 5:
      ephem_data = EphemerisData(svId, nav_frame_buffer[gnssId][svId])
      return gen_ephemeris(ephem_data)
github tridge / pyUblox / ublox_capture_raw.py View on Github external
if opts.show:
        try:
            print(str(msg))
            sys.stdout.flush()
        except ublox.UBloxError as e:
            print(e)
    elif opts.dots:
        sys.stdout.write('.')
        sys.stdout.flush()
    if msg.name() == 'RXM_RAW':
        msg.unpack()
        handle_rxm_raw(msg)
    if msg.name() == 'AID_EPH':
        try:
            msg.unpack()
            svid_ephemeris[msg.svid] = ephemeris.EphemerisData(msg)
        except ublox.UBloxError as e:
            print(e)
github tridge / pyUblox / satelliteData.py View on Github external
def add_AID_EPH(self, msg):
        '''add some AID_EPH ephemeris data'''
        eph = ephemeris.EphemerisData(msg)
        if eph.valid:
            if eph.svid in self.ephemeris:
                old_eph = self.ephemeris[eph.svid]
            else:
                old_eph = None
            self.ephemeris[eph.svid] = eph
            if old_eph is None or old_eph != eph:
                self.smooth.reset(eph.svid)
                util.saveObject('ephemeris.dat', self.ephemeris)