与gpsd共享内存的python接口
gpsdshm的Python项目详细描述
概述
python gpsdshm提供只读(!)python接口到gpsd的共享内存。它提供了 一个单独的类Shm,将共享内存结构的字段公开为属性。这个 python gpsdshmapi是(松散地)基于gpsd版本3.16(api 6.1)建模的。GPSD早期版本 不支持3.0。
python gpsdshm使用Swig实现,需要gpsd头文件进行编译。
许多linux发行版都附带了gpsd包,但不支持共享内存。 有关如何构建gpsd的详细信息,请参见Compiling gpsd with shared memory support 支持共享内存。
示例
下面的示例显示了所有属性和典型值(位于窗口内约一米处的固定GPS的属性和典型值)。
>>>importgpsdshm>>>gpsd_shm=gpsdshm.Shm()>>>gpsd_shm.setTODO:<SwigObjectoftype'gps_mask_t *'at0x133bf50>>>>gpsd_shm.online# True if GPS is onlinegpsd_shm.onlineTODO:Out[6]:1454057376.6934643>>>gpsd_shm.status# Do we have a fix (True/False)?gpsd_shm.statusTODOOut[7]:1>>>gpsd_shm.skyview_time# Skyview timestamp>>>gpsd_shm.satellites_visible# Number of satellites in viewTODO:nan>>>gpsd_shm.fix.time# Time of update1454057448.0>>>gpsd_shm.fix.mode# Mode of fix (0=not seen, 1=no fix, 2=2D, 3=3D)3>>>gpsd_shm.fix.ept# Expected time uncertainty0.005>>>gpsd_shm.fix.latitude# Latitude in degrees (valid if mode >= 2)-37.75859333333334>>>gpsd_shm.fix.epy# Latitude position uncertainty, meters14.853882022256698>>>gpsd_shm.fix.longitude# Longitude in degrees (valid if mode >= 2)144.99911>>>gpsd_shm.fix.epx# Longitude position uncertainty, meters10.040781879264545>>>gpsd_shm.fix.alitude# Altitude in meters (valid if mode == 3)68.2>>>gpsd_shm.fix.epv# Vertical position uncertainty, meters19.55>>>gpsd_shm.fix.track# Course made good (relative to true north)44.45>>>gpsd_shm.fix.epd# Track uncertainty, degreesnan>>>gpsd_shm.fix.speed# Speed over ground, meters/sec0.3446777748>>>gpsd_shm.fix.eps# Speed uncertainty, meters/sec29.707764044513397>>>gpsd_shm.fix.climb# Vertical speed, meters/sec0.0>>>gpsd_shm.fix.epc# Vertical speed uncertaintynan>>>gpsd_shm.dop.xdop0.6693854586176363>>>gpsd_shm.dop.ydop0.9902588014837799>>>gpsd_shm.dop.pdop1.17>>>gpsd_shm.dop.hdop0.99>>>gpsd_shm.dop.vdop0.82>>>gpsd_shm.dop.tdop1.2548625723457216>>>gpsd_shm.dop.gdop2.4342743978108503
有关卫星的信息包含在satellites列表中。
>>>gpsd_shm.satellites[0].ss# Signal-to-noise ratio (dB)16.0>>>gpsd_shm.satellites[0].used# Used in solution?False>>>gpsd_shm.satellites[0].prn# PRNs of satellite6>>>gpsd_shm.satellites[0].elevation# Elevation of satellite, degrees56>>>gpsd_shm.satellites[0].azimuth# Azimuth, degrees59
历史记录
0.1.0(2016年2月4日)
- 初始版本