gnss – Global Navigation Satellite System — Adafruit CircuitPython 1 documentation (original) (raw)
The gnss module contains classes to control the GNSS and acquire positioning information.
Available on these boards
- SPRESENSE
class gnss.GNSS(system: 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.
Parameters:
system – satellite system to use
Turn off the GNSS.
Update GNSS positioning information.
Latitude of current position in degrees (float).
Longitude of current position in degrees (float).
Altitude of current position in meters (float).
timestamp_: time.struct_time_
Time when the position data was updated.
fix_: PositionFix_
Fix mode.
class gnss.PositionFix
Position fix mode
Enum-like class to define the position fix mode.
INVALID_: PositionFix_
No measurement.
FIX_2D_: PositionFix_
2D fix.
FIX_3D_: PositionFix_
3D fix.
class gnss.SatelliteSystem
Satellite system type
Enum-like class to define the satellite system type.
GPS_: SatelliteSystem_
Global Positioning System.
GLONASS_: SatelliteSystem_
GLObal NAvigation Satellite System.
SBAS_: SatelliteSystem_
Satellite Based Augmentation System.
QZSS_L1CA_: SatelliteSystem_
Quasi-Zenith Satellite System L1C/A.
QZSS_L1S_: SatelliteSystem_
Quasi-Zenith Satellite System L1S.