Read and Parse NMEA Data Directly From GPS Receiver-No example

39 views (last 30 days)
I am trying to utilize the NMEA converter in the above example however even after downloading the associated toolbox I am unable to access the example above and can not find the example within its desinated toolbox. Additionally when trying to run the code of my own accord the functions that are utilized within the code most importantly HelperParseGPSData() is not included within the toolboxes files. Can these be added to the toolbox, or can an example of the function be posted?

Accepted Answer

Gayatri Menon
Gayatri Menon on 23 Jan 2020
Hi,
The example is available in R2019b. Can you try in R2019b.
If you are using R2019b, executing the below command will add the required files in path.
>> openExample('fusion/ReadAndParseTheNMEADataDirectlyFromAGPSReceiverExample')
The above command is obtained by clicking the 'View MATLAB command' link in the rightmost corner of the example
Hope this helps
Thanks
Gayatri
  3 Comments
Walter Roberson
Walter Roberson on 20 Jul 2020
openExample('fusion/ReadAndParseTheNMEADataDirectlyFromAGPSReceiverExample')
It is part of the Sensor Fusion Toolbox, and so requires that that toolbox be installed.
FRANCISCO Curado
FRANCISCO Curado on 22 Jun 2021
Edited: Walter Roberson on 1 Aug 2021
I found this post quite helpful but I observe the following problems with function HelperParseGPSData() :
1. HelperParseGPSData() does not recognize sentences with the GNRMC format, which is used by modern GPS that can receive data from a number of GPS satellite systems; it only recognizes GPRMC. This is not difficult to circumvent e.g., replacing strings in the data (or possibly in the function code) but it is undesirable.
2. Apparently the function returns ChecksumValidity: 'Bad Checksum' even for valid sentences (example below).
3. Although the function documentation reads "If there are multiple NMEA sentences available in the input raw GPS Data, an array of structures is returned as output. The size of the array will be the number of available NMEA sentences corresponding to the message IDs.", it apparently only processes one sentence each time. If one passes as input a cell array or a string array, it returns an error; but if one passes as input a single sentence it works; the same happens if the input has been converted from cell array to string array (examples below). Indeed, I have tried several other types of conversions but none worked. Thus, I question: what is the meaning of "If there are multiple NMEA sentences available in the input raw GPS Data, an array of structures is returned as output."?
I have the following data represented in variable y:
y =
3×1 cell array
{'$GNGLL,4038.42327,N,00843.82368,W,090359.00,A,D*61' }
{'$GPRMC,090400.00,A,4038.42282,N,00843.82332,W,1.996,150.99,270521,,,D*6C' }
{'$GNVTG,150.99,T,,M,1.996,N,3.698,K,D*21' }
>> [GPRMC, ~, ~, ~] = HelperParseGPSData(y);
First argument must be a string array, character vector, or cell array of character vectors.
>> [GPRMC, ~, ~, ~] = HelperParseGPSData(y(2))
GPRMC = HelperParseGPSData(y)
struct with fields:
MessageID: 'RMC'
Status: 'A,Data Valid'
DateandTime: '09:04:00.00 27/05/21 UTC'
Latitude: '40.6404°,N'
Longitude: '8.7304°,W'
SOG: '1.996 knots'
COG: '150.99°'
MagneticVariation: ''
Mode: 'Differential GNSS Fix'
Checksum: '6C'
ChecksumValidity: 'Bad Checksum'HelperParseGPSData(y)
>> z=string(y)
z =
3×1 string array
"$GNGLL,4038.42327,N,00843.82368,W,090359.00,A,D*61"
"$GPRMC,090400.00,A,4038.42282,N,00843.82332,W,1.996,150.99,270521,,,D*6C"
"$GNVTG,150.99,T,,M,1.996,N,3.698,K,D*21"
>> [GPRMC, ~, ~, ~] = HelperParseGPSData(z)
First argument must be a string array, character vector, or cell array of
character vectors.
>> [GPRMC, ~, ~, ~] = HelperParseGPSData(z(2))
GPRMC =
struct with fields:
MessageID: 'RMC'
Status: 'A,Data Valid'
DateandTime: '09:04:00.00 27/05/21 UTC'
Latitude: '40.6404°,N'
Longitude: '8.7304°,W'
SOG: '1.996 knots'
COG: '150.99°'
MagneticVariation: ''
Mode: 'Differential GNSS Fix'
Checksum: '6C'
ChecksumValidity: 'Bad Checksum'

Sign in to comment.

More Answers (2)

Nathan Li
Nathan Li on 13 Jan 2020
What version of Matlab are you using? Have you tried updating Matlab? This example may have been added recently. I had the same problem as you. I was able to load the example after updating to 2019b.

Gayatri Menon
Gayatri Menon on 1 Aug 2021
Hi,
nmeaParser in Navigation toolbox can be used to parse sentences compliant with NMEA 0183 Standard, Version 4.10. It supports other satellite systems as well.
Hope this helps.
Thanks
Gayatri

Categories

Find more on Characters and Strings in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!