CentOS7系统上的GPSTK示例代码调试 & 运行结果 & 心得

时间:2021-05-01 00:05:46

下载的源码程序包中,共有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&plus;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. 项目的属性-&gt ...

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

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

  6. &lbrack;转&rsqb; VS2015中跑OpenGL红宝书第八版的第一章示例代码,运行

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

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

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

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

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

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

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

随机推荐

  1. Webservce、WCF、WebApi的区别

    Web Service It is based on SOAP and return data in XML form. It support only HTTP protocol. It is no ...

  2. Java发邮件:Java Mail与Apache Mail

    作者:Vinkn 来自http://www.cnblogs.com/Vinkn/ 一.邮件简介 一封邮件由很多信息构成,主要的信息如下,其他的暂时不考虑,例如抄送等: 1.收件人:收件人的邮箱地址,例 ...

  3. 苹果笔记本只能上QQ,微信,任何浏览器不能打开网页的问题。

    我的笔记本一共遇到过两次这种情况.第一次是浏览器输入域名打不开网页,而输入ip地址可以打开.这就是DNS服务器的问题,解决方法很简单.在系统偏好设置里面找到网络,然后,点击正在连接的网络的高级选项,选 ...

  4. Retrofit的初次使用

    rxretrofitlibrary是一个已经写好的网络框架库,先以本地Module导入到自己的项目中. 1.它的初始化操作大多在自定义的application中完成,如: public class A ...

  5. 爬虫豆瓣top250项目-开发文档

    项目托管平台地址:https://github.com/gengwenhao/GetTop250.git 负责内容:1.使用python的request库先获取网页内容下来 2.再使用一个好用的lxm ...

  6. spark教程

    某大神总结的spark教程, 地址 http://litaotao.github.io/introduction-to-spark?s=inner

  7. laravel中连表查询

    $skuList = ProductSkuModel::selectRaw('product_skus.id as sku_id, product_skus.code as code, product ...

  8. 记录在Centos下安装和使用Git的过程,从github上克隆仓库和提交。

    1 安装git yum install git 2配置DNS vi /etc/resolv.conf nameserver 8.8.8.8nameserver 8.8.4.4 3 设置网关 vi /e ...

  9. rhel7 ifconfig command not found

    同事扔过来一个rhel7.2的系统,登录后发现没有安装ifconfig命令: # ifconfig -bash: ifconfig: command not found 先看看环境变量: # echo ...

  10. Android使用Custom debug keystore

    有时候须要用到第三方API的时候,须要一个key store 的SH1值,比如使用百度地图API,假设是协同开发,就须要全部Eclipse使用同一keystore. 例如以下图所看到的: 这里须要注意 ...