下载的源码程序包中,共有16个例子,这里记录它们的调试及运行结果,尤其是哪些可用,哪些不可用,今后使用时用作参考。

总结:

(1)在 18 个示例程序中,example16 和 example17 编译报错,example7 和 example12 编译正常但是运行时报错(“已放弃(吐核)”),example3 运行正常但结果错误,其余程序可以正常运行。

(2)对库文件 libgpstk.so 文件的依赖,使库内函数的调试很麻烦:这是因为在安装 GPSTK 时由编译  cmake 和安装命令 sudo make install 生成了libgpstk.so 文件,这就与源代码切断了联系;后续对源代码做的修改,需要再次执行 GPSTK 的编译和安装命令才能更新 libgpstk.so 尤其是安装命令需要10-20分钟,比较耗时。而且对 libgpstk.so 文件的调试也很麻烦,它不能方便地设置断点, 不方便查看程序的跳转和变量,令调试工作一度陷入困顿中。

(3)鉴于 example3.cpp 程序中关于 P1 & P2 只能识别出 P1 变量, 以及 Rinex 3.02 文件中不支持含有北斗卫星观测文件的问题,我们最终放弃了对 GPSTK 源代码的依赖,转而自行开发相应的读取程序,以避开其中的 bug。

各程序的运行示例详列在此。

1. example1.cpp

$ ../example1
Hello world!
The current civil time is // :: UTC
The current year is
The current day of year is
The current second of day is 30537.5
The current full GPS week is
The current short GPS week is
The current day of GPS week is
The current second of GPS week is
The current Modified Julian Date is 57911.353443289 UTC

2.  example2.cpp, OK。

自动生成新文件:bahr1620.04o.new

./example2

3. example3.cpp, 看似正常,其实有误!

[She@she-centos7 examples]$ ./example3
Required argument is a RINEX obs file.
[She@she-centos7 examples]$ ./example3 bahr1620.04o
Name your PRN of interest (by number: through ):
Reading bahr1620.04o.
---------------------------------- REQUIRED ----------------------------------
Rinex Version 2.10, File type Observation, System G (GPS).
Prgm: GFW - ROW, Run: // ::, By: NIMA
Marker type: .
Observer : NIMA, Agency: NATIONAL IMAGERY AND MAPPING AGENCY
Rec#: , Type: ASHTECH Z-XII3, Vers: 1Y07-1DY4
Antenna # : , Type : ASH700936B_M SNOW
Position (XYZ,m) : (3633909.1016, 4425275.5033, 2799861.2736).
Antenna Delta (HEN,m) : (3.1220, 0.0000, 0.0000).
GPS Observation types ():
Type # (L1C) L1 GPSC/A phase
Type # (L2X) L2 GPSC2L+M phase
Type # (C1C) L1 GPSC/A pseudorange
Type # (C1P) L1 GPSP pseudorange
Type # (C2W) L2 GPScodelessZ pseudorange
Type # (D1C) L1 GPSC/A doppler
Type # (D2X) L2 GPSC2L+M doppler
Type # (S1C) L1 GPSC/A snr
Type # (S2X) L2 GPSC2L+M snr
Time of first obs // ::00.000 UNK
(This header is VALID)
---------------------------------- OPTIONAL ----------------------------------
Marker number : 24901M002
Signal Strenth Unit =
Interval = 30.000
Wavelength factor L1: L2:
Comments () :
Data are thinned (not smoothed) 30s. observations
-------------------------------- END OF HEADER --------------------------------
text :GC2P RinexObsID is not stored!.
location :/home/She/Downloads/GPSTK/gpstk-2.5.src/dev/ext/lib/FileHandling/RINEX3/Rinex3ObsHeader.cpp:

实际上,该观测文件的观测变量包括 P1 和 P2 参量,但是该程序却只能读出 P1 的值,找不到 P2 的值,导致程序中断退出。

[She@she-centos7 examples]$ cat bahr1620.04o | grep "# / TYPES OF OBSERV"
L1 L2 C1 P1 P2 D1 D2 S1 S2# / TYPES OF OBSERV

4. example4.cpp, OK。

