NMEAParser
Documentation for NMEAParser.
NMEAParser.DTM
NMEAParser.GBS
NMEAParser.GGA
NMEAParser.GLL
NMEAParser.GSA
NMEAParser.GSV
NMEAParser.NMEAData
NMEAParser.PASHR
NMEAParser.RMC
NMEAParser.SVData
NMEAParser.TWHPR
NMEAParser.TWPOS
NMEAParser.VTG
NMEAParser.ZDA
Base.parse
Base.pop!
NMEAParser._dms_to_dd
NMEAParser._hms_to_secs
NMEAParser.get_system
NMEAParser.is_string_supported
NMEAParser.parse_msg!
NMEAParser.pos_convert
NMEAParser.update
NMEAParser.update!
NMEAParser.vel_convert
NMEAParser.DTM
— TypeDTM <: NMEAString
A type that represents a Datum reference (DTM) message, which is one of the types of NMEA messages. NMEA stands for National Marine Electronics Association, and it is a standard protocol for communication between marine electronic devices. A DTM message identifies the local geodetic datum and datum offsets from a reference datum. This sentence is used to define the datum to which a position location, and geographic locations in subsequent sentences, is referenced[^1^][1].
Fields
system::String
: The system identifier, indicating the source of the message (e.g. "GPS", "GLONASS", "UNKNOWN").local_datum_code::String
: The local datum code (CCC), which can be one of the following values[^1^][1]:- W84 – WGS-84
- W72 – WGS-72
- S85 – SGS85
- P90 – PE90
- 999 – User-defined IHO datum code
local_datum_subcode::String
: The local datum subdivision code (x).lat_offset::Float64
: The latitude offset, in minutes (x.x). A negative value indicates south and a positive value indicates north.long_offset::Float64
: The longitude offset, in minutes (x.x). A negative value indicates west and a positive value indicates east.alt_offset::Float64
: The altitude offset, in meters (x.x).ref_datum::String
: The reference datum code (CCC), which can be one of the following values[^1^][1]:- W84 – WGS-84
- W72 – WGS-72
- S85 – SGS85
- P90 – PE90
- 999 – User-defined IHO datum code
valid::Bool
: A flag indicating whether the message is valid or not.
Constructor
The constructor takes an array of strings as an argument, which are the items of a DTM sentence. It also takes an optional keyword argument system
, which specifies the system identifier. If not given, it defaults to "UNKNOWN". Another optional keyword argument is valid
, which specifies whether the message is valid or not. If not given, it defaults to true.
Example
$GPDTM,W84,,0.000000,N,0.000000,E,0.0,W84*6F
NMEAParser.GBS
— TypeGBS(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true)
A struct that represents a GBS NMEA string, which is a message that contains the error estimates of the position fix from a global navigation satellite system (GNSS).
Fields
system::String
: The name of the system that produced the message.time::Float64
: The time of the message in seconds since midnight UTC.lat_error::Float64
: The expected error in latitude in meters.long_error::Float64
: The expected error in longitude in meters.alt_error::Float64
: The expected error in altitude in meters.failed_PRN::Int
: The pseudo-random noise (PRN) number of the satellite that has failed or is likely to fail.prob_of_missed::Float64
: The probability of missed detection for the failed satellite.excluded_meas_err::Float64
: The estimated error caused by excluding the measurement from the failed satellite.standard_deviation::Float64
: The standard deviation of the residual errors for all satellites used in the position fix.valid::Bool
: A flag that indicates whether the message is valid or not.
Constructor
The constructor takes an array of strings as an argument, which are the items in the GBS NMEA string. It also takes optional keyword arguments for the system name and the validity flag. It parses the items and assigns them to the corresponding fields.
NMEAParser.GGA
— TypeGGA(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true)
A struct that represents a Global Positioning System Fix Data (GGA) sentence from the NMEA protocol. It contains information about the GPS system, time, location, fix quality, number of satellites, horizontal dilution of precision (HDOP), altitude, geoidal separation, age of differential corrections, and differential reference station ID.
Arguments
items::Array{D}
: An array of strings that contains the fields of the GGA sentence, separated by commas.system::AbstractString
: An optional keyword argument that specifies the type of GPS system used. It can be "GPS", "GLONASS", "GALILEO", or "Combined". The default value is "UNKNOWN".valid::Bool
: An optional keyword argument that indicates whether the GGA sentence is valid or not. The default value is true.
Returns
- A
GGA
object with the following fields:system::String
: The type of GPS system used.time::Float64
: The UTC time of the fix in seconds.latitude::Float64
: The latitude of the position in decimal degrees.longitude::Float64
: The longitude of the position in decimal degrees.fix_quality::String
: The quality of the fix. It can be one of the following values: "INVALID", "GPS (SPS)", "DGPS", "PPS", "REAL TIME KINEMATIC", "FLOAT RTK", "DEAD RECKONING", "MANUAL INPUT", or "SIMULATION".num_sats::Int
: The number of satellites used in the fix.HDOP::Float64
: The horizontal dilution of precision (HDOP) of the fix.altitude::Float64
: The altitude above mean sea level (MSL) in meters.geoidal_seperation::Float64
: The difference between the WGS-84 earth ellipsoid and mean sea level (MSL) in meters.age_of_differential::Float64
: The time since the last SC104 type 1 or 9 update in seconds. A value of 0 means no differential GPS correction is available.diff_reference_id::Int
: The differential reference station ID.valid::Bool
: Whether the GGA sentence is valid or not.
The GGA sentence is one of the most common sentences used with GPS receivers. It contains information about position, elevation, time, number of satellites used, fix type, and correction age. The message ID for the GGA sentence is “GGA”. Here is an example of a GGA sentence:
$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47
This means that the GPS receiver reported its position as 48 degrees 7.038 minutes north latitude and 11 degrees 31.000 minutes east longitude at 12:35:19 UTC on the current date. The fix type was GPS (SPS), with 8 satellites used and a horizontal dilution of precision (HDOP) of 0.9. The altitude above mean sea level (MSL) was 545.4 meters, and the geoidal separation was 46.9 meters
NMEAParser.GLL
— TypeGLL <: NMEAString
A struct for handling NMEA message data of type GLL, which contains geographic position and time information.
Fields
system::String
: the name of the GNSS system that produced the data (e.g. "GPS", "GLONASS", etc.)latitude::Float64
: the latitude of the position in decimal degreeslongitude::Float64
: the longitude of the position in decimal degreestime::Float64
: the UTC time of the position in secondsstatus::Bool
: whether the position is valid (true
) or not (false
)mode::Char
: the mode indicator of the position fix (e.g. 'A' for autonomous, 'D' for differential, etc.)valid::Bool
: whether the message data is valid (true
) or not (false
)
Constructor
The constructor takes an array of strings as an argument, which should contain the fields of the GLL message in order, separated by commas. Optionally, a keyword argument system
can be given to specify the GNSS system name, and a keyword argument valid
can be given to indicate the validity of the message data. If not given, these arguments default to "UNKNOWN" and true
, respectively.
The GLL message contains the latitude, longitude, time, and status of the position fix obtained by the receiver. The status indicates whether the position is valid or not, and the mode indicates whether the position is obtained autonomously, differentially, or by other means. The GLL message is useful for applications that need to know the exact location and time of the receiver.
NMEAParser.GSA
— TypeGSA(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true)
A struct that represents a GNSS DOP and Active Satellites (GSA) sentence from the NMEA protocol. It contains information about the GPS system, mode, current mode, satellite IDs, position dilution of precision (PDOP), horizontal dilution of precision (HDOP), and vertical dilution of precision (VDOP).
Arguments
items::Array{D}
: An array of strings that contains the fields of the GSA sentence, separated by commas.system::AbstractString
: An optional keyword argument that specifies the type of GPS system used.
It can be "GPS", "GLONASS", "GALILEO", or "Combined". The default value is "UNKNOWN".
valid::Bool
: An optional keyword argument that indicates whether the GSA sentence is valid or not. The default value is true.
Returns
- A
GSA
object with the following fields:system::String
: The type of GPS system used.mode::Char
: The mode of operation. It can be 'A' for automatic or 'M' for manual.current_mode::Int
: The current mode of operation. It can be one of the following values: 1 for no fix, 2 for 2D fix, or 3 for 3D fix.sat_ids::Vector{Int}
: A vector of integers that contains the IDs of the satellites used in the fix.PDOP::Float64
: The position dilution of precision (PDOP) of the fix.HDOP::Float64
: The horizontal dilution of precision (HDOP) of the fix.VDOP::Float64
: The vertical dilution of precision (VDOP) of the fix.valid::Bool
: Whether the GSA sentence is valid or not.
The GSA sentence contains information about the GNSS DOP and active satellites. It indicates the mode of operation, the current mode of operation, the satellite IDs used in the fix, and the position dilution of precision (PDOP), horizontal dilution of precision (HDOP), and vertical dilution of precision (VDOP). The message ID for the GSA sentence is “GSA”. Here is an example of a GSA sentence:
$GNGSA,A,3,21,5,29,25,12,10,26,2,,,,,1.2,0.7,1.0*27
This means that the GNSS receiver was in automatic mode and had a 3D fix using satellites with IDs 21, 5, 29, 25, 12, 10, 26, and 2. The PDOP was 1.2, the HDOP was 0.7, and the VDOP was 1.0
NMEAParser.GSV
— TypeGSV <: NMEAString
A struct for handling NMEA message data of type GSV, which contains information about the GNSS satellites in view.
Fields
system::String
: the name of the GNSS system that produced the data (e.g. "GPS", "GLONASS", etc.)msg_total::Int
: the total number of GSV messages in this cyclemsg_num::Int
: the sequence number of this message in this cyclesat_total::Int
: the total number of satellites in viewSV_data::Vector{Int}
: an array of SVData structs, each containing information about one satellite in viewvalid::Bool
: whether the message data is valid (true
) or not (false
)
Constructor
The constructor takes an array of strings as an argument, which should contain the fields of the GSV message in order, separated by commas. Optionally, a keyword argument system
can be given to specify the GNSS system name, and a keyword argument valid
can be given to indicate the validity of the message data. If not given, these arguments default to "UNKNOWN" and true
, respectively.
The GSV message contains information about the satellites that are in view of the receiver, such as their PRN numbers, elevations, azimuths, and signal-to-noise ratios. The PRN number identifies the satellite uniquely within its system, and the elevation and azimuth indicate the direction of the satellite relative to the receiver. The signal-to-noise ratio measures the quality of the signal received from the satellite. The GSV message is useful for applications that need to know the availability and quality of the satellites that can be used for positioning
NMEAParser.NMEAData
— TypeNMEAData()
A mutable struct that stores the last parsed NMEA messages of different types.
Fields
last_GGA::Union{Nothing, GGA}
: the last GGA message parsed, or nothing if nonelast_RMC::Union{Nothing, RMC}
: the last RMC message parsed, or nothing if nonelast_GSA::Union{Nothing, GSA}
: the last GSA message parsed, or nothing if nonelast_GSV::Union{Nothing, GSV}
: the last GSV message parsed, or nothing if nonelast_GBS::Union{Nothing, GBS}
: the last GBS message parsed, or nothing if nonelast_VTG::Union{Nothing, VTG}
: the last VTG message parsed, or nothing if nonelast_GLL::Union{Nothing, GLL}
: the last GLL message parsed, or nothing if nonelast_ZDA::Union{Nothing, ZDA}
: the last ZDA message parsed, or nothing if nonelast_DTM::Union{Nothing, DTM}
: the last DTM message parsed, or nothing if nonelast_PASHR::Union{Nothing, PASHR}
: the last PASHR message parsed, or nothing if nonelast_TWPOS::Union{Nothing, TWPOS}
: the last TWPOS message parsed, or nothing if nonelast_TWHPR::Union{Nothing, TWHPR}
: the last TWHPR message parsed, or nothing if none
NMEAParser.PASHR
— TypePASHR(system, time, heading, heading_type, roll, pitch, heave, roll_accuracy,
- pitch_accuracy, heading_accuracy, aiding_code, ins_code, valid)
A struct that represents a PASHR NMEA string, which is a message that contains position and attitude data from an inertial navigation system (INS).
Fields
system::String
: The name of the system that produced the message.time::Float64
: The time of the message in seconds since midnight UTC.heading::Float64
: The heading angle in degrees clockwise from north.heading_type::Char
: The type of heading: 'T' for true or 'M' for magnetic.roll::Float64
: The roll angle in degrees. Positive values indicate right roll.pitch::Float64
: The pitch angle in degrees. Positive values indicate nose up.heave::Float64
: The heave displacement in meters. Positive values indicate upward motion.roll_accuracy::Float64
: The standard deviation of the roll angle in degrees.pitch_accuracy::Float64
: The standard deviation of the pitch angle in degrees.heading_accuracy::Float64
: The standard deviation of the heading angle in degrees.aiding_code::Int
: A code that indicates the type of aiding used by the INS.ins_code::Int
: A code that indicates the status of the INS.valid::Bool
: A flag that indicates whether the message is valid or not.
Constructor
The constructor takes an array of strings as an argument, which are the items in the PASHR NMEA string. It also takes optional keyword arguments for the system name and the validity flag. It parses the items and assigns them to the corresponding fields.
Example
$PASHR,154155.50,153.17,T,9.68,2.29,-0.07,0.502,0.502,0.959,1*19
NMEAParser.RMC
— TypeRMC <: NMEAString
A type that represents a Recommended Minimum Navigation Information (RMC) message, which is one of the most common types of NMEA messages. NMEA stands for National Marine Electronics Association, and it is a standard protocol for communication between marine electronic devices. An RMC message provides information about the position, velocity, time, date, and magnetic variation of a GPS receiver.
Fields
system::String
: The system identifier, indicating the source of the message (e.g. "GPS", "GLONASS", "UNKNOWN").time::Float64
: The UTC time of the position fix, in seconds since midnight.status::Bool
: The status indicator, either true for active or false for void (invalid).latitude::Float64
: The latitude of the position, in decimal degrees.longitude::Float64
: The longitude of the position, in decimal degrees.sog::Float64
: The speed over ground, in knots.cog::Float64
: The track angle, in degrees true (not magnetic).day::String
: The day of the position fix, in two digits.month::String
: The month of the position fix, in two digits.year::String
: The year of the position fix, in two digits.magvar::Float64
: The magnetic variation, in degrees. A negative value indicates west and a positive value indicates east.mode::Char
: The mode indicator, indicating the type of fix. It can be one of the following values:- 'A' for autonomous (GPS only)
- 'D' for differential (DGPS)
- 'E' for estimated
- 'F' for float RTK
- 'M' for manual input
- 'N' for no fix
- 'P' for precise
- 'R' for real time kinematic
- 'S' for simulator
valid::Bool
: A flag indicating whether the message is valid or not.
Constructor
The constructor takes an array of strings as an argument, which are the items of an RMC sentence. It also takes an optional keyword argument system
, which specifies the system identifier. If not given, it defaults to "UNKNOWN". Another optional keyword argument is valid
, which specifies whether the message is valid or not. If not given, it defaults to true.
NMEAParser.SVData
— TypeSVData <: NMEAString
A struct for handling NMEA message data of type SVData, which contains information about one satellite in view of a GNSS receiver.
Fields
PRN::Int
: the PRN number of the satellite, which identifies it uniquely within its systemelevation::Int
: the elevation angle of the satellite in degrees, relative to the horizonazimuth::Int
: the azimuth angle of the satellite in degrees, relative to the true northSNR::Int
: the signal-to-noise ratio of the satellite in decibels, which measures the quality of the signal received from the satellite
The SVData struct is used to store and process information about one satellite that is in view of a GNSS receiver. It is usually part of a GSV message, which contains information about all the satellites in view. The SVData struct can be used to determine the availability and quality of the satellites that can be used for positioning.
NMEAParser.TWHPR
— TypeTWHPR <: NMEAString
A Julia struct representing the TWHPR NMEA string, which contains information about a system, heading, pitch, roll, and validity status.
Fields
system::String
: The system identifier.heading::Float64
: The heading value.pitch::Float64
: The pitch value.roll::Float64
: The roll value.valid::Bool
: A boolean indicating the validity of the data.
Constructor
TWHPR(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true) where D <: SubString
Constructs a TWHPR
object from an array of string items, such as those parsed from a NMEA sentence.
Parameters
items::Array{D}
: An array of string items representing the parsed NMEA sentence.system::AbstractString
: (Optional) The system identifier. Defaults to "UNKNOWN".valid::Bool
: (Optional) The validity status. Defaults totrue
.
Returns
A TWHPR
object with fields populated based on the provided items and optional parameters.
Example
data = ["PTWHPR", "161540.45", "12.456", "78.901", "2.34", "79.912", "0.12*2C"]
-twhpr = TWHPR(data, system="NAV", valid=true)
NMEAParser.TWPOS
— TypeTWPOS(system, time, xpose, ypose, zpose, distance, velocity, valid)
A struct that represents a TWPOS NMEA string, which is a message that contains the position and velocity data from a transponder.
Fields
system::String
: The name of the system that produced the message.time::Float64
: The time of the message in seconds since midnight UTC.xpose::Float64
: The x-coordinate of the position in meters.ypose::Float64
: The y-coordinate of the position in meters.zpose::Float64
: The z-coordinate of the position in meters.distance::Float64
: The distance from the origin in meters.velocity::Float64
: The velocity in meters per second.valid::Bool
: A flag that indicates whether the message is valid or not.
Constructor
The constructor takes an array of strings as an argument, which are the items in the TWPOS NMEA string. It also takes optional keyword arguments for the system name and the validity flag. It parses the items and converts them to the appropriate units and assigns them to the corresponding fields.
NMEAParser.VTG
— TypeVTG <: NMEAString
A type that represents a Track made good and speed over ground (VTG) message, which is one of the types of NMEA messages. NMEA stands for National Marine Electronics Association, and it is a standard protocol for communication between marine electronic devices. A VTG message provides information about the actual track made good and speed over ground of a GPS receiver.
Fields
system::String
: The system identifier, indicating the source of the message (e.g. "GPS", "GLONASS", "UNKNOWN").CoG_true::Float64
: The track made good (degrees true).CoG_mag::Float64
: The track made good (degrees magnetic).SoG_knots::Float64
: The speed over ground, in knots.SoG_kmhr::Float64
: The speed over ground, in kilometers per hour (kph).mode::Char
: The mode indicator, indicating the type of fix. It can be one of the following values:- 'A' for autonomous (GPS only)
- 'D' for differential (DGPS)
- 'E' for estimated (dead reckoning) mode
- 'M' for manual input mode
- 'S' for simulator mode
- 'N' for data not valid
valid::Bool
: A flag indicating whether the message is valid or not.
Constructor
The constructor takes an array of strings as an argument, which are the items of a VTG sentence. It also takes an optional keyword argument system
, which specifies the system identifier. If not given, it defaults to "UNKNOWN". Another optional keyword argument is valid
, which specifies whether the message is valid or not. If not given, it defaults to true.
Example
A message has the following format: $GPVTG,x.x,T,x.x,M,x.x,N,x.x,K,m*hh
For example, the following VTG message:
$GPVTG,140.88,T,M,8.04,N,14.89,K,D*05
Means that:
- The track made good is 140.88 degrees true.
- The track made good is not available in degrees magnetic.
- The speed over ground is 8.04 knots.
- The speed over ground is 14.89 kph.
- The mode indicator is differential (DGPS).
- The checksum data is 05.
NMEAParser.ZDA
— TypeZDA(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true)
A struct that represents a Time and Date (ZDA) sentence from the NMEA protocol. It contains information about the GPS system, time, date, and local time zone.
Arguments
items::Array{D}
: An array of strings that contains the fields of the ZDA sentence, separated by commas.system::AbstractString
: An optional keyword argument that specifies the type of GPS system used. It can be "GPS", "GLONASS", "GALILEO", or "Combined". The default value is "UNKNOWN".valid::Bool
: An optional keyword argument that indicates whether the ZDA sentence is valid or not. The default value is true.
Returns
- A
ZDA
object with the following fields:system::String
: The type of GPS system used.time::Float64
: The UTC time of the fix in seconds.day::Int
: The day of the month (1-31).month::Int
: The month of the year (1-12).year::Int
: The year (four digits).zone_hrs::Int
: The local time zone offset from UTC in hours.zone_mins::Int
: The local time zone offset from UTC in minutes.valid::Bool
: Whether the ZDA sentence is valid or not.
An example of a ZDA sentence is:
$GPZDA,201530.00,04,07,2002,00,00*60
This means that the GPS system reported the date and time as 20:15:30.00 UTC on July 4th, 2002, with no local time zone offset1.
The purpose of the ZDA sentence is to provide a reliable and accurate source of date and time information for applications that require synchronization or logging. For example, some scientific instruments or sensors may need to record the exact time of their measurements or events. The ZDA sentence can also be used to adjust the internal clock of the receiver or other devices
Base.parse
— Methodparse(nmea_string::AbstractString)
A function that parses a NMEA string, which is a standard format for data transmission from marine and navigation devices.
Arguments
nmea_string::AbstractString
: The NMEA string to be parsed.validate_checksum
(optional): Default=true. Setting to false skips validating the checksum.
Returns
A struct that represents the type and content of the NMEA string, such as DTM, GBS, GGA, GLL, GSA, GSV, RMC, VTG, ZDA, PASHR, or TWPOS. The struct has fields that correspond to the items in the NMEA string.
Errors
Throws an ArgumentError
if the NMEA string is not supported or has an invalid format.
Algorithm
The function splits the NMEA string by the '*' character and checks the checksum of the message. It then splits the message by the ',' character and extracts the header and the items. It determines the system name from the header and calls the appropriate constructor for the corresponding struct type. If no matching struct type is found, it throws an ArgumentError
.
Base.pop!
— Methodpop!(nmea_data::NMEAData, ::Type{T}) where T <: NMEAString
Pop the last received message of type T from the NMEAData object nmea_data and return it. If no message of type T has been received, throw an UndefVarError. This function extends the Base.pop! function for NMEAData objects.
NMEAParser._dms_to_dd
— Method_dms_to_dd(dms::SubString, hemi::SubString)
Converts a string representing degrees, minutes and seconds (DMS) to decimal degrees.
Arguments
dms
: a substring representing degrees, minutes and secondshemi
: a substring representing the hemisphere
Returns
dec_degrees
: the decimal degree representation of the input DMS
Example
dms = "4807.038"
+Home · NMEAParser.jl NMEAParser
Documentation for NMEAParser.
NMEAParser.DTM
NMEAParser.GBS
NMEAParser.GGA
NMEAParser.GLL
NMEAParser.GSA
NMEAParser.GSV
NMEAParser.NMEAData
NMEAParser.PASHR
NMEAParser.PTACC
NMEAParser.PTGYR
NMEAParser.PTWHPR
NMEAParser.PTWPLS
NMEAParser.PTWPOS
NMEAParser.PTWVCT
NMEAParser.PTWWHE
NMEAParser.RMC
NMEAParser.VTG
NMEAParser.ZDA
Base.pop!
NMEAParser._dms_to_dd
NMEAParser._hms_to_secs
NMEAParser.get_system
NMEAParser.is_string_supported
NMEAParser.nmea_parse
NMEAParser.parse_msg!
NMEAParser.pos_convert
NMEAParser.update
NMEAParser.update!
NMEAParser.vel_convert
NMEAParser.@do_parse
NMEAParser.DTM
— Typestruct DTM <: NMEAString
Datum Reference (DTM)
This NMEA data type represents information about a datum reference.
Fields
system::String
: GNSS system identifier (e.g., GPS, GLONASS, GALILEO, Combined).local_datum_code::String
: Local datum code.local_datum_subcode::String
: Local datum subcode.lat_offset::Float64
: Latitude offset in meters.long_offset::Float64
: Longitude offset in meters.alt_offset::Float64
: Altitude offset in meters.ref_datum::String
: Reference datum.valid::Bool
: Flag indicating the validity of the data.
Constructor
DTM(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true) where D <: SubString
Examples
data = DTM(["DTM", "W84", "W", "0.5", "W", "1.0", "M", "W84"])
sourceNMEAParser.GBS
— Typestruct GBS <: NMEAString
GNSS Satellite Fault Detection (GBS)
This NMEA data type represents information about satellite fault detection, including error estimates and probabilities.
Fields
system::String
: GNSS system identifier (e.g., GPS, GLONASS, GALILEO, Combined).time::Float64
: Time in seconds.lat_error::Float64
: Latitude error estimate.long_error::Float64
: Longitude error estimate.alt_error::Float64
: Altitude error estimate.failed_PRN::Int
: PRN of the failed satellite.prob_of_missed::Float64
: Probability of missed detection.excluded_meas_err::Float64
: Excluded measurement error.standard_deviation::Float64
: Standard deviation of the measurements.valid::Bool
: Flag indicating the validity of the data.
Constructor
GBS(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true) where D <: SubString
Examples
data = GBS(["GBS", "123456", "0.1", "0.2", "0.3", "5", "0.01", "0.05", "0.02"])
sourceNMEAParser.GGA
— Typestruct GGA <: NMEAString
GPS Fix Data (GGA)
This NMEA data type represents information about the GPS fix, including latitude, longitude, altitude, number of satellites, and accuracy measures.
Fields
system::String
: GPS, GLONASS, GALILEO, or Combined.time::Float64
: Time in seconds.latitude::Float64
: Latitude in decimal degrees.longitude::Float64
: Longitude in decimal degrees.fix_quality::String
: Quality of the fix.num_sats::Int
: Number of satellites used in the fix.HDOP::Float64
: Horizontal Dilution of Precision.altitude::Float64
: Altitude above mean sea level (MSL) in meters.geoidal_separation::Float64
: Geoidal separation in meters.age_of_differential::Float64
: Age of the differential data.diff_reference_id::Int
: Differential reference station ID.valid::Bool
: Flag indicating the validity of the data.
Constructor
GGA(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true) where D <: SubString
Examples
data = GGA(["GGA", "123456", "123.456", "N", "987.654", "W", "1", "8", "0.9", "123.4", "M", "54.3", "M", "1"])
sourceNMEAParser.GLL
— Typestruct GLL <: NMEAString
Geographic Latitude and Longitude (GLL)
This NMEA data type represents information about geographic latitude and longitude.
Fields
system::String
: GNSS system identifier (e.g., GPS, GLONASS, GALILEO, Combined).latitude::Float64
: Latitude in decimal degrees.longitude::Float64
: Longitude in decimal degrees.time::Float64
: Time in seconds.status::Bool
: Status indicator (true if valid fix, false otherwise).mode::Char
: Mode indicator ('A' for autonomous mode).valid::Bool
: Flag indicating the validity of the data.
Constructor
GLL(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true) where D <: SubString
Examples
data = GLL(["GLL", "12.3456", "N", "98.7654", "W", "123456", "A"])
sourceNMEAParser.GSA
— Typestruct GSA <: NMEAString
GNSS DOP and Active Satellites (GSA)
This NMEA data type represents information about the GNSS Dilution of Precision (DOP) and the active satellites used for navigation.
Fields
system::String
: GNSS system identifier (e.g., GPS, GLONASS, GALILEO, Combined).mode::Char
: Mode of operation (A = Automatic, M = Manual).current_mode::Int
: Operating mode (1 = Fix not available, 2 = 2D fix, 3 = 3D fix).sat_ids::Vector{Int}
: Vector of satellite IDs used in the fix.PDOP::Float64
: Position Dilution of Precision.HDOP::Float64
: Horizontal Dilution of Precision.VDOP::Float64
: Vertical Dilution of Precision.valid::Bool
: Flag indicating the validity of the data.
Constructor
GSA(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true) where D <: SubString
Examples
data = GSA(["GSA", "M", "3", "1", "2", "3", "1.2", "0.9", "1.5"])
sourceNMEAParser.GSV
— Typestruct GSV <: NMEAString
Satellites in View (GSV)
This NMEA data type represents information about the satellites in view and their signal strength.
Fields
system::String
: GNSS system identifier (e.g., GPS, GLONASS, GALILEO, Combined).msg_total::Int
: Total number of GSV messages for this cycle.msg_num::Int
: Number of this GSV message.sat_total::Int
: Total number of satellites in view.SV_data::Vector{SVData}
: Vector of satellite data, each containing PRN, elevation, azimuth, and SNR.valid::Bool
: Flag indicating the validity of the data.
Constructor
GSV(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true) where D <: SubString
Examples
data = GSV(["GSV", "3", "1", "9", "1", "01", "30", "45", "20", "02", "60", "180", "25", "03", "15", "300", "15"])
sourceNMEAParser.NMEAData
— TypeNMEAData()
A mutable struct that stores the last parsed NMEA messages of different types.
Fields
last_GGA::Union{Nothing, GGA}
: the last GGA message parsed, or nothing if nonelast_RMC::Union{Nothing, RMC}
: the last RMC message parsed, or nothing if nonelast_GSA::Union{Nothing, GSA}
: the last GSA message parsed, or nothing if nonelast_GSV::Union{Nothing, GSV}
: the last GSV message parsed, or nothing if nonelast_GBS::Union{Nothing, GBS}
: the last GBS message parsed, or nothing if nonelast_VTG::Union{Nothing, VTG}
: the last VTG message parsed, or nothing if nonelast_GLL::Union{Nothing, GLL}
: the last GLL message parsed, or nothing if nonelast_ZDA::Union{Nothing, ZDA}
: the last ZDA message parsed, or nothing if nonelast_DTM::Union{Nothing, DTM}
: the last DTM message parsed, or nothing if none
sourceNMEAParser.PASHR
— Typestruct PASHR <: NMEAString
Inertial Attitude Data (PASHR)
This NMEA data type represents inertial attitude data, including heading, roll, pitch, and heave.
Fields
system::String
: GNSS system identifier (e.g., GPS, GLONASS, GALILEO, Combined).time::Float64
: Time in seconds.heading::Float64
: Heading in decimal degrees.heading_type::Bool
: True heading indicator (true if heading is relative to true north).roll::Float64
: Roll in decimal degrees.pitch::Float64
: Pitch in decimal degrees.heave::Float64
: Heave in meters.roll_accuracy::Float64
: Roll accuracy (standard deviation in decimal degrees).pitch_accuracy::Float64
: Pitch accuracy (standard deviation in decimal degrees).heading_accuracy::Float64
: Heading accuracy (standard deviation in decimal degrees).aiding_code::Int
: GPS Update Quality Flag (0 = No position, 1 = Non-RTK fixed, 2 = RTK fixed).ins_code::Int
: INS Status Flag (0 = Pre-Alignment, 1 = Post-Alignment).valid::Bool
: Flag indicating the validity of the data.
Constructor
PASHR(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true) where D <: SubString
Examples
data = PASHR(["PASHR", "123456", "45.0", "T", "15.0", "-10.0", "2.0", "0.1", "0.1", "0.2", "2", "1"])
sourceNMEAParser.PTACC
— Typestruct PTACC <: NMEAString
IMU Accelerometer (PTACC)
This NMEA data type represents inertial measurement unit (IMU) accelerometer information.
Fields
system::String
: GNSS system identifier (e.g., GPS, GLONASS, GALILEO, Combined).time::Float64
: Time in seconds.x::Float64
: Acceleration in the X-axis.y::Float64
: Acceleration in the Y-axis.z::Float64
: Acceleration in the Z-axis.valid::Bool
: Flag indicating the validity of the data.
Constructor
PTACC(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true) where D <: SubString
Examples
data = PTACC(["PTACC", "123456", "0.5", "1.0", "-0.2"])
sourceNMEAParser.PTGYR
— Typestruct PTGYR <: NMEAString
IMU Gyroscope (PTGYR)
This NMEA data type represents inertial measurement unit (IMU) gyroscope information.
Fields
system::String
: GNSS system identifier (e.g., GPS, GLONASS, GALILEO, Combined).time::Float64
: Time in seconds.x::Float64
: Angular velocity around the X-axis.y::Float64
: Angular velocity around the Y-axis.z::Float64
: Angular velocity around the Z-axis.valid::Bool
: Flag indicating the validity of the data.
Constructor
PTGYR(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true) where D <: SubString
Examples
data = PTGYR(["PTGYR", "123456", "0.1", "-0.2", "0.5"])
sourceNMEAParser.PTWHPR
— Typestruct PTWHPR <: NMEAString
IMU Heading Pitch Roll (PTWHPR)
This NMEA data type represents inertial measurement unit (IMU) information, including heading, pitch, and roll.
Fields
system::String
: GNSS system identifier (e.g., GPS, GLONASS, GALILEO, Combined).time::Float64
: Time in seconds.heading::Float64
: Heading in degrees.pitch::Float64
: Pitch in degrees.roll::Float64
: Roll in degrees.valid::Bool
: Flag indicating the validity of the data.
Constructor
PTWHPR(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true) where D <: SubString
Examples
data = PTWHPR(["PTWHPR", "123456", "90.0", "30.0", "-45.0"])
sourceNMEAParser.PTWPLS
— Typestruct PTWPLS <: NMEAString
Position in Pulses (PTWPLS)
This NMEA data type represents position information in pulses.
Fields
system::String
: GNSS system identifier (e.g., GPS, GLONASS, GALILEO, Combined).time::Float64
: Time in seconds.x::Float64
: X position in pulses.y::Float64
: Y position in pulses.heading::Float64
: Heading in degrees.valid::Bool
: Flag indicating the validity of the data.
Constructor
PTWPLS(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true) where D <: SubString
Examples
data = PTWPLS(["PTWPLS", "123456", "500", "P", "750", "P", "90.0", "D"])
sourceNMEAParser.PTWPOS
— Typestruct PTWPOS <: NMEAString
Position (PTWPOS)
This NMEA data type represents position information.
Fields
system::String
: GNSS system identifier (e.g., GPS, GLONASS, GALILEO, Combined).time::Float64
: Time in seconds.xpose::Float64
: X position in meters.ypose::Float64
: Y position in meters.zpose::Float64
: Z position in meters.distance::Float64
: Distance in meters.velocity::Float64
: Velocity in kilometers per hour.direction::Char
: Direction indicator ('F' for forward, 'B' for backward).valid::Bool
: Flag indicating the validity of the data.
Constructor
PTWPOS(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true) where D <: SubString
Examples
data = PTWPOS(["PTWPOS", "123456", "45.678", "M", "123.456", "M", "789.012", "M", "456.789", "M", "5.0", "K", "F"])
sourceNMEAParser.PTWVCT
— Typestruct PTWVCT <: NMEAString
Movement Vector (PTWVCT)
This NMEA data type represents movement vector information.
Fields
system::String
: GNSS system identifier (e.g., GPS, GLONASS, GALILEO, Combined).time::Float64
: Time in seconds.distance_derivative::Float64
: Distance derivative in meters.heading::Float64
: Heading in radians.distance::Float64
: Distance in meters.speed::Float64
: Speed in meters per second.valid::Bool
: Flag indicating the validity of the data.
Constructor
PTWVCT(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true) where D <: SubString
Examples
data = PTWVCT(["PTWVCT", "123456", "2.0", "M", "1.5708", "R", "5.0", "M"])
sourceNMEAParser.PTWWHE
— Typestruct PTWWHE <: NMEAString
Wheels Information (PTWWHE)
This NMEA data type represents wheels information.
Fields
system::String
: GNSS system identifier (e.g., GPS, GLONASS, GALILEO, Combined).time::Float64
: Time in seconds.lw_pulses::Float64
: Left wheel pulses.lw_distance::Float64
: Left wheel distance in meters.lw_direction::Char
: Left wheel direction indicator ('F' for forward, 'B' for backward).rw_pulses::Float64
: Right wheel pulses.rw_distance::Float64
: Right wheel distance in meters.rw_direction::Char
: Right wheel direction indicator ('F' for forward, 'B' for backward).heading::Float64
: Heading.valid::Bool
: Flag indicating the validity of the data.
Constructor
PTWWHE(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true) where D <: SubString
Examples
data = PTWWHE(["PTWWHE", "123456", "500", "100.0", "M", "F", "750", "150.0", "M", "B", "90.0"])
sourceNMEAParser.RMC
— Typestruct RMC <: NMEAString
Recommended Minimum Navigation Information (RMC)
This NMEA data type represents recommended minimum navigation information.
Fields
system::String
: GNSS system identifier (e.g., GPS, GLONASS, GALILEO, Combined).time::Float64
: Time in seconds.status::Bool
: Status indicator (true if valid fix, false otherwise).latitude::Float64
: Latitude in decimal degrees.longitude::Float64
: Longitude in decimal degrees.sog::Float64
: Speed over ground in knots.cog::Float64
: Course over ground in degrees.day::String
: Day of the month.month::String
: Month of the year.year::String
: Year.magvar::Float64
: Magnetic variation.mode::Char
: Mode indicator ('A' for autonomous mode).valid::Bool
: Flag indicating the validity of the data.
Constructor
RMC(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true) where D <: SubString
Examples
data = RMC(["RMC", "123456", "A", "12.3456", "N", "98.7654", "W", "5.0", "90.0", "150225", "5.0", "W", "A"])
sourceNMEAParser.VTG
— Typestruct VTG <: NMEAString
Track Made Good and Ground Speed (VTG)
This NMEA data type represents information about the track made good (course) and ground speed.
Fields
system::String
: GNSS system identifier (e.g., GPS, GLONASS, GALILEO, Combined).CoG_true::Float64
: Course over ground in true degrees.CoG_mag::Float64
: Course over ground in magnetic degrees.SoG_knots::Float64
: Speed over ground in knots.SoG_kmhr::Float64
: Speed over ground in kilometers per hour.mode::Char
: Mode indicator ('A' for autonomous mode).valid::Bool
: Flag indicating the validity of the data.
Constructor
VTG(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true) where D <: SubString
Examples
data = VTG(["VTG", "90.0", "T", "45.0", "M", "5.0", "K", "A"])
sourceNMEAParser.ZDA
— Typestruct ZDA <: NMEAString
Time and Date (ZDA)
This NMEA data type represents information about the current time and date from a GNSS receiver.
Fields
system::String
: GNSS system identifier (e.g., GPS, GLONASS, GALILEO, Combined).time::Float64
: Time in seconds.day::Int
: Day of the month.month::Int
: Month of the year.year::Int
: Year.zone_hrs::Int
: Time zone offset in hours.zone_mins::Int
: Time zone offset in minutes.valid::Bool
: Flag indicating the validity of the data.
Constructor
ZDA(items::Array{D}; system::AbstractString = "UNKNOWN", valid = true) where D <: SubString
Examples
data = ZDA(["ZDA", "123456", "15", "02", "2024", "5", "30"])
sourceBase.pop!
— Methodpop!(nmea_data::NMEAData, ::Type{T}) where T <: NMEAString
Pop the last received message of type T from the NMEAData object nmea_data and return it. If no message of type T has been received, throw an UndefVarError. This function extends the Base.pop! function for NMEAData objects.
sourceNMEAParser._dms_to_dd
— Method_dms_to_dd(dms::SubString, hemi::SubString)
Converts a string representing degrees, minutes and seconds (DMS) to decimal degrees.
Arguments
dms
: a substring representing degrees, minutes and secondshemi
: a substring representing the hemisphere
Returns
dec_degrees
: the decimal degree representation of the input DMS
Example
dms = "4807.038"
hemi = "N"
-dec_degrees = _dms_to_dd(dms, hemi)
sourceNMEAParser._hms_to_secs
— Method_hms_to_secs(hms::SubString)
Converts a string representing hours, minutes and seconds (HMS) to seconds.
Arguments
hms
: a substring representing hours, minutes and seconds
Returns
seconds
: the number of seconds represented by the input HMS
Example
hms = "123519"
-seconds = _hms_to_secs(hms)
sourceNMEAParser.get_system
— Methodget_system(mtype::SubString)
Determine the system type based on the input mtype
.
Arguments
mtype
: A SubString
representing the message type.
Returns
- A string representing the system type. Possible values are
"GPS"
, "GLONASS"
, "GALILEO"
, "COMBINED"
, and "UNKNOWN"
.
Examples
get_system("$GPGGA") # "GPS"
+dec_degrees = _dms_to_dd(dms, hemi)
sourceNMEAParser._hms_to_secs
— Method_hms_to_secs(hms::SubString)
Converts a string representing hours, minutes and seconds (HMS) to seconds.
Arguments
hms
: a substring representing hours, minutes and seconds
Returns
seconds
: the number of seconds represented by the input HMS
Example
hms = "123519"
+seconds = _hms_to_secs(hms)
sourceNMEAParser.get_system
— Methodget_system(mtype::SubString)
Determine the system type based on the input mtype
.
Arguments
mtype
: A SubString
representing the message type.
Returns
- A string representing the system type. Possible values are
"GPS"
, "GLONASS"
, "GALILEO"
, "COMBINED"
, and "UNKNOWN"
.
Examples
get_system("$GPGGA") # "GPS"
get_system("$GLGSV") # "GLONASS"
get_system("$GAGGA") # "GALILEO"
get_system("$GNGNS") # "COMBINED"
-get_system("$PMTK") # "UNKNOWN"
TODO: update get_system
to cover all common system types AI = Alarm Indicator, (AIS?) AP = Auto Pilot (pypilot?) BD = BeiDou (China) CD = Digital Selective Calling (DSC) EC = Electronic Chart Display & Information System (ECDIS) GA = Galileo Positioning System GB = BeiDou (China) GI = NavIC, IRNSS (India) GL = GLONASS, according to IEIC 61162-1 GN = Combination of multiple satellite systems (NMEA 1083) GP = Global Positioning System receiver GQ = QZSS regional GPS augmentation system (Japan) HC = Heading/Compass HE = Gyro, north seeking II = Integrated Instrumentation IN = Integrated Navigation LC = Loran-C receiver (obsolete) Pxxx = Proprietary (Vendor specific) PQ = QZSS (Quectel Quirk) QZ = QZSS regional GPS augmentation system (Japan) SD = Depth Sounder ST = Skytraq TI = Turn Indicator YX = Transducer WI = Weather Instrument
sourceNMEAParser.is_string_supported
— Methodis_string_supported(nmea_string::AbstractString)
Check if the input NMEA string type is supported.
Arguments
nmea_string::AbstractString
: The NMEA string to be checked.
Returns
Bool
: true
if the NMEA string is supported, false
otherwise.
Example
julia> is_string_supported("$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47")
-true
sourceNMEAParser.parse_msg!
— Methodparse_msg!(s::NMEAData, line::AbstractString)
Parse a line of NMEA 0183 data and update the state of an NMEAData object.
Arguments
s : NMEAData An object that stores the parsed data from NMEA messages. line : AbstractString A string that contains a valid NMEA 0183 message.
Returns
DataType The type of the parsed message, or Nothing if the message is not supported.
Errors
ArgumentError If the line is not a valid NMEA 0183 message.
Example
s = NMEAData()
+get_system("$PMTK") # "UNKNOWN"
TODO: update get_system
to cover all common system types AI = Alarm Indicator, (AIS?) AP = Auto Pilot (pypilot?) BD = BeiDou (China) CD = Digital Selective Calling (DSC) EC = Electronic Chart Display & Information System (ECDIS) GA = Galileo Positioning System GB = BeiDou (China) GI = NavIC, IRNSS (India) GL = GLONASS, according to IEIC 61162-1 GN = Combination of multiple satellite systems (NMEA 1083) GP = Global Positioning System receiver GQ = QZSS regional GPS augmentation system (Japan) HC = Heading/Compass HE = Gyro, north seeking II = Integrated Instrumentation IN = Integrated Navigation LC = Loran-C receiver (obsolete) Pxxx = Proprietary (Vendor specific) PQ = QZSS (Quectel Quirk) QZ = QZSS regional GPS augmentation system (Japan) SD = Depth Sounder ST = Skytraq TI = Turn Indicator YX = Transducer WI = Weather Instrument
sourceNMEAParser.is_string_supported
— Methodis_string_supported(nmea_string::AbstractString)
Check if the input NMEA string type is supported.
Arguments
nmea_string::AbstractString
: The NMEA string to be checked.
Returns
Bool
: true
if the NMEA string is supported, false
otherwise.
Example
julia> is_string_supported("$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47")
+true
sourceNMEAParser.nmea_parse
— Methodnmea_parse(nmea_string::AbstractString; validate_checksum=true)
Parse an NMEA string and generate the corresponding NMEA type.
This function takes an NMEA sentence as input, validates the checksum if validate_checksum
is set to true
, and then parses the sentence based on the predefined headers and types in NMEA_TYPES
.
Arguments
nmea_string::AbstractString
: The NMEA sentence to parse.validate_checksum::Bool
: Flag to indicate whether to validate the checksum (default is true
).
Returns
- An instance of the appropriate NMEA type.
Examples
result = nmea_parse("$GGA,123456,123.456,N,987.654,W,1,8,0.9,123.4,M,54.3,M,1,")
sourceNMEAParser.parse_msg!
— Methodparse_msg!(s::NMEAData, line::AbstractString)
Parse a line of NMEA 0183 data and update the state of an NMEAData object.
Arguments
s : NMEAData An object that stores the parsed data from NMEA messages. line : AbstractString A string that contains a valid NMEA 0183 message.
Returns
DataType The type of the parsed message, or Nothing if the message is not supported.
Errors
ArgumentError If the line is not a valid NMEA 0183 message.
Example
s = NMEAData()
julia> d = [ "$GPRMC,154925.820,A,5209.732,N,00600.240,E,001.9,059.8,040123,000.0,W*7E",
- "$GPGGA,154925.920,5209.732,N,00600.240,E,1,12,1.0,0.0,M,0.0,M,,*63",
- "$GPGSA,A,3,01,02,03,04,05,06,07,08,09,10,11,12,1.0,1.0,1.0*30",
- "$GPRMC,154925.920,A,5209.732,N,00600.240,E,001.9,059.8,040123,000.0,W*7F"]
+ "$GPGGA,154925.920,5209.732,N,00600.240,E,1,12,1.0,0.0,M,0.0,M,,*63",
+ "$GPGSA,A,3,01,02,03,04,05,06,07,08,09,10,11,12,1.0,1.0,1.0*30",
+ "$GPRMC,154925.920,A,5209.732,N,00600.240,E,001.9,059.8,040123,000.0,W*7F"]
4-element Vector{String}:
"$GPRMC,154925.820,A,5209.732,N,00600.240,E,001.9,059.8,040123,000.0,W*7E"
"$GPGGA,154925.920,5209.732,N,00600.240,E,1,12,1.0,0.0,M,0.0,M,,*63"
@@ -22,9 +20,9 @@
"$GPRMC,154925.920,A,5209.732,N,00600.240,E,001.9,059.8,040123,000.0,W*7F"
julia> for str in d
- msg_type = parse_msg!(s, str)
- println(msg_type)
- end
+ msg_type = parse_msg!(s, str)
+ println(msg_type)
+ end
RMC
GGA
GSA
@@ -34,4 +32,4 @@
RMC("GPS", 56965.92, true, 52.1622, 6.004, 1.9, 59.8, "04", "01", "23", -0.0, 'A', true)
julia> s.last_GGA
- GGA("GPS", 56965.92, 52.1622, 6.004, "GPS (SPS)", 12, 1.0, 0.0, 0.0, 0.0, 0, true)
sourceNMEAParser.pos_convert
— Methodpos_convert(flag::Char, value::Float64)::Float64
A function that converts a position value from one unit to another.
Arguments
flag::Char
: The flag that indicates the original unit of the position value. Possible values are 'F' for feet, 'N' for miles, 'K' for kilometers, and 'M' for meters.value::Float64
: The position value to be converted.
Returns
A Float64
that represents the position value in meters.
Errors
Throws an exception if the flag is not one of the supported values.
Algorithm
The function uses a simple formula to convert the position value based on the flag. For example, if the flag is 'F', it divides the value by 0.3048 to get the equivalent value in meters.
sourceNMEAParser.update!
— Methodupdate!(s::NMEAData, msg)
Update the corresponding field of s
with the given NMEA message msg
.
Arguments
s::NMEAData
: the NMEA data struct to be updatedmsg
: an NMEA message of type GGA, RMC, GSA, GSV, GBS, VTG, GLL, ZDA, DTM, PASHR, TWPOS or TWHPR
sourceNMEAParser.update
— Methodupdate(msg::T, s::NMEAData) where T <: NMEAString
Update the last received message of type T in the NMEAData object s with the given message msg. Return the updated NMEAData object s.
sourceNMEAParser.vel_convert
— Methodvel_convert(flag::Char, value::Float64)::Float64
A function that converts a velocity value from one unit to another.
Arguments
flag::Char
: The flag that indicates the original unit of the velocity value. Possible values are 'N' for knots, 'K' for kilometers per hour, and 'M' for meters per second.value::Float64
: The velocity value to be converted.
Returns
A Float64
that represents the velocity value in meters per second.
Errors
Throws an exception if the flag is not one of the supported values.
Algorithm
The function uses a simple formula to convert the velocity value based on the flag.
sourceSettings
This document was generated with Documenter.jl version 1.2.1 on Monday 29 January 2024. Using Julia version 1.10.0.
+ GGA("GPS", 56965.92, 52.1622, 6.004, "GPS (SPS)", 12, 1.0, 0.0, 0.0, 0.0, 0, true)
NMEAParser.pos_convert
— Methodpos_convert(flag::Char, value::Float64)::Float64
A function that converts a position value from one unit to another.
Arguments
flag::Char
: The flag that indicates the original unit of the position value. Possible values are 'F' for feet, 'N' for miles, 'K' for kilometers, and 'M' for meters.value::Float64
: The position value to be converted.
Returns
A Float64
that represents the position value in meters.
Errors
Throws an exception if the flag is not one of the supported values.
Algorithm
The function uses a simple formula to convert the position value based on the flag. For example, if the flag is 'F', it divides the value by 0.3048 to get the equivalent value in meters.
NMEAParser.update!
— Methodupdate!(s::NMEAData, msg)
Update the corresponding field of s
with the given NMEA message msg
.
Arguments
s::NMEAData
: the NMEA data struct to be updatedmsg
: an NMEA message of type GGA, RMC, GSA, GSV, GBS, VTG, GLL, ZDA, DTM
NMEAParser.update
— Methodupdate(msg::T, s::NMEAData) where T <: NMEAString
Update the last received message of type T in the NMEAData object s with the given message msg. Return the updated NMEAData object s.
NMEAParser.vel_convert
— Methodvel_convert(flag::Char, value::Float64)::Float64
A function that converts a velocity value from one unit to another.
Arguments
flag::Char
: The flag that indicates the original unit of the velocity value. Possible values are 'N' for knots, 'K' for kilometers per hour, and 'M' for meters per second.value::Float64
: The velocity value to be converted.
Returns
A Float64
that represents the velocity value in meters per second.
Errors
Throws an exception if the flag is not one of the supported values.
Algorithm
The function uses a simple formula to convert the velocity value based on the flag.
NMEAParser.@do_parse
— Macro@do_parse(headers, header_str, items, system, valid)
Macro for parsing NMEA sentences based on predefined headers.
This macro generates code to match the given header_str
against a list of regular expressions provided in the headers
tuple. For each matching header, it generates code to call the corresponding type constructor with the relevant information from the NMEA sentence.
Arguments
headers::Tuple
: A tuple containing pairs of regular expressions and corresponding NMEA types.header_str::AbstractString
: The NMEA sentence header string.items::AbstractString
: The NMEA sentence items.system::AbstractString
: The system identifier.valid::Bool
: A boolean indicating whether the NMEA sentence is valid.
Examples
@do_parse NMEA_TYPES header items system valid