: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. .. raw:: html

Available on these boards

.. 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 .. py:attribute:: latitude :annotation: :float Latitude of current position in degrees (float). .. py:attribute:: longitude :annotation: :float Longitude of current position in degrees (float). .. py:attribute:: altitude :annotation: :float Altitude of current position in meters (float). .. py:attribute:: timestamp :annotation: :time.struct_time Time when the position data was updated. .. py:attribute:: fix :annotation: :PositionFix Fix mode. .. py:method:: deinit() -> None Turn off the GNSS. .. py:method:: update() -> None Update GNSS positioning information. .. py:class:: PositionFix Position fix mode Enum-like class to define the position fix mode. .. py:attribute:: INVALID :annotation: :PositionFix No measurement. .. py:attribute:: FIX_2D :annotation: :PositionFix 2D fix. .. py:attribute:: FIX_3D :annotation: :PositionFix 3D fix. .. py:class:: SatelliteSystem Satellite system type Enum-like class to define the satellite system type. .. py:attribute:: GPS :annotation: :SatelliteSystem Global Positioning System. .. py:attribute:: GLONASS :annotation: :SatelliteSystem GLObal NAvigation Satellite System. .. py:attribute:: SBAS :annotation: :SatelliteSystem Satellite Based Augmentation System. .. py:attribute:: QZSS_L1CA :annotation: :SatelliteSystem Quasi-Zenith Satellite System L1C/A. .. py:attribute:: QZSS_L1S :annotation: :SatelliteSystem Quasi-Zenith Satellite System L1S.