필터 지우기
필터 지우기

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

조회 수: 42 (최근 30일)
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?

채택된 답변

Gayatri Menon
Gayatri Menon 2020년 1월 23일
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
Walter Roberson
Walter Roberson 2020년 7월 20일
openExample('fusion/ReadAndParseTheNMEADataDirectlyFromAGPSReceiverExample')
It is part of the Sensor Fusion Toolbox, and so requires that that toolbox be installed.
FRANCISCO Curado
FRANCISCO Curado 2021년 6월 22일
편집: Walter Roberson 2021년 8월 1일
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'

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Nathan Li
Nathan Li 2020년 1월 13일
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 2021년 8월 1일
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

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by