diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 94628e7..162db36 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.0","generation_timestamp":"2024-01-29T10:28:53","documenter_version":"1.2.1"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.1","generation_timestamp":"2024-02-15T21:33:52","documenter_version":"1.2.1"}} \ No newline at end of file diff --git a/dev/index.html b/dev/index.html index 80e0978..78a49b1 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,20 +1,18 @@ -Home · NMEAParser.jl

NMEAParser

Documentation for NMEAParser.

NMEAParser.DTMType
DTM <: 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

source
NMEAParser.GBSType
GBS(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.

source
NMEAParser.GGAType
GGA(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

source
NMEAParser.GLLType
GLL <: 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 degrees
  • longitude::Float64: the longitude of the position in decimal degrees
  • time::Float64: the UTC time of the position in seconds
  • status::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.

source
NMEAParser.GSAType
GSA(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

source
NMEAParser.GSVType
GSV <: 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 cycle
  • msg_num::Int: the sequence number of this message in this cycle
  • sat_total::Int: the total number of satellites in view
  • SV_data::Vector{Int}: an array of SVData structs, each containing information about one satellite in view
  • 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 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

source
NMEAParser.NMEADataType
NMEAData()

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 none
  • last_RMC::Union{Nothing, RMC}: the last RMC message parsed, or nothing if none
  • last_GSA::Union{Nothing, GSA}: the last GSA message parsed, or nothing if none
  • last_GSV::Union{Nothing, GSV}: the last GSV message parsed, or nothing if none
  • last_GBS::Union{Nothing, GBS}: the last GBS message parsed, or nothing if none
  • last_VTG::Union{Nothing, VTG}: the last VTG message parsed, or nothing if none
  • last_GLL::Union{Nothing, GLL}: the last GLL message parsed, or nothing if none
  • last_ZDA::Union{Nothing, ZDA}: the last ZDA message parsed, or nothing if none
  • last_DTM::Union{Nothing, DTM}: the last DTM message parsed, or nothing if none
  • last_PASHR::Union{Nothing, PASHR}: the last PASHR message parsed, or nothing if none
  • last_TWPOS::Union{Nothing, TWPOS}: the last TWPOS message parsed, or nothing if none
  • last_TWHPR::Union{Nothing, TWHPR}: the last TWHPR message parsed, or nothing if none
source
NMEAParser.PASHRType
PASHR(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

source
NMEAParser.RMCType
RMC <: 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.

source
NMEAParser.SVDataType
SVData <: 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 system
  • elevation::Int: the elevation angle of the satellite in degrees, relative to the horizon
  • azimuth::Int: the azimuth angle of the satellite in degrees, relative to the true north
  • SNR::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.

source
NMEAParser.TWHPRType
TWHPR <: 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 to true.

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)
source
NMEAParser.TWPOSType
TWPOS(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.

source
NMEAParser.VTGType
VTG <: 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.
source
NMEAParser.ZDAType
ZDA(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

source
Base.parseMethod
parse(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.

source
Base.pop!Method
pop!(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.

source
NMEAParser._dms_to_ddMethod
_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 seconds
  • hemi: 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.DTMType
struct 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"])
source
NMEAParser.GBSType
struct 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"])
source
NMEAParser.GGAType
struct 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"])
source
NMEAParser.GLLType
struct 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"])
source
NMEAParser.GSAType
struct 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"])
source
NMEAParser.GSVType
struct 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"])
source
NMEAParser.NMEADataType
NMEAData()

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 none
  • last_RMC::Union{Nothing, RMC}: the last RMC message parsed, or nothing if none
  • last_GSA::Union{Nothing, GSA}: the last GSA message parsed, or nothing if none
  • last_GSV::Union{Nothing, GSV}: the last GSV message parsed, or nothing if none
  • last_GBS::Union{Nothing, GBS}: the last GBS message parsed, or nothing if none
  • last_VTG::Union{Nothing, VTG}: the last VTG message parsed, or nothing if none
  • last_GLL::Union{Nothing, GLL}: the last GLL message parsed, or nothing if none
  • last_ZDA::Union{Nothing, ZDA}: the last ZDA message parsed, or nothing if none
  • last_DTM::Union{Nothing, DTM}: the last DTM message parsed, or nothing if none
source
NMEAParser.PASHRType
struct 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"])
source
NMEAParser.PTACCType
struct 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"])
source
NMEAParser.PTGYRType
struct 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"])
source
NMEAParser.PTWHPRType
struct 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"])
source
NMEAParser.PTWPLSType
struct 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"])
source
NMEAParser.PTWPOSType
struct 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"])
source
NMEAParser.PTWVCTType
struct 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"])
source
NMEAParser.PTWWHEType
struct 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"])
source
NMEAParser.RMCType
struct 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"])
source
NMEAParser.VTGType
struct 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"])
source
NMEAParser.ZDAType
struct 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"])
source
Base.pop!Method
pop!(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.

source
NMEAParser._dms_to_ddMethod
_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 seconds
  • hemi: 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)
source
NMEAParser._hms_to_secsMethod
_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)
source
NMEAParser.get_systemMethod
get_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)
source
NMEAParser._hms_to_secsMethod
_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)
source
NMEAParser.get_systemMethod
get_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

source
NMEAParser.is_string_supportedMethod
is_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
source
NMEAParser.parse_msg!Method
parse_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

source
NMEAParser.is_string_supportedMethod
is_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
source
NMEAParser.nmea_parseMethod
nmea_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,")
source
NMEAParser.parse_msg!Method
parse_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)
source
NMEAParser.pos_convertMethod
pos_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.

source
NMEAParser.update!Method
update!(s::NMEAData, msg)

Update the corresponding field of s with the given NMEA message msg.

Arguments

  • s::NMEAData: the NMEA data struct to be updated
  • msg: an NMEA message of type GGA, RMC, GSA, GSV, GBS, VTG, GLL, ZDA, DTM, PASHR, TWPOS or TWHPR
source
NMEAParser.updateMethod
update(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.

source
NMEAParser.vel_convertMethod
vel_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.

source
+ GGA("GPS", 56965.92, 52.1622, 6.004, "GPS (SPS)", 12, 1.0, 0.0, 0.0, 0.0, 0, true)
source
NMEAParser.pos_convertMethod
pos_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.

source
NMEAParser.update!Method
update!(s::NMEAData, msg)

Update the corresponding field of s with the given NMEA message msg.

Arguments

  • s::NMEAData: the NMEA data struct to be updated
  • msg: an NMEA message of type GGA, RMC, GSA, GSV, GBS, VTG, GLL, ZDA, DTM
source
NMEAParser.updateMethod
update(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.

source
NMEAParser.vel_convertMethod
vel_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.

source
NMEAParser.@do_parseMacro
@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
source
diff --git a/dev/search_index.js b/dev/search_index.js index cf7d88b..bd608c0 100644 --- a/dev/search_index.js +++ b/dev/search_index.js @@ -1,3 +1,3 @@ var documenterSearchIndex = {"docs": -[{"location":"","page":"Home","title":"Home","text":"CurrentModule = NMEAParser","category":"page"},{"location":"#NMEAParser","page":"Home","title":"NMEAParser","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Documentation for NMEAParser.","category":"page"},{"location":"","page":"Home","title":"Home","text":"","category":"page"},{"location":"","page":"Home","title":"Home","text":"Modules = [NMEAParser]","category":"page"},{"location":"#NMEAParser.DTM","page":"Home","title":"NMEAParser.DTM","text":"DTM <: NMEAString\n\nA 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].\n\nFields\n\nsystem::String: The system identifier, indicating the source of the message (e.g. \"GPS\", \"GLONASS\", \"UNKNOWN\").\nlocal_datum_code::String: The local datum code (CCC), which can be one of the following values[^1^][1]:\nW84 – WGS-84\nW72 – WGS-72\nS85 – SGS85\nP90 – PE90\n999 – User-defined IHO datum code\nlocal_datum_subcode::String: The local datum subdivision code (x).\nlat_offset::Float64: The latitude offset, in minutes (x.x). A negative value indicates south and a positive value indicates north.\nlong_offset::Float64: The longitude offset, in minutes (x.x). A negative value indicates west and a positive value indicates east.\nalt_offset::Float64: The altitude offset, in meters (x.x).\nref_datum::String: The reference datum code (CCC), which can be one of the following values[^1^][1]:\nW84 – WGS-84\nW72 – WGS-72\nS85 – SGS85\nP90 – PE90\n999 – User-defined IHO datum code\nvalid::Bool: A flag indicating whether the message is valid or not.\n\nConstructor\n\nThe 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.\n\nExample\n\n$GPDTM,W84,,0.000000,N,0.000000,E,0.0,W84*6F\n\n\n\n\n\n","category":"type"},{"location":"#NMEAParser.GBS","page":"Home","title":"NMEAParser.GBS","text":"GBS(items::Array{D}; system::AbstractString = \"UNKNOWN\", valid = true)\n\nA 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).\n\nFields\n\nsystem::String: The name of the system that produced the message.\ntime::Float64: The time of the message in seconds since midnight UTC.\nlat_error::Float64: The expected error in latitude in meters.\nlong_error::Float64: The expected error in longitude in meters.\nalt_error::Float64: The expected error in altitude in meters.\nfailed_PRN::Int: The pseudo-random noise (PRN) number of the satellite that has failed or is likely to fail.\nprob_of_missed::Float64: The probability of missed detection for the failed satellite.\nexcluded_meas_err::Float64: The estimated error caused by excluding the measurement from the failed satellite.\nstandard_deviation::Float64: The standard deviation of the residual errors for all satellites used in the position fix.\nvalid::Bool: A flag that indicates whether the message is valid or not.\n\nConstructor\n\nThe 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.\n\n\n\n\n\n","category":"type"},{"location":"#NMEAParser.GGA","page":"Home","title":"NMEAParser.GGA","text":"GGA(items::Array{D}; system::AbstractString = \"UNKNOWN\", valid = true)\n\nA 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.\n\nArguments\n\nitems::Array{D}: An array of strings that contains the fields of the GGA sentence, separated by commas.\nsystem::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\".\nvalid::Bool: An optional keyword argument that indicates whether the GGA sentence is valid or not. The default value is true.\n\nReturns\n\nA GGA object with the following fields:\nsystem::String: The type of GPS system used.\ntime::Float64: The UTC time of the fix in seconds.\nlatitude::Float64: The latitude of the position in decimal degrees.\nlongitude::Float64: The longitude of the position in decimal degrees.\nfix_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\".\nnum_sats::Int: The number of satellites used in the fix.\nHDOP::Float64: The horizontal dilution of precision (HDOP) of the fix.\naltitude::Float64: The altitude above mean sea level (MSL) in meters.\ngeoidal_seperation::Float64: The difference between the WGS-84 earth ellipsoid and mean sea level (MSL) in meters.\nage_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.\ndiff_reference_id::Int: The differential reference station ID.\nvalid::Bool: Whether the GGA sentence is valid or not.\n\nThe 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:\n\n$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47\n\nThis 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\n\n\n\n\n\n","category":"type"},{"location":"#NMEAParser.GLL","page":"Home","title":"NMEAParser.GLL","text":"GLL <: NMEAString\n\nA struct for handling NMEA message data of type GLL, which contains geographic position and time information.\n\nFields\n\nsystem::String: the name of the GNSS system that produced the data (e.g. \"GPS\", \"GLONASS\", etc.)\nlatitude::Float64: the latitude of the position in decimal degrees\nlongitude::Float64: the longitude of the position in decimal degrees\ntime::Float64: the UTC time of the position in seconds\nstatus::Bool: whether the position is valid (true) or not (false)\nmode::Char: the mode indicator of the position fix (e.g. 'A' for autonomous, 'D' for differential, etc.)\nvalid::Bool: whether the message data is valid (true) or not (false)\n\nConstructor\n\nThe 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.\n\nThe 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.\n\n\n\n\n\n","category":"type"},{"location":"#NMEAParser.GSA","page":"Home","title":"NMEAParser.GSA","text":"GSA(items::Array{D}; system::AbstractString = \"UNKNOWN\", valid = true)\n\nA 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).\n\nArguments\n\nitems::Array{D}: An array of strings that contains the fields of the GSA sentence, separated by commas.\nsystem::AbstractString: An optional keyword argument that specifies the type of GPS system used.\n\nIt can be \"GPS\", \"GLONASS\", \"GALILEO\", or \"Combined\". The default value is \"UNKNOWN\".\n\nvalid::Bool: An optional keyword argument that indicates whether the GSA sentence is valid or not. The default value is true.\n\nReturns\n\nA GSA object with the following fields:\nsystem::String: The type of GPS system used.\nmode::Char: The mode of operation. It can be 'A' for automatic or 'M' for manual.\ncurrent_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.\nsat_ids::Vector{Int}: A vector of integers that contains the IDs of the satellites used in the fix.\nPDOP::Float64: The position dilution of precision (PDOP) of the fix.\nHDOP::Float64: The horizontal dilution of precision (HDOP) of the fix.\nVDOP::Float64: The vertical dilution of precision (VDOP) of the fix.\nvalid::Bool: Whether the GSA sentence is valid or not.\n\nThe 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:\n\n$GNGSA,A,3,21,5,29,25,12,10,26,2,,,,,1.2,0.7,1.0*27\n\nThis 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\n\n\n\n\n\n","category":"type"},{"location":"#NMEAParser.GSV","page":"Home","title":"NMEAParser.GSV","text":"GSV <: NMEAString\n\nA struct for handling NMEA message data of type GSV, which contains information about the GNSS satellites in view.\n\nFields\n\nsystem::String: the name of the GNSS system that produced the data (e.g. \"GPS\", \"GLONASS\", etc.)\nmsg_total::Int: the total number of GSV messages in this cycle\nmsg_num::Int: the sequence number of this message in this cycle\nsat_total::Int: the total number of satellites in view\nSV_data::Vector{Int}: an array of SVData structs, each containing information about one satellite in view\nvalid::Bool: whether the message data is valid (true) or not (false)\n\nConstructor\n\nThe 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.\n\nThe 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\n\n\n\n\n\n","category":"type"},{"location":"#NMEAParser.NMEAData","page":"Home","title":"NMEAParser.NMEAData","text":"NMEAData()\n\nA mutable struct that stores the last parsed NMEA messages of different types.\n\nFields\n\nlast_GGA::Union{Nothing, GGA}: the last GGA message parsed, or nothing if none\nlast_RMC::Union{Nothing, RMC}: the last RMC message parsed, or nothing if none\nlast_GSA::Union{Nothing, GSA}: the last GSA message parsed, or nothing if none\nlast_GSV::Union{Nothing, GSV}: the last GSV message parsed, or nothing if none\nlast_GBS::Union{Nothing, GBS}: the last GBS message parsed, or nothing if none\nlast_VTG::Union{Nothing, VTG}: the last VTG message parsed, or nothing if none\nlast_GLL::Union{Nothing, GLL}: the last GLL message parsed, or nothing if none\nlast_ZDA::Union{Nothing, ZDA}: the last ZDA message parsed, or nothing if none\nlast_DTM::Union{Nothing, DTM}: the last DTM message parsed, or nothing if none\nlast_PASHR::Union{Nothing, PASHR}: the last PASHR message parsed, or nothing if none\nlast_TWPOS::Union{Nothing, TWPOS}: the last TWPOS message parsed, or nothing if none\nlast_TWHPR::Union{Nothing, TWHPR}: the last TWHPR message parsed, or nothing if none\n\n\n\n\n\n","category":"type"},{"location":"#NMEAParser.PASHR","page":"Home","title":"NMEAParser.PASHR","text":"PASHR(system, time, heading, heading_type, roll, pitch, heave, roll_accuracy,\n pitch_accuracy, heading_accuracy, aiding_code, ins_code, valid)\n\nA struct that represents a PASHR NMEA string, which is a message that contains position and attitude data from an inertial navigation system (INS).\n\nFields\n\nsystem::String: The name of the system that produced the message.\ntime::Float64: The time of the message in seconds since midnight UTC.\nheading::Float64: The heading angle in degrees clockwise from north.\nheading_type::Char: The type of heading: 'T' for true or 'M' for magnetic.\nroll::Float64: The roll angle in degrees. Positive values indicate right roll.\npitch::Float64: The pitch angle in degrees. Positive values indicate nose up.\nheave::Float64: The heave displacement in meters. Positive values indicate upward motion.\nroll_accuracy::Float64: The standard deviation of the roll angle in degrees.\npitch_accuracy::Float64: The standard deviation of the pitch angle in degrees.\nheading_accuracy::Float64: The standard deviation of the heading angle in degrees.\naiding_code::Int: A code that indicates the type of aiding used by the INS.\nins_code::Int: A code that indicates the status of the INS.\nvalid::Bool: A flag that indicates whether the message is valid or not.\n\nConstructor\n\nThe 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.\n\nExample\n\n$PASHR,154155.50,153.17,T,9.68,2.29,-0.07,0.502,0.502,0.959,1*19\n\n\n\n\n\n","category":"type"},{"location":"#NMEAParser.RMC","page":"Home","title":"NMEAParser.RMC","text":"RMC <: NMEAString\n\nA 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.\n\nFields\n\nsystem::String: The system identifier, indicating the source of the message (e.g. \"GPS\", \"GLONASS\", \"UNKNOWN\").\ntime::Float64: The UTC time of the position fix, in seconds since midnight.\nstatus::Bool: The status indicator, either true for active or false for void (invalid).\nlatitude::Float64: The latitude of the position, in decimal degrees.\nlongitude::Float64: The longitude of the position, in decimal degrees.\nsog::Float64: The speed over ground, in knots.\ncog::Float64: The track angle, in degrees true (not magnetic).\nday::String: The day of the position fix, in two digits.\nmonth::String: The month of the position fix, in two digits.\nyear::String: The year of the position fix, in two digits.\nmagvar::Float64: The magnetic variation, in degrees. A negative value indicates west and a positive value indicates east.\nmode::Char: The mode indicator, indicating the type of fix. It can be one of the following values:\n'A' for autonomous (GPS only)\n'D' for differential (DGPS)\n'E' for estimated\n'F' for float RTK\n'M' for manual input\n'N' for no fix\n'P' for precise\n'R' for real time kinematic\n'S' for simulator\nvalid::Bool: A flag indicating whether the message is valid or not.\n\nConstructor\n\nThe 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.\n\n\n\n\n\n","category":"type"},{"location":"#NMEAParser.SVData","page":"Home","title":"NMEAParser.SVData","text":"SVData <: NMEAString\n\nA struct for handling NMEA message data of type SVData, which contains information about one satellite in view of a GNSS receiver.\n\nFields\n\nPRN::Int: the PRN number of the satellite, which identifies it uniquely within its system\nelevation::Int: the elevation angle of the satellite in degrees, relative to the horizon\nazimuth::Int: the azimuth angle of the satellite in degrees, relative to the true north\nSNR::Int: the signal-to-noise ratio of the satellite in decibels, which measures the quality of the signal received from the satellite\n\nThe 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.\n\n\n\n\n\n","category":"type"},{"location":"#NMEAParser.TWHPR","page":"Home","title":"NMEAParser.TWHPR","text":"TWHPR <: NMEAString\n\nA Julia struct representing the TWHPR NMEA string, which contains information about a system, heading, pitch, roll, and validity status.\n\nFields\n\nsystem::String: The system identifier.\nheading::Float64: The heading value.\npitch::Float64: The pitch value.\nroll::Float64: The roll value.\nvalid::Bool: A boolean indicating the validity of the data.\n\nConstructor\n\nTWHPR(items::Array{D}; system::AbstractString = \"UNKNOWN\", valid = true) where D <: SubString\n\nConstructs a TWHPR object from an array of string items, such as those parsed from a NMEA sentence.\n\nParameters\n\nitems::Array{D}: An array of string items representing the parsed NMEA sentence.\nsystem::AbstractString: (Optional) The system identifier. Defaults to \"UNKNOWN\".\nvalid::Bool: (Optional) The validity status. Defaults to true.\n\nReturns\n\nA TWHPR object with fields populated based on the provided items and optional parameters.\n\nExample\n\ndata = [\"PTWHPR\", \"161540.45\", \"12.456\", \"78.901\", \"2.34\", \"79.912\", \"0.12*2C\"]\ntwhpr = TWHPR(data, system=\"NAV\", valid=true)\n\n\n\n\n\n","category":"type"},{"location":"#NMEAParser.TWPOS","page":"Home","title":"NMEAParser.TWPOS","text":"TWPOS(system, time, xpose, ypose, zpose, distance, velocity, valid)\n\nA struct that represents a TWPOS NMEA string, which is a message that contains the position and velocity data from a transponder.\n\nFields\n\nsystem::String: The name of the system that produced the message.\ntime::Float64: The time of the message in seconds since midnight UTC.\nxpose::Float64: The x-coordinate of the position in meters.\nypose::Float64: The y-coordinate of the position in meters.\nzpose::Float64: The z-coordinate of the position in meters.\ndistance::Float64: The distance from the origin in meters.\nvelocity::Float64: The velocity in meters per second.\nvalid::Bool: A flag that indicates whether the message is valid or not.\n\nConstructor\n\nThe 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.\n\n\n\n\n\n","category":"type"},{"location":"#NMEAParser.VTG","page":"Home","title":"NMEAParser.VTG","text":"VTG <: NMEAString\n\nA 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.\n\nFields\n\nsystem::String: The system identifier, indicating the source of the message (e.g. \"GPS\", \"GLONASS\", \"UNKNOWN\").\nCoG_true::Float64: The track made good (degrees true).\nCoG_mag::Float64: The track made good (degrees magnetic).\nSoG_knots::Float64: The speed over ground, in knots.\nSoG_kmhr::Float64: The speed over ground, in kilometers per hour (kph).\nmode::Char: The mode indicator, indicating the type of fix. It can be one of the following values:\n'A' for autonomous (GPS only)\n'D' for differential (DGPS)\n'E' for estimated (dead reckoning) mode\n'M' for manual input mode\n'S' for simulator mode\n'N' for data not valid\nvalid::Bool: A flag indicating whether the message is valid or not.\n\nConstructor\n\nThe 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.\n\nExample\n\nA message has the following format: $GPVTG,x.x,T,x.x,M,x.x,N,x.x,K,m*hh\n\nFor example, the following VTG message:\n\n$GPVTG,140.88,T,M,8.04,N,14.89,K,D*05\n\nMeans that:\n\nThe track made good is 140.88 degrees true.\nThe track made good is not available in degrees magnetic.\nThe speed over ground is 8.04 knots.\nThe speed over ground is 14.89 kph.\nThe mode indicator is differential (DGPS).\nThe checksum data is 05.\n\n\n\n\n\n","category":"type"},{"location":"#NMEAParser.ZDA","page":"Home","title":"NMEAParser.ZDA","text":"ZDA(items::Array{D}; system::AbstractString = \"UNKNOWN\", valid = true)\n\nA 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.\n\nArguments\n\nitems::Array{D}: An array of strings that contains the fields of the ZDA sentence, separated by commas.\nsystem::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\".\nvalid::Bool: An optional keyword argument that indicates whether the ZDA sentence is valid or not. The default value is true.\n\nReturns\n\nA ZDA object with the following fields:\nsystem::String: The type of GPS system used.\ntime::Float64: The UTC time of the fix in seconds.\nday::Int: The day of the month (1-31).\nmonth::Int: The month of the year (1-12).\nyear::Int: The year (four digits).\nzone_hrs::Int: The local time zone offset from UTC in hours.\nzone_mins::Int: The local time zone offset from UTC in minutes.\nvalid::Bool: Whether the ZDA sentence is valid or not.\n\nAn example of a ZDA sentence is:\n\n$GPZDA,201530.00,04,07,2002,00,00*60\n\nThis 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.\n\nThe 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\n\n\n\n\n\n","category":"type"},{"location":"#Base.parse-Tuple{AbstractString}","page":"Home","title":"Base.parse","text":"parse(nmea_string::AbstractString)\n\nA function that parses a NMEA string, which is a standard format for data transmission from marine and navigation devices.\n\nArguments\n\nnmea_string::AbstractString: The NMEA string to be parsed.\nvalidate_checksum (optional): Default=true. Setting to false skips validating the checksum. \n\nReturns\n\nA 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.\n\nErrors\n\nThrows an ArgumentError if the NMEA string is not supported or has an invalid format.\n\nAlgorithm\n\nThe 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.\n\n\n\n\n\n","category":"method"},{"location":"#Base.pop!-Tuple{NMEAData, Type{GGA}}","page":"Home","title":"Base.pop!","text":"pop!(nmea_data::NMEAData, ::Type{T}) where T <: NMEAString\n\nPop 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.\n\n\n\n\n\n","category":"method"},{"location":"#NMEAParser._dms_to_dd-Tuple{SubString, SubString}","page":"Home","title":"NMEAParser._dms_to_dd","text":"_dms_to_dd(dms::SubString, hemi::SubString)\n\nConverts a string representing degrees, minutes and seconds (DMS) to decimal degrees.\n\nArguments\n\ndms: a substring representing degrees, minutes and seconds\nhemi: a substring representing the hemisphere\n\nReturns\n\ndec_degrees: the decimal degree representation of the input DMS\n\nExample\n\ndms = \"4807.038\"\nhemi = \"N\"\ndec_degrees = _dms_to_dd(dms, hemi)\n\n\n\n\n\n","category":"method"},{"location":"#NMEAParser._hms_to_secs-Tuple{SubString}","page":"Home","title":"NMEAParser._hms_to_secs","text":"_hms_to_secs(hms::SubString)\n\nConverts a string representing hours, minutes and seconds (HMS) to seconds.\n\nArguments\n\nhms: a substring representing hours, minutes and seconds\n\nReturns\n\nseconds: the number of seconds represented by the input HMS\n\nExample\n\nhms = \"123519\"\nseconds = _hms_to_secs(hms)\n\n\n\n\n\n","category":"method"},{"location":"#NMEAParser.get_system-Tuple{SubString}","page":"Home","title":"NMEAParser.get_system","text":"get_system(mtype::SubString)\n\nDetermine the system type based on the input mtype.\n\nArguments\n\nmtype: A SubString representing the message type.\n\nReturns\n\nA string representing the system type. Possible values are \"GPS\", \"GLONASS\", \"GALILEO\", \"COMBINED\", and \"UNKNOWN\".\n\nExamples\n\nget_system(\"$GPGGA\") # \"GPS\"\nget_system(\"$GLGSV\") # \"GLONASS\"\nget_system(\"$GAGGA\") # \"GALILEO\"\nget_system(\"$GNGNS\") # \"COMBINED\"\nget_system(\"$PMTK\") # \"UNKNOWN\"\n\nTODO: 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\n\n\n\n\n\n","category":"method"},{"location":"#NMEAParser.is_string_supported-Tuple{AbstractString}","page":"Home","title":"NMEAParser.is_string_supported","text":"is_string_supported(nmea_string::AbstractString)\n\nCheck if the input NMEA string type is supported.\n\nArguments\n\nnmea_string::AbstractString: The NMEA string to be checked.\n\nReturns\n\nBool: true if the NMEA string is supported, false otherwise.\n\nExample\n\njulia> is_string_supported(\"$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47\")\ntrue\n\n\n\n\n\n","category":"method"},{"location":"#NMEAParser.parse_msg!-Tuple{NMEAData, AbstractString}","page":"Home","title":"NMEAParser.parse_msg!","text":"parse_msg!(s::NMEAData, line::AbstractString)\n\nParse a line of NMEA 0183 data and update the state of an NMEAData object.\n\nArguments\n\ns : NMEAData An object that stores the parsed data from NMEA messages. line : AbstractString A string that contains a valid NMEA 0183 message.\n\nReturns\n\nDataType The type of the parsed message, or Nothing if the message is not supported.\n\nErrors\n\nArgumentError If the line is not a valid NMEA 0183 message.\n\nExample\n\ns = NMEAData()\n\njulia> d = [ \"$GPRMC,154925.820,A,5209.732,N,00600.240,E,001.9,059.8,040123,000.0,W*7E\",\n \"$GPGGA,154925.920,5209.732,N,00600.240,E,1,12,1.0,0.0,M,0.0,M,,*63\",\n \"$GPGSA,A,3,01,02,03,04,05,06,07,08,09,10,11,12,1.0,1.0,1.0*30\",\n \"$GPRMC,154925.920,A,5209.732,N,00600.240,E,001.9,059.8,040123,000.0,W*7F\"]\n4-element Vector{String}:\n \"$GPRMC,154925.820,A,5209.732,N,00600.240,E,001.9,059.8,040123,000.0,W*7E\"\n \"$GPGGA,154925.920,5209.732,N,00600.240,E,1,12,1.0,0.0,M,0.0,M,,*63\"\n \"$GPGSA,A,3,01,02,03,04,05,06,07,08,09,10,11,12,1.0,1.0,1.0*30\"\n \"$GPRMC,154925.920,A,5209.732,N,00600.240,E,001.9,059.8,040123,000.0,W*7F\"\n\n julia> for str in d\n msg_type = parse_msg!(s, str)\n println(msg_type)\n end\n RMC\n GGA\n GSA\n RMC\n\n julia> s.last_RMC\n RMC(\"GPS\", 56965.92, true, 52.1622, 6.004, 1.9, 59.8, \"04\", \"01\", \"23\", -0.0, 'A', true)\n\n julia> s.last_GGA\n GGA(\"GPS\", 56965.92, 52.1622, 6.004, \"GPS (SPS)\", 12, 1.0, 0.0, 0.0, 0.0, 0, true)\n\n\n\n\n\n","category":"method"},{"location":"#NMEAParser.pos_convert-Tuple{Char, Float64}","page":"Home","title":"NMEAParser.pos_convert","text":"pos_convert(flag::Char, value::Float64)::Float64\n\nA function that converts a position value from one unit to another.\n\nArguments\n\nflag::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.\nvalue::Float64: The position value to be converted.\n\nReturns\n\nA Float64 that represents the position value in meters.\n\nErrors\n\nThrows an exception if the flag is not one of the supported values.\n\nAlgorithm\n\nThe 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.\n\n\n\n\n\n","category":"method"},{"location":"#NMEAParser.update!-Tuple{NMEAData, GGA}","page":"Home","title":"NMEAParser.update!","text":"update!(s::NMEAData, msg)\n\nUpdate the corresponding field of s with the given NMEA message msg.\n\nArguments\n\ns::NMEAData: the NMEA data struct to be updated\nmsg: an NMEA message of type GGA, RMC, GSA, GSV, GBS, VTG, GLL, ZDA, DTM, PASHR, TWPOS or TWHPR\n\n\n\n\n\n","category":"method"},{"location":"#NMEAParser.update-Tuple{GGA, NMEAData}","page":"Home","title":"NMEAParser.update","text":"update(msg::T, s::NMEAData) where T <: NMEAString\n\nUpdate the last received message of type T in the NMEAData object s with the given message msg. Return the updated NMEAData object s.\n\n\n\n\n\n","category":"method"},{"location":"#NMEAParser.vel_convert-Tuple{Char, Float64}","page":"Home","title":"NMEAParser.vel_convert","text":"vel_convert(flag::Char, value::Float64)::Float64\n\nA function that converts a velocity value from one unit to another.\n\nArguments\n\nflag::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.\nvalue::Float64: The velocity value to be converted.\n\nReturns\n\nA Float64 that represents the velocity value in meters per second.\n\nErrors\n\nThrows an exception if the flag is not one of the supported values.\n\nAlgorithm\n\nThe function uses a simple formula to convert the velocity value based on the flag.\n\n\n\n\n\n","category":"method"}] +[{"location":"","page":"Home","title":"Home","text":"CurrentModule = NMEAParser","category":"page"},{"location":"#NMEAParser","page":"Home","title":"NMEAParser","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Documentation for NMEAParser.","category":"page"},{"location":"","page":"Home","title":"Home","text":"","category":"page"},{"location":"","page":"Home","title":"Home","text":"Modules = [NMEAParser]","category":"page"},{"location":"#NMEAParser.DTM","page":"Home","title":"NMEAParser.DTM","text":"struct DTM <: NMEAString\n\nDatum Reference (DTM)\n\nThis NMEA data type represents information about a datum reference.\n\nFields\n\nsystem::String: GNSS system identifier (e.g., GPS, GLONASS, GALILEO, Combined).\nlocal_datum_code::String: Local datum code.\nlocal_datum_subcode::String: Local datum subcode.\nlat_offset::Float64: Latitude offset in meters.\nlong_offset::Float64: Longitude offset in meters.\nalt_offset::Float64: Altitude offset in meters.\nref_datum::String: Reference datum.\nvalid::Bool: Flag indicating the validity of the data.\n\nConstructor\n\nDTM(items::Array{D}; system::AbstractString = \"UNKNOWN\", valid = true) where D <: SubString\n\nExamples\n\ndata = DTM([\"DTM\", \"W84\", \"W\", \"0.5\", \"W\", \"1.0\", \"M\", \"W84\"])\n\n\n\n\n\n","category":"type"},{"location":"#NMEAParser.GBS","page":"Home","title":"NMEAParser.GBS","text":"struct GBS <: NMEAString\n\nGNSS Satellite Fault Detection (GBS)\n\nThis NMEA data type represents information about satellite fault detection, including error estimates and probabilities.\n\nFields\n\nsystem::String: GNSS system identifier (e.g., GPS, GLONASS, GALILEO, Combined).\ntime::Float64: Time in seconds.\nlat_error::Float64: Latitude error estimate.\nlong_error::Float64: Longitude error estimate.\nalt_error::Float64: Altitude error estimate.\nfailed_PRN::Int: PRN of the failed satellite.\nprob_of_missed::Float64: Probability of missed detection.\nexcluded_meas_err::Float64: Excluded measurement error.\nstandard_deviation::Float64: Standard deviation of the measurements.\nvalid::Bool: Flag indicating the validity of the data.\n\nConstructor\n\nGBS(items::Array{D}; system::AbstractString = \"UNKNOWN\", valid = true) where D <: SubString\n\nExamples\n\ndata = GBS([\"GBS\", \"123456\", \"0.1\", \"0.2\", \"0.3\", \"5\", \"0.01\", \"0.05\", \"0.02\"])\n\n\n\n\n\n","category":"type"},{"location":"#NMEAParser.GGA","page":"Home","title":"NMEAParser.GGA","text":"struct GGA <: NMEAString\n\nGPS Fix Data (GGA)\n\nThis NMEA data type represents information about the GPS fix, including latitude, longitude, altitude, number of satellites, and accuracy measures.\n\nFields\n\nsystem::String: GPS, GLONASS, GALILEO, or Combined.\ntime::Float64: Time in seconds.\nlatitude::Float64: Latitude in decimal degrees.\nlongitude::Float64: Longitude in decimal degrees.\nfix_quality::String: Quality of the fix.\nnum_sats::Int: Number of satellites used in the fix.\nHDOP::Float64: Horizontal Dilution of Precision.\naltitude::Float64: Altitude above mean sea level (MSL) in meters.\ngeoidal_separation::Float64: Geoidal separation in meters.\nage_of_differential::Float64: Age of the differential data.\ndiff_reference_id::Int: Differential reference station ID.\nvalid::Bool: Flag indicating the validity of the data.\n\nConstructor\n\nGGA(items::Array{D}; system::AbstractString = \"UNKNOWN\", valid = true) where D <: SubString\n\nExamples\n\ndata = GGA([\"GGA\", \"123456\", \"123.456\", \"N\", \"987.654\", \"W\", \"1\", \"8\", \"0.9\", \"123.4\", \"M\", \"54.3\", \"M\", \"1\"])\n\n\n\n\n\n","category":"type"},{"location":"#NMEAParser.GLL","page":"Home","title":"NMEAParser.GLL","text":"struct GLL <: NMEAString\n\nGeographic Latitude and Longitude (GLL)\n\nThis NMEA data type represents information about geographic latitude and longitude.\n\nFields\n\nsystem::String: GNSS system identifier (e.g., GPS, GLONASS, GALILEO, Combined).\nlatitude::Float64: Latitude in decimal degrees.\nlongitude::Float64: Longitude in decimal degrees.\ntime::Float64: Time in seconds.\nstatus::Bool: Status indicator (true if valid fix, false otherwise).\nmode::Char: Mode indicator ('A' for autonomous mode).\nvalid::Bool: Flag indicating the validity of the data.\n\nConstructor\n\nGLL(items::Array{D}; system::AbstractString = \"UNKNOWN\", valid = true) where D <: SubString\n\nExamples\n\ndata = GLL([\"GLL\", \"12.3456\", \"N\", \"98.7654\", \"W\", \"123456\", \"A\"])\n\n\n\n\n\n","category":"type"},{"location":"#NMEAParser.GSA","page":"Home","title":"NMEAParser.GSA","text":"struct GSA <: NMEAString\n\nGNSS DOP and Active Satellites (GSA)\n\nThis NMEA data type represents information about the GNSS Dilution of Precision (DOP) and the active satellites used for navigation.\n\nFields\n\nsystem::String: GNSS system identifier (e.g., GPS, GLONASS, GALILEO, Combined).\nmode::Char: Mode of operation (A = Automatic, M = Manual).\ncurrent_mode::Int: Operating mode (1 = Fix not available, 2 = 2D fix, 3 = 3D fix).\nsat_ids::Vector{Int}: Vector of satellite IDs used in the fix.\nPDOP::Float64: Position Dilution of Precision.\nHDOP::Float64: Horizontal Dilution of Precision.\nVDOP::Float64: Vertical Dilution of Precision.\nvalid::Bool: Flag indicating the validity of the data.\n\nConstructor\n\nGSA(items::Array{D}; system::AbstractString = \"UNKNOWN\", valid = true) where D <: SubString\n\nExamples\n\ndata = GSA([\"GSA\", \"M\", \"3\", \"1\", \"2\", \"3\", \"1.2\", \"0.9\", \"1.5\"])\n\n\n\n\n\n","category":"type"},{"location":"#NMEAParser.GSV","page":"Home","title":"NMEAParser.GSV","text":"struct GSV <: NMEAString\n\nSatellites in View (GSV)\n\nThis NMEA data type represents information about the satellites in view and their signal strength.\n\nFields\n\nsystem::String: GNSS system identifier (e.g., GPS, GLONASS, GALILEO, Combined).\nmsg_total::Int: Total number of GSV messages for this cycle.\nmsg_num::Int: Number of this GSV message.\nsat_total::Int: Total number of satellites in view.\nSV_data::Vector{SVData}: Vector of satellite data, each containing PRN, elevation, azimuth, and SNR.\nvalid::Bool: Flag indicating the validity of the data.\n\nConstructor\n\nGSV(items::Array{D}; system::AbstractString = \"UNKNOWN\", valid = true) where D <: SubString\n\nExamples\n\ndata = GSV([\"GSV\", \"3\", \"1\", \"9\", \"1\", \"01\", \"30\", \"45\", \"20\", \"02\", \"60\", \"180\", \"25\", \"03\", \"15\", \"300\", \"15\"])\n\n\n\n\n\n","category":"type"},{"location":"#NMEAParser.NMEAData","page":"Home","title":"NMEAParser.NMEAData","text":"NMEAData()\n\nA mutable struct that stores the last parsed NMEA messages of different types.\n\nFields\n\nlast_GGA::Union{Nothing, GGA}: the last GGA message parsed, or nothing if none\nlast_RMC::Union{Nothing, RMC}: the last RMC message parsed, or nothing if none\nlast_GSA::Union{Nothing, GSA}: the last GSA message parsed, or nothing if none\nlast_GSV::Union{Nothing, GSV}: the last GSV message parsed, or nothing if none\nlast_GBS::Union{Nothing, GBS}: the last GBS message parsed, or nothing if none\nlast_VTG::Union{Nothing, VTG}: the last VTG message parsed, or nothing if none\nlast_GLL::Union{Nothing, GLL}: the last GLL message parsed, or nothing if none\nlast_ZDA::Union{Nothing, ZDA}: the last ZDA message parsed, or nothing if none\nlast_DTM::Union{Nothing, DTM}: the last DTM message parsed, or nothing if none\n\n\n\n\n\n","category":"type"},{"location":"#NMEAParser.PASHR","page":"Home","title":"NMEAParser.PASHR","text":"struct PASHR <: NMEAString\n\nInertial Attitude Data (PASHR)\n\nThis NMEA data type represents inertial attitude data, including heading, roll, pitch, and heave.\n\nFields\n\nsystem::String: GNSS system identifier (e.g., GPS, GLONASS, GALILEO, Combined).\ntime::Float64: Time in seconds.\nheading::Float64: Heading in decimal degrees.\nheading_type::Bool: True heading indicator (true if heading is relative to true north).\nroll::Float64: Roll in decimal degrees.\npitch::Float64: Pitch in decimal degrees.\nheave::Float64: Heave in meters.\nroll_accuracy::Float64: Roll accuracy (standard deviation in decimal degrees).\npitch_accuracy::Float64: Pitch accuracy (standard deviation in decimal degrees).\nheading_accuracy::Float64: Heading accuracy (standard deviation in decimal degrees).\naiding_code::Int: GPS Update Quality Flag (0 = No position, 1 = Non-RTK fixed, 2 = RTK fixed).\nins_code::Int: INS Status Flag (0 = Pre-Alignment, 1 = Post-Alignment).\nvalid::Bool: Flag indicating the validity of the data.\n\nConstructor\n\nPASHR(items::Array{D}; system::AbstractString = \"UNKNOWN\", valid = true) where D <: SubString\n\nExamples\n\ndata = PASHR([\"PASHR\", \"123456\", \"45.0\", \"T\", \"15.0\", \"-10.0\", \"2.0\", \"0.1\", \"0.1\", \"0.2\", \"2\", \"1\"])\n\n\n\n\n\n","category":"type"},{"location":"#NMEAParser.PTACC","page":"Home","title":"NMEAParser.PTACC","text":"struct PTACC <: NMEAString\n\nIMU Accelerometer (PTACC)\n\nThis NMEA data type represents inertial measurement unit (IMU) accelerometer information.\n\nFields\n\nsystem::String: GNSS system identifier (e.g., GPS, GLONASS, GALILEO, Combined).\ntime::Float64: Time in seconds.\nx::Float64: Acceleration in the X-axis.\ny::Float64: Acceleration in the Y-axis.\nz::Float64: Acceleration in the Z-axis.\nvalid::Bool: Flag indicating the validity of the data.\n\nConstructor\n\nPTACC(items::Array{D}; system::AbstractString = \"UNKNOWN\", valid = true) where D <: SubString\n\nExamples\n\ndata = PTACC([\"PTACC\", \"123456\", \"0.5\", \"1.0\", \"-0.2\"])\n\n\n\n\n\n","category":"type"},{"location":"#NMEAParser.PTGYR","page":"Home","title":"NMEAParser.PTGYR","text":"struct PTGYR <: NMEAString\n\nIMU Gyroscope (PTGYR)\n\nThis NMEA data type represents inertial measurement unit (IMU) gyroscope information.\n\nFields\n\nsystem::String: GNSS system identifier (e.g., GPS, GLONASS, GALILEO, Combined).\ntime::Float64: Time in seconds.\nx::Float64: Angular velocity around the X-axis.\ny::Float64: Angular velocity around the Y-axis.\nz::Float64: Angular velocity around the Z-axis.\nvalid::Bool: Flag indicating the validity of the data.\n\nConstructor\n\nPTGYR(items::Array{D}; system::AbstractString = \"UNKNOWN\", valid = true) where D <: SubString\n\nExamples\n\ndata = PTGYR([\"PTGYR\", \"123456\", \"0.1\", \"-0.2\", \"0.5\"])\n\n\n\n\n\n","category":"type"},{"location":"#NMEAParser.PTWHPR","page":"Home","title":"NMEAParser.PTWHPR","text":"struct PTWHPR <: NMEAString\n\nIMU Heading Pitch Roll (PTWHPR)\n\nThis NMEA data type represents inertial measurement unit (IMU) information, including heading, pitch, and roll.\n\nFields\n\nsystem::String: GNSS system identifier (e.g., GPS, GLONASS, GALILEO, Combined).\ntime::Float64: Time in seconds.\nheading::Float64: Heading in degrees.\npitch::Float64: Pitch in degrees.\nroll::Float64: Roll in degrees.\nvalid::Bool: Flag indicating the validity of the data.\n\nConstructor\n\nPTWHPR(items::Array{D}; system::AbstractString = \"UNKNOWN\", valid = true) where D <: SubString\n\nExamples\n\ndata = PTWHPR([\"PTWHPR\", \"123456\", \"90.0\", \"30.0\", \"-45.0\"])\n\n\n\n\n\n","category":"type"},{"location":"#NMEAParser.PTWPLS","page":"Home","title":"NMEAParser.PTWPLS","text":"struct PTWPLS <: NMEAString\n\nPosition in Pulses (PTWPLS)\n\nThis NMEA data type represents position information in pulses.\n\nFields\n\nsystem::String: GNSS system identifier (e.g., GPS, GLONASS, GALILEO, Combined).\ntime::Float64: Time in seconds.\nx::Float64: X position in pulses.\ny::Float64: Y position in pulses.\nheading::Float64: Heading in degrees.\nvalid::Bool: Flag indicating the validity of the data.\n\nConstructor\n\nPTWPLS(items::Array{D}; system::AbstractString = \"UNKNOWN\", valid = true) where D <: SubString\n\nExamples\n\ndata = PTWPLS([\"PTWPLS\", \"123456\", \"500\", \"P\", \"750\", \"P\", \"90.0\", \"D\"])\n\n\n\n\n\n","category":"type"},{"location":"#NMEAParser.PTWPOS","page":"Home","title":"NMEAParser.PTWPOS","text":"struct PTWPOS <: NMEAString\n\nPosition (PTWPOS)\n\nThis NMEA data type represents position information.\n\nFields\n\nsystem::String: GNSS system identifier (e.g., GPS, GLONASS, GALILEO, Combined).\ntime::Float64: Time in seconds.\nxpose::Float64: X position in meters.\nypose::Float64: Y position in meters.\nzpose::Float64: Z position in meters.\ndistance::Float64: Distance in meters.\nvelocity::Float64: Velocity in kilometers per hour.\ndirection::Char: Direction indicator ('F' for forward, 'B' for backward).\nvalid::Bool: Flag indicating the validity of the data.\n\nConstructor\n\nPTWPOS(items::Array{D}; system::AbstractString = \"UNKNOWN\", valid = true) where D <: SubString\n\nExamples\n\ndata = PTWPOS([\"PTWPOS\", \"123456\", \"45.678\", \"M\", \"123.456\", \"M\", \"789.012\", \"M\", \"456.789\", \"M\", \"5.0\", \"K\", \"F\"])\n\n\n\n\n\n","category":"type"},{"location":"#NMEAParser.PTWVCT","page":"Home","title":"NMEAParser.PTWVCT","text":"struct PTWVCT <: NMEAString\n\nMovement Vector (PTWVCT)\n\nThis NMEA data type represents movement vector information.\n\nFields\n\nsystem::String: GNSS system identifier (e.g., GPS, GLONASS, GALILEO, Combined).\ntime::Float64: Time in seconds.\ndistance_derivative::Float64: Distance derivative in meters.\nheading::Float64: Heading in radians.\ndistance::Float64: Distance in meters.\nspeed::Float64: Speed in meters per second.\nvalid::Bool: Flag indicating the validity of the data.\n\nConstructor\n\nPTWVCT(items::Array{D}; system::AbstractString = \"UNKNOWN\", valid = true) where D <: SubString\n\nExamples\n\ndata = PTWVCT([\"PTWVCT\", \"123456\", \"2.0\", \"M\", \"1.5708\", \"R\", \"5.0\", \"M\"])\n\n\n\n\n\n","category":"type"},{"location":"#NMEAParser.PTWWHE","page":"Home","title":"NMEAParser.PTWWHE","text":"struct PTWWHE <: NMEAString\n\nWheels Information (PTWWHE)\n\nThis NMEA data type represents wheels information.\n\nFields\n\nsystem::String: GNSS system identifier (e.g., GPS, GLONASS, GALILEO, Combined).\ntime::Float64: Time in seconds.\nlw_pulses::Float64: Left wheel pulses.\nlw_distance::Float64: Left wheel distance in meters.\nlw_direction::Char: Left wheel direction indicator ('F' for forward, 'B' for backward).\nrw_pulses::Float64: Right wheel pulses.\nrw_distance::Float64: Right wheel distance in meters.\nrw_direction::Char: Right wheel direction indicator ('F' for forward, 'B' for backward).\nheading::Float64: Heading.\nvalid::Bool: Flag indicating the validity of the data.\n\nConstructor\n\nPTWWHE(items::Array{D}; system::AbstractString = \"UNKNOWN\", valid = true) where D <: SubString\n\nExamples\n\ndata = PTWWHE([\"PTWWHE\", \"123456\", \"500\", \"100.0\", \"M\", \"F\", \"750\", \"150.0\", \"M\", \"B\", \"90.0\"])\n\n\n\n\n\n","category":"type"},{"location":"#NMEAParser.RMC","page":"Home","title":"NMEAParser.RMC","text":"struct RMC <: NMEAString\n\nRecommended Minimum Navigation Information (RMC)\n\nThis NMEA data type represents recommended minimum navigation information.\n\nFields\n\nsystem::String: GNSS system identifier (e.g., GPS, GLONASS, GALILEO, Combined).\ntime::Float64: Time in seconds.\nstatus::Bool: Status indicator (true if valid fix, false otherwise).\nlatitude::Float64: Latitude in decimal degrees.\nlongitude::Float64: Longitude in decimal degrees.\nsog::Float64: Speed over ground in knots.\ncog::Float64: Course over ground in degrees.\nday::String: Day of the month.\nmonth::String: Month of the year.\nyear::String: Year.\nmagvar::Float64: Magnetic variation.\nmode::Char: Mode indicator ('A' for autonomous mode).\nvalid::Bool: Flag indicating the validity of the data.\n\nConstructor\n\nRMC(items::Array{D}; system::AbstractString = \"UNKNOWN\", valid = true) where D <: SubString\n\nExamples\n\ndata = RMC([\"RMC\", \"123456\", \"A\", \"12.3456\", \"N\", \"98.7654\", \"W\", \"5.0\", \"90.0\", \"150225\", \"5.0\", \"W\", \"A\"])\n\n\n\n\n\n","category":"type"},{"location":"#NMEAParser.VTG","page":"Home","title":"NMEAParser.VTG","text":"struct VTG <: NMEAString\n\nTrack Made Good and Ground Speed (VTG)\n\nThis NMEA data type represents information about the track made good (course) and ground speed.\n\nFields\n\nsystem::String: GNSS system identifier (e.g., GPS, GLONASS, GALILEO, Combined).\nCoG_true::Float64: Course over ground in true degrees.\nCoG_mag::Float64: Course over ground in magnetic degrees.\nSoG_knots::Float64: Speed over ground in knots.\nSoG_kmhr::Float64: Speed over ground in kilometers per hour.\nmode::Char: Mode indicator ('A' for autonomous mode).\nvalid::Bool: Flag indicating the validity of the data.\n\nConstructor\n\nVTG(items::Array{D}; system::AbstractString = \"UNKNOWN\", valid = true) where D <: SubString\n\nExamples\n\ndata = VTG([\"VTG\", \"90.0\", \"T\", \"45.0\", \"M\", \"5.0\", \"K\", \"A\"])\n\n\n\n\n\n","category":"type"},{"location":"#NMEAParser.ZDA","page":"Home","title":"NMEAParser.ZDA","text":"struct ZDA <: NMEAString\n\nTime and Date (ZDA)\n\nThis NMEA data type represents information about the current time and date from a GNSS receiver.\n\nFields\n\nsystem::String: GNSS system identifier (e.g., GPS, GLONASS, GALILEO, Combined).\ntime::Float64: Time in seconds.\nday::Int: Day of the month.\nmonth::Int: Month of the year.\nyear::Int: Year.\nzone_hrs::Int: Time zone offset in hours.\nzone_mins::Int: Time zone offset in minutes.\nvalid::Bool: Flag indicating the validity of the data.\n\nConstructor\n\nZDA(items::Array{D}; system::AbstractString = \"UNKNOWN\", valid = true) where D <: SubString\n\nExamples\n\ndata = ZDA([\"ZDA\", \"123456\", \"15\", \"02\", \"2024\", \"5\", \"30\"])\n\n\n\n\n\n","category":"type"},{"location":"#Base.pop!-Tuple{NMEAData, Type{GGA}}","page":"Home","title":"Base.pop!","text":"pop!(nmea_data::NMEAData, ::Type{T}) where T <: NMEAString\n\nPop 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.\n\n\n\n\n\n","category":"method"},{"location":"#NMEAParser._dms_to_dd-Tuple{SubString, SubString}","page":"Home","title":"NMEAParser._dms_to_dd","text":"_dms_to_dd(dms::SubString, hemi::SubString)\n\nConverts a string representing degrees, minutes and seconds (DMS) to decimal degrees.\n\nArguments\n\ndms: a substring representing degrees, minutes and seconds\nhemi: a substring representing the hemisphere\n\nReturns\n\ndec_degrees: the decimal degree representation of the input DMS\n\nExample\n\ndms = \"4807.038\"\nhemi = \"N\"\ndec_degrees = _dms_to_dd(dms, hemi)\n\n\n\n\n\n","category":"method"},{"location":"#NMEAParser._hms_to_secs-Tuple{SubString}","page":"Home","title":"NMEAParser._hms_to_secs","text":"_hms_to_secs(hms::SubString)\n\nConverts a string representing hours, minutes and seconds (HMS) to seconds.\n\nArguments\n\nhms: a substring representing hours, minutes and seconds\n\nReturns\n\nseconds: the number of seconds represented by the input HMS\n\nExample\n\nhms = \"123519\"\nseconds = _hms_to_secs(hms)\n\n\n\n\n\n","category":"method"},{"location":"#NMEAParser.get_system-Tuple{SubString}","page":"Home","title":"NMEAParser.get_system","text":"get_system(mtype::SubString)\n\nDetermine the system type based on the input mtype.\n\nArguments\n\nmtype: A SubString representing the message type.\n\nReturns\n\nA string representing the system type. Possible values are \"GPS\", \"GLONASS\", \"GALILEO\", \"COMBINED\", and \"UNKNOWN\".\n\nExamples\n\nget_system(\"$GPGGA\") # \"GPS\"\nget_system(\"$GLGSV\") # \"GLONASS\"\nget_system(\"$GAGGA\") # \"GALILEO\"\nget_system(\"$GNGNS\") # \"COMBINED\"\nget_system(\"$PMTK\") # \"UNKNOWN\"\n\nTODO: 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\n\n\n\n\n\n","category":"method"},{"location":"#NMEAParser.is_string_supported-Tuple{AbstractString}","page":"Home","title":"NMEAParser.is_string_supported","text":"is_string_supported(nmea_string::AbstractString)\n\nCheck if the input NMEA string type is supported.\n\nArguments\n\nnmea_string::AbstractString: The NMEA string to be checked.\n\nReturns\n\nBool: true if the NMEA string is supported, false otherwise.\n\nExample\n\njulia> is_string_supported(\"$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47\")\ntrue\n\n\n\n\n\n","category":"method"},{"location":"#NMEAParser.nmea_parse-Tuple{AbstractString}","page":"Home","title":"NMEAParser.nmea_parse","text":"nmea_parse(nmea_string::AbstractString; validate_checksum=true)\n\nParse an NMEA string and generate the corresponding NMEA type.\n\nThis 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.\n\nArguments\n\nnmea_string::AbstractString: The NMEA sentence to parse.\nvalidate_checksum::Bool: Flag to indicate whether to validate the checksum (default is true).\n\nReturns\n\nAn instance of the appropriate NMEA type.\n\nExamples\n\nresult = nmea_parse(\"$GGA,123456,123.456,N,987.654,W,1,8,0.9,123.4,M,54.3,M,1,\")\n\n\n\n\n\n","category":"method"},{"location":"#NMEAParser.parse_msg!-Tuple{NMEAData, AbstractString}","page":"Home","title":"NMEAParser.parse_msg!","text":"parse_msg!(s::NMEAData, line::AbstractString)\n\nParse a line of NMEA 0183 data and update the state of an NMEAData object.\n\nArguments\n\ns : NMEAData \tAn object that stores the parsed data from NMEA messages. line : AbstractString \tA string that contains a valid NMEA 0183 message.\n\nReturns\n\nDataType \tThe type of the parsed message, or Nothing if the message is not supported.\n\nErrors\n\nArgumentError \tIf the line is not a valid NMEA 0183 message.\n\nExample\n\ns = NMEAData()\n\njulia> d = [ \"$GPRMC,154925.820,A,5209.732,N,00600.240,E,001.9,059.8,040123,000.0,W*7E\",\n\t\t\t\"$GPGGA,154925.920,5209.732,N,00600.240,E,1,12,1.0,0.0,M,0.0,M,,*63\",\n\t\t\t\"$GPGSA,A,3,01,02,03,04,05,06,07,08,09,10,11,12,1.0,1.0,1.0*30\",\n\t\t\t\"$GPRMC,154925.920,A,5209.732,N,00600.240,E,001.9,059.8,040123,000.0,W*7F\"]\n4-element Vector{String}:\n \"$GPRMC,154925.820,A,5209.732,N,00600.240,E,001.9,059.8,040123,000.0,W*7E\"\n \"$GPGGA,154925.920,5209.732,N,00600.240,E,1,12,1.0,0.0,M,0.0,M,,*63\"\n \"$GPGSA,A,3,01,02,03,04,05,06,07,08,09,10,11,12,1.0,1.0,1.0*30\"\n \"$GPRMC,154925.920,A,5209.732,N,00600.240,E,001.9,059.8,040123,000.0,W*7F\"\n\n julia> for str in d\n\t\t\tmsg_type = parse_msg!(s, str)\n\t\t\tprintln(msg_type)\n\t\tend\n RMC\n GGA\n GSA\n RMC\n\n julia> s.last_RMC\n RMC(\"GPS\", 56965.92, true, 52.1622, 6.004, 1.9, 59.8, \"04\", \"01\", \"23\", -0.0, 'A', true)\n\n julia> s.last_GGA\n GGA(\"GPS\", 56965.92, 52.1622, 6.004, \"GPS (SPS)\", 12, 1.0, 0.0, 0.0, 0.0, 0, true)\n\n\n\n\n\n","category":"method"},{"location":"#NMEAParser.pos_convert-Tuple{Char, Float64}","page":"Home","title":"NMEAParser.pos_convert","text":"pos_convert(flag::Char, value::Float64)::Float64\n\nA function that converts a position value from one unit to another.\n\nArguments\n\nflag::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.\nvalue::Float64: The position value to be converted.\n\nReturns\n\nA Float64 that represents the position value in meters.\n\nErrors\n\nThrows an exception if the flag is not one of the supported values.\n\nAlgorithm\n\nThe 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.\n\n\n\n\n\n","category":"method"},{"location":"#NMEAParser.update!-Tuple{NMEAData, GGA}","page":"Home","title":"NMEAParser.update!","text":"update!(s::NMEAData, msg)\n\nUpdate the corresponding field of s with the given NMEA message msg.\n\nArguments\n\ns::NMEAData: the NMEA data struct to be updated\nmsg: an NMEA message of type GGA, RMC, GSA, GSV, GBS, VTG, GLL, ZDA, DTM\n\n\n\n\n\n","category":"method"},{"location":"#NMEAParser.update-Tuple{GGA, NMEAData}","page":"Home","title":"NMEAParser.update","text":"update(msg::T, s::NMEAData) where T <: NMEAString\n\nUpdate the last received message of type T in the NMEAData object s with the given message msg. Return the updated NMEAData object s.\n\n\n\n\n\n","category":"method"},{"location":"#NMEAParser.vel_convert-Tuple{Char, Float64}","page":"Home","title":"NMEAParser.vel_convert","text":"vel_convert(flag::Char, value::Float64)::Float64\n\nA function that converts a velocity value from one unit to another.\n\nArguments\n\nflag::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.\nvalue::Float64: The velocity value to be converted.\n\nReturns\n\nA Float64 that represents the velocity value in meters per second.\n\nErrors\n\nThrows an exception if the flag is not one of the supported values.\n\nAlgorithm\n\nThe function uses a simple formula to convert the velocity value based on the flag.\n\n\n\n\n\n","category":"method"},{"location":"#NMEAParser.@do_parse-NTuple{5, Any}","page":"Home","title":"NMEAParser.@do_parse","text":"@do_parse(headers, header_str, items, system, valid)\n\nMacro for parsing NMEA sentences based on predefined headers.\n\nThis 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.\n\nArguments\n\nheaders::Tuple: A tuple containing pairs of regular expressions and corresponding NMEA types.\nheader_str::AbstractString: The NMEA sentence header string.\nitems::AbstractString: The NMEA sentence items.\nsystem::AbstractString: The system identifier.\nvalid::Bool: A boolean indicating whether the NMEA sentence is valid.\n\nExamples\n\n@do_parse NMEA_TYPES header items system valid\n\n\n\n\n\n","category":"macro"}] }