:mod:`gnss` =========== .. py:module:: gnss .. autoapi-nested-parse:: Global Navigation Satellite System The `gnss` module contains classes to control the GNSS and acquire positioning information. .. py:class:: GNSS(system: Union[SatelliteSystem, List[SatelliteSystem]]) Get updated positioning information from Global Navigation Satellite System (GNSS) Usage:: import gnss import time nav = gnss.GNSS([gnss.SatelliteSystem.GPS, gnss.SatelliteSystem.GLONASS]) last_print = time.monotonic() while True: nav.update() current = time.monotonic() if current - last_print >= 1.0: last_print = current if nav.fix is gnss.PositionFix.INVALID: print("Waiting for fix...") continue print("Latitude: {0:.6f} degrees".format(nav.latitude)) print("Longitude: {0:.6f} degrees".format(nav.longitude)) Turn on the GNSS. :param system: satellite system to use .. attribute:: latitude :annotation: :float Latitude of current position in degrees (float). .. attribute:: longitude :annotation: :float Longitude of current position in degrees (float). .. attribute:: altitude :annotation: :float Altitude of current position in meters (float). .. attribute:: timestamp :annotation: :time.struct_time Time when the position data was updated. .. attribute:: fix :annotation: :PositionFix Fix mode. .. method:: deinit(self) -> None Turn off the GNSS. .. method:: update(self) -> None Update GNSS positioning information. .. py:class:: PositionFix Position fix mode Enum-like class to define the position fix mode. .. attribute:: INVALID :annotation: :PositionFix No measurement. .. attribute:: FIX_2D :annotation: :PositionFix 2D fix. .. attribute:: FIX_3D :annotation: :PositionFix 3D fix. .. py:class:: SatelliteSystem Satellite system type Enum-like class to define the satellite system type. .. attribute:: GPS :annotation: :SatelliteSystem Global Positioning System. .. attribute:: GLONASS :annotation: :SatelliteSystem GLObal NAvigation Satellite System. .. attribute:: SBAS :annotation: :SatelliteSystem Satellite Based Augmentation System. .. attribute:: QZSS_L1CA :annotation: :SatelliteSystem Quasi-Zenith Satellite System L1C/A. .. attribute:: QZSS_L1S :annotation: :SatelliteSystem Quasi-Zenith Satellite System L1S.