[She@she-centos7 examples]$ ./example4 bahr1620.04o bahr1620.04n
3633917.14508 4425281.93387 2799868.07476
3633916.70007 4425281.95696 2799867.33565
3633916.53802 4425282.23082 2799867.57637
3633917.38703 4425282.2806 2799867.85073
3633917.09456 4425282.76769 2799868.04387
3633916.55241 4425282.22131 2799867.29408
3633917.55883 4425282.49571 2799867.32582
3633917.44541 4425281.83514 2799867.2195
3633917.31666 4425281.71065 2799867.09384
3633917.19143 4425281.94326 2799867.20896
...

5. example5.cpp,OK。

[She@she-centos7 examples]$ ./example5
Required option -i | --datainput was not found.
Required option -n | --navinput was not found.
Usage: example5 [OPTION] ... Program to print the position solution in ECEF and longitude, latitude, height,
based in C1 and given a RINEX observations file and a RINEX broadcast navigation
file. The output is:
Time(sec) X(m) Y(m) Z(m) Lon(deg) Lat(deg) Height(m) Required arguments:
-i, --datainput=ARG [-i|--datainput] Name of RINEX observations file.
-n, --navinput=ARG [-n|--navinput] Name of RINEX broadcast navigation file. Optional arguments:
-d, --debug Increase debug level
-v, --verbose Increase verbosity
-h, --help Print help usage [She@she-centos7 examples]$ ./example5 -i bahr1620.04o -n bahr1620.04n
WARNING: Navigation file bahr1620.04n doesn't have valid ionospheric correction parameters.
Bancroft method was used at epoch 0
Bancroft method was used at epoch 30
30.00000000   3633911.61526279   4425277.16374086   2799864.64313676   50.60813429   26.20915473   -12.95938696   
60.00000000   3633911.27294441   4425277.29382556   2799864.72140608   50.60813776   26.20915583   -13.02953000   
90.00000000   3633911.72144069   4425276.53504681   2799864.39705302   50.60812947   26.20915441   -13.44353101   
120.00000000   3633912.70730754   4425277.96528185   2799865.20612008   50.60813093   26.20915406   -11.53320100   
150.00000000   3633911.50029482   4425277.35231622   2799863.95125127   50.60813637   26.20914884   -13.19966526   
...
3510.00000000   3633915.05584311   4425279.01996892   2799863.23598481   50.60811947   26.20912891   -10.33482742   
3540.00000000   3633914.02925495   4425278.45113254   2799862.44004908   50.60812379   26.20912682   -11.66527738   
3570.00000000   3633914.94178493   4425279.25564098   2799863.64853409   50.60812185   26.20913182   -10.05415985 [She@she-centos7 examples]$ ./example5 -i bell0300.02o -n brdc0300.02n
Bancroft method was used at epoch 0
0.00000000   4775853.47654020   116813.84203186   4213023.93446090   1.40113300   41.59962739   859.74948096   
30.00000000   4775853.92901513   116814.01332576   4213024.06419099   1.40113492   41.59962554   860.17700436   
60.00000000   4775853.79906886   116814.08023521   4213024.16856845   1.40113576   41.59962701   860.15038115   
90.00000000   4775853.61836924   116814.07826280   4213024.23307484   1.40113579   41.59962852   860.05808505   
120.00000000   4775853.58267418   116814.07468504   4213024.20737107   1.40113576   41.59962856   860.01426948   
150.00000000   4775853.67207896   116814.10319962   4213024.24733056   1.40113608   41.59962829   860.10815795   
180.00000000   4775853.60199151   116814.07684942   4213024.24030878   1.40113578   41.59962867   860.05061833   
210.00000000   4775853.49177923   116814.03766845   4213024.28838846   1.40113534   41.59962966   859.99943066   
240.00000000   4775853.50161516   116814.00936825   4213024.28751768   1.40113500   41.59962960   860.00568818  
...
86249.98900000   4775850.73846418   116816.59904808   4213026.24533273   1.40116686   41.59965891   859.28720471   
86279.98900000   4775850.70088181   116816.57470326   4213026.24143232   1.40116658   41.59965911   859.25607420   
86309.98900000   4775850.71443751   116816.53725675   4213026.23800576   1.40116613   41.59965901   859.26324846   
86339.98900000   4775850.70538967   116816.53198443   4213026.34238378   1.40116607   41.59965977   859.32568691   
86369.98900000   4775850.58927617   116816.52446428   4213026.36751647   1.40116601   41.59966063   859.25543160    

