parse.nmea: Parse NMEA sentences

View source: R/parse.nmea.R

parse.nmeaR Documentation

Parse NMEA sentences

Description

Find and parse GPS data from NMEA sentences.

Usage

parse.nmea(nmea, sentence = NULL, returnAll = FALSE)

Arguments

nmea

A data frame with CPU time and corresponding NMEA sentences as returned by get_NME0.

sentence

A string identifying the NMEA sentence to process. It can be one of "GPRMC", "GPGGA", "INGGA", or "GPGLL".

returnAll

logical. If TRUE, all data found in the selected sentence is returned.

Details

This function looks first for the "GPRMC" sentence, if not found it tries then with "GPGGA", "INGGA", or "GPGLL", and process the one with more information (more GPS fixes). Be aware that sometimes strings may be corrupted, in which case, it is possible to choose manually the sentence to process. This is why get_NME0 does not automatically parse the NMEA strings by default. When one of "GPVTG", "INVTG", "GNVTG", or "IIVTG" sentences is found, vessel speed and bearing are also parsed and returned. Differences in time.cpu and time.gps may reveal wrong clock settings in the data aquisition computer.

Value

A data frame with cpu time, gps time (includes miliseconds if found), longitude, and latitude. Additionally, vessel speed and bearing are returned if found in the data.

Author(s)

Héctor Villalobos.

References

NMEA sentences structure can be seen in: https://gpsd.gitlab.io/gpsd/NMEA.html

See Also

get_NME0.

Examples

if(interactive()){
ek <- read.EK60_raw("D20130504-T083828.raw", angles = FALSE)

gps <- parse.nmea(ek$nmea)
head(gps)
}

hvillalo/echogram documentation built on Oct. 2, 2023, 7:28 a.m.