GPS API Package¶
Submodules¶
gps_api.cli module¶
Console script for gps_api.
gps_api.gps_api module¶
GPS API instatiates an object of GPS class with a port name on the device to which the GPS module is attached. GPS object provides functions to easily extract data from the NMEA messages received by the GPS module.
-
class
gps_api.gps_api.GPS(port)[source]¶ Bases:
object-
get_UTC_time()[source]¶ get UTC time data from latest nmea message
- Returns
UTC time at current position
-
get_altitude()[source]¶ get altitude data from latest nmea message
- Returns
altitude data at current position
-
get_current_location()[source]¶ get current location data from
- Returns
current location data in the form (latitude, longitude)
-
get_distance(latitude, longitude)[source]¶ get the distance to another location
- Parameters
latitude – another location’s latitude
longitude – another location’s longitude
- Returns
distance to the other position at (latitude, longitude)
-
get_latitude()[source]¶ get latitude data from latest nmea message
- Returns
latitude data at current position
-
get_longitude()[source]¶ get lonitude data from latest nmea message
- Returns
longitude data at current position
-
get_time_of_arrival(latitude, longitude)[source]¶ get time of arrival to destination (latitude, longitude)
- Parameters
latitude – destination’s latitude
longitude – destination’s longitude
- Returns
estimated time of arrival to the destination
-
reboot()[source]¶ - reboot involves a full cold start
FULL COLD START: time, position, almanacs and ephemeris data will be redownloaded system/user configurations will be cleared process will take approximately 8 minutes, use with patience
instantiate GPS class after reboot to apply the configuration of NMEA message type and frequency
-
gps_api.position module¶
-
class
gps_api.position.Position[source]¶ Bases:
objectposition class, used to store latitude, longitude and altitude. get_latitude, get_longitude and get_current_location methods
Module contents¶
Top-level package for GPS API.