6. example6.cpp, OK。

[She@she-centos7 examples]$ ./example6
WARNING: Navigation file bahr1620.04n doesn't have valid ionospheric correction parameters.
Exception at epoch: 0.000000000000000 GPS
0.00000000 3633909.10160000 4425275.50330000 2799861.27360000 50.60814318 26.20913892 -17.03005082
30.00000000 3633911.74073445 4425277.20389675 2799864.68208009 50.60813357 26.20915461 -12.84290456
60.00000000 3633911.54304831 4425277.19265836 2799865.01849144 50.60813503 26.20915787 -12.81467844
90.00000000 3633911.81361812 4425276.26562604 2799864.73369240 50.60812705 26.20915773 -13.42917878
120.00000000 3633913.22368762 4425278.04550679 2799865.35504803 50.60812745 26.20915371 -11.11778824
150.00000000 3633911.88342197 4425277.11127474 2799864.48218737 50.60813188 26.20915291 -12.91416557
180.00000000 3633911.83589123 4425276.61525403 2799864.34496730 50.60812910 26.20915345 -13.34575635
...

7. example7.cpp, Error

[She@she-centos7 examples]$ ./example7
39600.009 Case . Exception at epoch: 0.000999999998196 GPS
terminate called after throwing an instance of 'gpstk::GeometryException'
已放弃(吐核)

8. example8.cpp,OK。

[She@she-centos7 examples]$ ./example8
0.000 2.565 0.291 -6.283 1.379 1.401 0.399 11.800 0.650 2.504 2.170 1.250 1.168 1.828
900.000 0.441 -0.464 -1.616 0.149 0.773 0.188 6.838 0.398 2.764 2.371 1.420 1.291 1.989
1800.000 -0.012 -0.120 -0.054 0.110 0.006 0.009 0.016 0.000 2.934 2.522 1.499 1.488 2.036
2700.000 -0.013 -0.021 -0.059 0.111 0.002 0.004 0.006 0.000 3.839 3.236 2.066 1.911 2.611
3600.000 -0.033 -0.018 -0.076 0.111 0.001 0.002 0.002 0.000 3.498 2.978 1.836 1.875 2.314
4500.000 -0.021 -0.027 -0.056 0.103 0.000 0.002 0.001 0.000 3.135 2.751 1.505 1.718 2.148
...

9. example9.cpp,OK。

[She@she-centos7 examples]$ ./example9
Starting processing for station: 'COCO'.
Processing finished for station: 'COCO'. Results in file: 'coco2370-04.out'.
Starting processing for station: 'MADR'.
Processing finished for station: 'MADR'. Results in file: 'madr1480-08.out'.
Starting processing for station: 'ONSA'.
Processing finished for station: 'ONSA'. Results in file: 'onsa2240-05.out'.

10. example10.cpp,OK???。

[She@she-centos7 examples]$ ./example10
Exception at epoch: 0.000000000000000 GPS; text :SolverPPP:text :Weight matrix is not square
location :/home/She/Downloads/GPSTK/gpstk-2.5.src/dev/ext/lib/Procframe/SolverPPP.cpp: location :/home/She/Downloads/GPSTK/gpstk-2.5.src/dev/ext/lib/Procframe/SolverPPP.cpp: Exception at epoch: 0.000000000000000 GPS; text :SolverPPP:text :Weight matrix is not square
location :/home/She/Downloads/GPSTK/gpstk-2.5.src/dev/ext/lib/Procframe/SolverPPP.cpp: location :/home/She/Downloads/GPSTK/gpstk-2.5.src/dev/ext/lib/Procframe/SolverPPP.cpp: Exception at epoch: 0.000000000000000 GPS; text :SolverPPP:text :Weight matrix is not square
location :/home/She/Downloads/GPSTK/gpstk-2.5.src/dev/ext/lib/Procframe/SolverPPP.cpp: location :/home/She/Downloads/GPSTK/gpstk-2.5.src/dev/ext/lib/Procframe/SolverPPP.cpp: Exception at epoch: 0.000000000000000 GPS; text :SolverPPP:text :Weight matrix is not square
location :/home/She/Downloads/GPSTK/gpstk-2.5.src/dev/ext/lib/Procframe/SolverPPP.cpp: location :/home/She/Downloads/GPSTK/gpstk-2.5.src/dev/ext/lib/Procframe/SolverPPP.cpp:

