nav_algo.nmea module

Bases: object

A parser for National Marine Electronics Association (NMEA) sentences.

The Parallax SIM33EAU GPS module transmits six different types of NMEA sentences: RMC: Recommended minimum data for GPS, VTG: Vector track and speed over the ground, GGA: Fix information, GSA: Overall satellite data, GSV: Detailed satellite data, and GLL: Latitude/Longitude data. This parser can account for each of these types. More information about NMEA sentences can be found here: https://www.gpsinformation.org/dale/nmea.htm.

The parsed information can be accessed through attributes of the NMEA object, which may be None if that attribute does not exist in the given sentence type.

Parameters

sentence (str) – An NMEA sentence to parse.

Raises

TypeError – If the input sentence is not a string.

The UTC time at which the NMEA sentence was generated.

Type

UTC

Whether the NMEA sentence contained valid data.

Type

bool

The numeric latititude measurement.

Type

float

The numeric longitude measurement.

Type

float

Bases: object

A representation of Coordinated Universal Time (UTC).

Parameters

time (str) – the utc time to parse (a string of the form ‘hhmmss’).

Raises

TypeError – If the input time is not a string.

The hour of the UTC time (24 hour format).

Type

int

The minute of the UTC time.

Type

int

The seconds of the UTC time.

Type

int

Converts latitude from NMEA format to decimal degrees.

NMEA format is DDMM.MMMM where DD is the degrees and MM.MMMM is the minutes. The decimal degreee value is DD + (MM.MMMM / 60). Values in the northern hemisphere are positive and values in the southern hemisphere are negative.

Parameters
  • nmea_format (str) – The latitude in NMEA format.

  • dir (str) – N for north or S for south.

Converts longitude from NMEA format to decimal degrees.

NMEA format is DDDMM.MMMM where DDD is the degrees and MM.MMMM is the minutes. The decimal degreee value is DDD + (MM.MMMM / 60). Values in the eastern hemisphere are positive and values in the western hemisphere are negative.

Parameters
  • nmea_format (str) – The longitude in NMEA format.

  • dir (str) – E for east or W for west.

Parses the sentence associated with the NMEA object.

Parses GGA sentences.

GGA sentences look something like: $GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47 and contain the UTC time, latitude, longitude, the fix status, and some satellite data, which we will ignore since we have no use for it. These values are stored as attributes of the NMEA object.

Parses GLL sentences.

GLL sentences look something like: $GPGLL,4916.45,N,12311.12,W,225444,A,*1D and contain the latitude, longitude, UTC time, status (active (A) if the data is valid, void (V) otherwise), and some satellite data, which we will ignore since we have no use for it. These values are stored as attributes of the NMEA object.

Parses GSA sentences.

GSA sentences look something like: $GPGSA,A,3,04,05,,09,12,,,24,,,,,2.5,1.3,2.1*39 and are pretty much useless to us, so this method does nothing except set status to False.

Parses GSV sentences.

GSV sentences look something like: $GPGSV,2,1,08,01,40,083,46,02,17,308,41,12,07,344,39,14,22,228,45*7 and are pretty much useless to us, so this method does nothing except set status to False.

Parses RMC sentences.

RMC sentences look something like: $GPRMC,123519,A,4807.038,N,01131.000,E,022.4,084.4,230394,003.1,W*6A and contain the UTC time, status (active (A) if the data is valid, void (V) otherwise), latitude, longitude, and some satellite data, which we will ignore since we have no use for it. These values are stored as attributes of the NMEA object.

Parses VTG sentences.

VTG sentences look something like: $GPVTG,054.7,T,034.4,M,005.5,N,010.2,K*48 and are pretty much useless to us, so this method does nothing except set status to False.