Main Content

read

Read data from GPS

Description

例子

TT=读(gpsObjreturns the one frame of GPS data in时间表格式。

例子

[[TT,,,,overrun] =读(gpsObjreturns the GPS readings in时间表格式。这是一个非阻止读取,它以时间表格式返回n个数据点,其中n指定SampleSperReadand时间表是specified using输出Format财产的GPSDEV目的。

例子

[[lla,,,,groundSpeed,,,,course,,,,dops,,,,gpsreceivertime,,,,时间戳,,,,overrun] =读(gpsObj从GPS返回测量矩阵。这是一个非阻止读取,它以矩阵格式返回n个数据点,其中n指定SampleSperReadand矩阵是specified using输出Format财产的theGPSDEV目的。

Examples

Read Data from GPS

创建一个Arduino对象,并包括串行库。

a = arduino('COM4',,,,'Mega2560',,,,'Libraries',,,,“系列”);

创建GPS对象。

gpsobj = gpsdev(a);

读取GPS数据的样本。

tt = read(gpsobj)
tt = 1×5 timetable Time LLA GroundSpeed Course DOPs GPSReceiverTime ________________________ __________________________ ___________ ______ ____________________ ________________________ 31-Jan-2020 11:41:42.475 12.944 77.692 807.7 0.0463 266.6 1.72 0.94 1.44 31-Jan-2020 06:11:42.000

从GPS中读取数据作为时间表

创建一个Arduino对象,并包括串行库。

a = arduino('COM4',,,,'Mega2560',,,,'Libraries',,,,“系列”);

Create GPS object with additional properties.

gpsobj = gpsdev(a,“输出格式”,,,,“时间表”,,,,“ SampleSperRead”,2);

读取GPS数据的样本。

[TT,Overruns] =读(GPSOBJ)
tt = 2×5 timetable Time LLA GroundSpeed Course DOPs GPSReceiverTime ________________________ __________________________ ___________ ______ ____________________ ________________________ 31-Jan-2020 11:32:49.459 12.944 77.692 806.8 0.0463 258.87 1.31 0.99 0.85 31-Jan-2020 06:02:49.000 31-Jan-2020 11:32:50.416 12.944 77.692 806.9 0.12861 262.7 1.31 0.99 0.85 31-JAN-2020 06:02:02:50.000 OVER = 3

显示从Arduino硬件读取GPS数据的时间期间格式。

gpsobj.timeformat =“持续时间”;[TT,Overruns] =读(GPSOBJ)
tt = 2×5 timetable Time LLA GroundSpeed Course DOPs GPSReceiverTime __________ __________________________ ___________ ______ ____________________ ________________________ 9.4257 sec 12.944 77.692 808.4 0.030867 4.93 1.51 0.78 1.29 31-Jan-2020 06:15:24.000 10.404 sec 12.944 77.692 808.4 0.051444 41.26 1.1 0.76 0.79 31-Jan-2020 06:15:25.000超支= 755

Read Data from GPS as a Matrix

创建一个Arduino对象,并包括串行库。

a = arduino('COM4',,,,'Mega2560',,,,'Libraries',,,,“系列”);

Create GPS object with additional properties.

gpsobj = gpsdev(a,“输出格式”,,,,“矩阵”,,,,“ SampleSperRead”,2);

读取GPS数据的样本。

[[lla,,,,速度,,,,course,dops,gpsReceiverTime,timestamp,overruns] = read(gpsObj)
lla = 12.9437 77.6916 807.4000 12.9437 77.6916 807。4000 speed = 0.0154 0.0463 course = 346.0100 270.2100 dops = 1.2400 0.9200 0.8300 1.7700 0.9900 1.4700 gpsReceiverTime = 2×1 datetime array 31-Jan-2020 06:07:01.000 31-Jan-2020 06:07:02.000 timestamp = 2×1 datetime array 31-Jan-2020 11:37:01.734 31-Jan-2020 11:37:02.436 overruns = 75

输入参数

全部收缩

这GPS对象with the default or specified properties.

输出参数

全部收缩

Data read from the GPS receiver when the output format is set to时间表。这时间表returned has the following fields:

  • LLA (Latitude, Longitude, Altitude)

  • 地面速度

  • 当然要在地面上

  • 精确稀释(DOP),VDOP,HDOP,PDOP,

  • GPS Receiver Time

  • 时间 - 从Arduino硬件中读取的时间邮票datetimeor期间为了mat

数据类型:时间表

GPS接收器在大地纬度,经度和高度(LLA)中的位置,作为真实有限的n-by-3 array. Latitude and longitude are in degrees with North and East being positive. Altitude is in meters.

数据类型:双倍的

速度越过地面,作为一个真正有限的返回n-1列矢量。

数据类型:双倍的

当然要在地面上relative to true north,returned as a real finiten-1列在0到2pi弧度之间的值。

数据类型:双倍的

精确稀释,作为真正有限的返回n-by-3 array. The order of the output is[PDOP,HDOP,VDOP]

数据类型:双倍的

UTC time returned by the GPS module.

数据类型:datetime

从硬件读取GPS数据的时间,作为真实有限的返回n-1列矢量。如果是时间格式datetime,时间戳将是datetime。如果是时间格式是一个期间,时间戳将是期间

  • datetime- 显示读取数据的日期和时间。

  • 期间- 显示在第一次呼叫之后几秒钟内经过的时间readfunction or the last execution of the发布功能。

数据类型:datetime|期间

这number of samples lost between consecutive calls toread。当读取模式是set to最老的

数据类型:双倍的

更多关于

全部收缩

read输出

read功能输出and纳特in the following situations:

  • 如果GPS模块没有接收有效的数据,因为没有卫星锁或GPS没有给出特定值。

  • 如果发生校验和故障,相应的数据点将是为了numeric outputs (lla,,,,速度,,,,course,,,,dops) 和纳特为了gpsrecievertimella取自GPGGA句子,速度,,,,course,,,,andgpsrecievertime被判处GPRMC句子和dops取自GPGSA句子。

Sinceread是non blocking, the following is expected:

首先readGPS对象创建后用于数字值和纳特为了time values since acquiring data from GPS takes time.

  • 如果没有新数据,则输出read是先前的数据。例如,如果后续读取之间的延迟小于更新of the GPS receiver.

版本历史记录

在R2020a中引入