11. example11.cpp,添加gv软件包( $ sudo yum install gv )之后, OK。

[She@she-centos7 examples]$ ./example11
Going to launch ggv
sh: ggv: 未找到命令
... couldn't execute: ggv lineScatterPlotsExample.eps
Going to launch gv
sh: gv: 未找到命令
... couldn't execute: gv lineScatterPlotsExample.eps
Going to launch kghostview --portrait
sh: kghostview: 未找到命令
... couldn't execute: kghostview --portrait lineScatterPlotsExample.eps
Going to launch ghostview
Warning: Cannot convert string "-*-Helvetica-Medium-R-Normal--*-140-*-*-P-*-ISO8859-1" to type FontStruct
Warning: Missing charsets in String to FontSet conversion
Warning: Cannot convert string "-*-Helvetica-Medium-R-Normal--*-120-*-*-P-*-ISO8859-1" to type FontStruct
Warning: Cannot convert string "-*-Helvetica-Medium-R-Normal--*-100-*-*-P-*-ISO8859-1" to type FontStruct
Warning: Cannot convert string "-*-Helvetica-Bold-R-Normal--*-120-*-*-P-*-ISO8859-1" to type FontStruct

在CentOS 7 系统上安装 gv 软件包之后,可以打开图片文件 ~/GPSTK/gpstk-2.5.src/dev/examples/lineScatterPlotsExample.eps。

12. example12.cpp,Error

[She@she-centos7 examples]$ ./example12
terminate called after throwing an instance of 'gpstk::InvalidParameter'
已放弃(吐核)

13. example13.cpp,OK。

功能是打开一张图片  surfacePlotExample.eps 。

[She@she-centos7 examples]$ ./example13
Going to launch ggv
sh: ggv: 未找到命令
... couldn't execute: ggv surfacePlotExample.eps
Going to launch kghostview --portrait
sh: kghostview: 未找到命令
... couldn't execute: kghostview --portrait surfacePlotExample.eps
Going to launch ghostview
Warning: Cannot convert string "-*-Helvetica-Medium-R-Normal--*-140-*-*-P-*-ISO8859-1" to type FontStruct
Warning: Missing charsets in String to FontSet conversion
Warning: Cannot convert string "-*-Helvetica-Medium-R-Normal--*-120-*-*-P-*-ISO8859-1" to type FontStruct
Warning: Cannot convert string "-*-Helvetica-Medium-R-Normal--*-100-*-*-P-*-ISO8859-1" to type FontStruct
Warning: Cannot convert string "-*-Helvetica-Bold-R-Normal--*-120-*-*-P-*-ISO8859-1" to type FontStruct

14. example14.cpp,OK。

[She@she-centos7 examples]$ ./example14
Starting processing for station: 'ACOR'.
Processing finished for station: 'ACOR'.
Starting processing for station: 'MADR'.
Processing finished for station: 'MADR'.
Starting processing for station: 'SCOA'.
Processing finished for station: 'SCOA'.
Starting processing for station: 'SFER'.
Processing finished for station: 'SFER'.
Starting processing for station: 'TLSE'.
Processing finished for station: 'TLSE'.
0.00000 0.96351 0.36898 2.63270 1.27138
30.00000 1.51249 -0.80217 2.74550 1.76894
60.00000 -1.05850 -0.59825 7.78966 0.82128
90.00000 0.72250 -1.04334 5.51055 0.60794
120.00000 0.88845 -1.38029 8.63975 0.14118
150.00000 0.69855 -0.38192 3.98268 0.89917
180.00000 0.62761 -0.12038 1.11617 1.30303
210.00000 0.49831 -0.18068 0.12812 1.62024
240.00000 0.33078 -0.02410 0.10592 1.73208
270.00000 0.25720 -0.22573 0.11656 2.02044
300.00000 0.07949 -0.31696 0.14422 2.17535
330.00000 0.00535 -0.19065 0.09094 2.24695
360.00000 -0.07861 -0.22373 0.29576 2.18388
390.00000 -0.06248 -0.28896 0.31730 2.15903

15. example15.cpp,OK。

[She@she-centos7 examples]$ ./example15

Before perturbation: sample mean is               10.0586,
sample standard deviation is 1.99072 Altering measurement to take the value of After perturbation: sample mean is 20.0485,
sample standard deviation is 315.916 Robust statistics:
number =
quartiles = 8.6755863 11.334482
median = 10.126592
MAD = 1.9174815 Using robust stats: sample mean is 10.058538,
sample standard deviation is 1.9917154

16.  example16.cpp, Error:编译报错

[She@she-centos7 examples]$ make
g++ -c -o example16.o example16.cpp
example16.cpp: 在函数‘int main(int, char**)’中:
example16.cpp::: 错误:‘class gpstk::SP3EphemerisStore’没有名为‘enableDataGapCheck’的成员
SP3EphList.enableDataGapCheck();
^
example16.cpp::: 错误:‘class gpstk::SP3EphemerisStore’没有名为‘setGapInterval’的成员
SP3EphList.setGapInterval(
^
example16.cpp::: 错误:‘class gpstk::SP3EphemerisStore’没有名为‘enableIntervalCheck’的成员
SP3EphList.enableIntervalCheck();
^
example16.cpp::: 错误:‘class gpstk::SP3EphemerisStore’没有名为‘setMaxInterval’的成员
SP3EphList.setMaxInterval(
^
example16.cpp::: 错误:expression cannot be used as a function
<< YDSTime(gRover.header.epoch).sod()
^
example16.cpp::: 错误:‘class gpstk::CommonTime’没有名为‘DOYsecond’的成员
fAverage << gRover.header.epoch.DOYsecond()
^
example16.cpp::: 错误:‘class gpstk::CommonTime’没有名为‘DOYsecond’的成员
cout << gRover.header.epoch.DOYsecond() << " " // #1
^
make: *** [example16.o] 错误

17 example17.cpp,Error:编译报错。

[She@she-centos7 examples]$ make
g++ -c -o example17.o example17.cpp
example17.cpp: 在成员函数‘virtual void example17::process()’中:
example17.cpp::: 错误:‘class gpstk::SP3EphemerisStore’没有名为‘enableDataGapCheck’的成员
SP3EphList.enableDataGapCheck();
^
example17.cpp::: 错误:‘class gpstk::SP3EphemerisStore’没有名为‘setGapInterval’的成员
SP3EphList.setGapInterval(
^
example17.cpp::: 错误:‘class gpstk::SP3EphemerisStore’没有名为‘enableIntervalCheck’的成员
SP3EphList.enableIntervalCheck();
^
example17.cpp::: 错误:‘class gpstk::SP3EphemerisStore’没有名为‘setMaxInterval’的成员
SP3EphList.setMaxInterval(
^
example17.cpp: 在成员函数‘virtual void example17::shutDown()’中:
example17.cpp::: 错误:‘class gpstk::CommonTime’没有名为‘DOYsecond’的成员
<< workEpoch.DOYsecond() << endl;
^
make: *** [example17.o] 错误

18. example18.cpp,OK

[She@she-centos7 examples]$ ./example18
This is example of GPSTk.
process...
1.000000 2.004536 4.000000
1.000000 2.002924 4.000000
1.000000 1.999229 4.000000
1.000000 1.994481 4.000000
1.000000 1.996261 4.000000
1.000000 1.996434 4.000000
1.000000 1.994959 4.000000
...
1.000000 2.000722 4.000000
1.000000 2.000658 4.000000
1.000000 2.000705 4.000000
Finished.

CentOS7系统上的GPSTK示例代码调试 & 运行结果 & 心得的更多相关文章

  1. CentOS7系统上的GPSTK源码安装

    网址:http://www.gpstk.org/bin/view/Documentation/BuildingGPSTkUnderUnix 这里使用Cmake来安装源码,网站上的原文摘抄如下,有少部分 ...

  2. 在Mac系统上配置Android真机调试环境

    在Mac系统上配置Android真机调试环境 mac上配置安卓环境还说挺方便的,真机调试也比win上要好一些.win上被各种软件强行安装了xxx助手. 在mac上就了一个干净的感觉. 下载Androi ...

  3. Kubernetes+Docker的云平台在CentOS7系统上的安装

    Kubernetes+Docker的云平台在CentOS7系统上的安装 1.运行VirtualBox5. 2.安装CentOS7系统. 注意:选择Basic Server类型 安装过程略. 3.修改计 ...

  4. 重装系统,打开VS进行程序调试运行的时候 Unable to find manifest signing certificate in the certificate store

    重装系统,打开VS进行程序调试运行的时候 Unable to find manifest signing certificate in the certificate store. 项目的属性-> ...

  5. 在CentOS7系统上执行Scala脚本

    在类Unix系统上,可以在scala文件中开头第一行指定脚本的解释程序.如下例: Script.scala #!/usr/bin/env scala println("Hello" ...

  6. [转] VS2015中跑OpenGL红宝书第八版的第一章示例代码,运行

    Ori Article Link OpenGL的东西快忘光了,把角落的第八版红宝书拿出来复习一下 从书中的地址下了个示例代码结果新系统(Win10+VS2015)各种跑不起来,懊恼之后在网上疯狂搜索资 ...

  7. CentOS7系统上的LAPACK源码安装

    参考链接:linux下安装blas和lapack BLAS 和 LAPACK 这两个数学库是很多 Linux 科学计算软件需要调用的,所以经常会用到. LAPACK,其名为Linear Algebra ...

  8. CentOS7系统上部署.net core程序

    一.准备工作 首先安装 xshell 和 xftp ,前者用于SSH连接Linux服务器,后者用于FTP上传下载文件. xshell和xftp个人使用是免费的,下载地址 之后分别输入用户名和密码登录主 ...

  9. EasyNVR摄像机网页Chrome无插件视频播放功能二次开发之通道配置文件上传下载示例代码

    背景需求 熟悉EasyNVR产品的朋友们都知道,产品设计初期根据整个直播流程层级,我们将EasyNVR无插件直播系统划分为:硬件层.能力层.应用层,连接硬件与应用之间的桥梁,同时屏蔽各种厂家硬件的不同 ...

随机推荐

  1. PHP环境配置遇到的小问题

    1.设置时区 2.默认打开文件 3.文件夹权限设置

  2. mysql的sql_mode设置

    参考官方文档: mysql可以为不同的客户端设置不同的sql_mode,并且每个应用能够设置他自己的会话级别的sql_mode.sql_mode会影响sql语法以及mysql显示数据的正确性. Whe ...

  3. Python入门经典案例一

    # 有1.2.3.4个数字,能组成多少个互不相同且无重复数字的三位数?都是多少? sum = 0 values = range(1, 5) for i in values: for j in valu ...

  4. Android5.0新特性之——控件移动动画(初级)

    最近开发,UI大牛们设计了好多很炫酷吊炸天的动画,不由得重新学习了一下5.0的ObjectAnimator动画. ObjectAnimator动画的原理,通过反射控件的setXXX方法,改变控件的实际 ...

  5. Blender学习笔记

    本文是根据B站上面,顺子老师的视频学习整理,建模部分,并未设计到渲染,内容整理所得 下载安装,可以直接在blender官网下载,建议下载最新版吧.因为每次软件的更新都会有新的东西出现,在使用中把你的心 ...

  6. Bootstrap3基础 引入本地的bootstrap

      内容 参数   OS   Windows 10 x64   browser   Firefox 65.0.2   framework     Bootstrap 3.3.7   editor    ...

  7. MapReduce实现PageRank算法(邻接矩阵法)

    前言 之前写过稀疏图的实现方法,这次写用矩阵存储数据的算法实现,只要会矩阵相乘的话,实现这个就很简单了.如果有不懂的可以先看一下下面两篇随笔. MapReduce实现PageRank算法(稀疏图法) ...

  8. Go 嵌入类型

    文章转载地址:https://www.flysnow.org/2017/04/06/go-in-action-go-embedded-type.html 嵌入类型或嵌套类型,这是一种可以把已有类型的声 ...

  9. React Native图片缓存解决方案

    1. react-native-fetch-blob 将图片存在本地的一个东西 2. react-native-img-cache 自动缓存的一个东西 上面装好后 就可以使用啦 import {Cac ...

  10. JS 基本类型和引用类型---JS 学习笔记(一)

    本文参考了focusxxxxy的博客,感谢他的知识分享. 一 基本类型和引用类型的值 ECMAScript 变量包含两种不同数据类型的值:基本类型和引用类型. 也有其他的叫法,比如原始类型和对象类型, ...