A rtklib improve open source project was created on github

Posted by endersix on Fri, 07 Jan 2022 15:51:31 +0100

Open source purpose

In view of the huge update interval of rtklib, the author fork ed a warehouse on github for the following purposes,

  • Fix bug/issue in code
  • Adjust or optimize the code or structure as little as possible, improve program performance, compiler, operating system support, etc
  • Improvement or optimization of algorithm performance
  • Create a rtklib wiki

Current work

At present, some changes have been made, and this part of the update is temporarily located in the branch cmake_support. After cmake's support is completed, it will merge to the master branch
https://github.com/akstuki/RTKLIB_improve/tree/feature/cmake_support

In the current cmake_ The following two bug s are mainly fixed in the support branch,

  • As for the bug of reading files under the path under windows, windows actually supports the path separator /, but it must be used in the original code\
  • Fixed a bug under the debug of a single point locator

In addition, this branch is mainly dedicated to separating the dependence of programs under the app on the compiler and reorganizing the code with CMake, so that we can have better cross platform and multi compiler support. Now rnx2rtkp's support has been completed and tested under Windows and Linux respectively.

use

The following is a brief introduction to cmake's support for rnx2rtkp. Taking linux as an example, windows is the same,

  1. First, we use the following command to generate a makefile. The following command will be in the directory rtklib_ Execute under improve / APP / consapp / rnx2rtkp,
$ cmake -S . -B binn

The output of the above command looks like the following,

-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /cygdrive/c/xq/1-own/0-code/0rtkapps/rtklib_improve/app/consapp/rnx2rtkp/binn
  1. Compiler
    Execute the following two lines of commands:,
    cd binn
    make

In windows, if we install visual studio, the first step will generate the project file of visual studio in binn folder. We can use visual studio to open the file and compile it

The compiled output is likely to look like the following,

[  4%] Building C object CMakeFiles/rnx2rtkp.dir/rnx2rtkp.c.o
[  9%] Building C object CMakeFiles/rnx2rtkp.dir/cygdrive/c/xq/1-own/0-code/0rtkapps/rtklib_improve/src/rtkcmn.c.o
/cygdrive/c/xq/1-own/0-code/0rtkapps/rtklib_improve/src/rtkcmn.c: In function 'tickget':
/cygdrive/c/xq/1-own/0-code/0rtkapps/rtklib_improve/src/rtkcmn.c:1853:21: warning: unused variable 'tp' [-Wunused-variable]
 1853 |     struct timespec tp={0};
      |                     ^~
/cygdrive/c/xq/1-own/0-code/0rtkapps/rtklib_improve/src/rtkcmn.c: In function 'readngspcv':
/cygdrive/c/xq/1-own/0-code/0rtkapps/rtklib_improve/src/rtkcmn.c:2315:13: warning: 'strncpy' output may be truncated copying 61 bytes from a string of length 255 [-Wstringop-truncation]
 2315 |             strncpy(pcv.type,buff,61); pcv.type[61]='\0';
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~
[ 13%] Building C object CMakeFiles/rnx2rtkp.dir/cygdrive/c/xq/1-own/0-code/0rtkapps/rtklib_improve/src/rinex.c.o
In function 'readrnxclk',
    inlined from 'readrnxfp' at /cygdrive/c/xq/1-own/0-code/0rtkapps/rtklib_improve/src/rinex.c:1511:26:
/cygdrive/c/xq/1-own/0-code/0rtkapps/rtklib_improve/src/rinex.c:1453:9: warning: 'strncpy' output may be truncated copying 4 bytes from a string of length 1024 [-Wstringop-truncation]
 1453 |         strncpy(satid,buff+3,4);
      |         ^~~~~~~~~~~~~~~~~~~~~~~
[ 18%] Building C object CMakeFiles/rnx2rtkp.dir/cygdrive/c/xq/1-own/0-code/0rtkapps/rtklib_improve/src/rtkpos.c.o
[ 22%] Building C object CMakeFiles/rnx2rtkp.dir/cygdrive/c/xq/1-own/0-code/0rtkapps/rtklib_improve/src/postpos.c.o
[ 27%] Building C object CMakeFiles/rnx2rtkp.dir/cygdrive/c/xq/1-own/0-code/0rtkapps/rtklib_improve/src/solution.c.o
[ 31%] Building C object CMakeFiles/rnx2rtkp.dir/cygdrive/c/xq/1-own/0-code/0rtkapps/rtklib_improve/src/lambda.c.o
[ 36%] Building C object CMakeFiles/rnx2rtkp.dir/cygdrive/c/xq/1-own/0-code/0rtkapps/rtklib_improve/src/geoid.c.o
[ 40%] Building C object CMakeFiles/rnx2rtkp.dir/cygdrive/c/xq/1-own/0-code/0rtkapps/rtklib_improve/src/sbas.c.o
[ 45%] Building C object CMakeFiles/rnx2rtkp.dir/cygdrive/c/xq/1-own/0-code/0rtkapps/rtklib_improve/src/preceph.c.o
In function 'readsp3h',
    inlined from 'readsp3' at /cygdrive/c/xq/1-own/0-code/0rtkapps/rtklib_improve/src/preceph.c:306:12:
/cygdrive/c/xq/1-own/0-code/0rtkapps/rtklib_improve/src/preceph.c:103:13: warning: 'strncpy' output may be truncated copying 3 bytes from a string of length 1014 [-Wstringop-truncation]
  103 |             strncpy(tsys,buff+9,3); tsys[3]='\0';
      |             ^~~~~~~~~~~~~~~~~~~~~~
[ 50%] Building C object CMakeFiles/rnx2rtkp.dir/cygdrive/c/xq/1-own/0-code/0rtkapps/rtklib_improve/src/pntpos.c.o
[ 54%] Building C object CMakeFiles/rnx2rtkp.dir/cygdrive/c/xq/1-own/0-code/0rtkapps/rtklib_improve/src/ephemeris.c.o
[ 59%] Building C object CMakeFiles/rnx2rtkp.dir/cygdrive/c/xq/1-own/0-code/0rtkapps/rtklib_improve/src/options.c.o
[ 63%] Building C object CMakeFiles/rnx2rtkp.dir/cygdrive/c/xq/1-own/0-code/0rtkapps/rtklib_improve/src/ppp.c.o
[ 68%] Building C object CMakeFiles/rnx2rtkp.dir/cygdrive/c/xq/1-own/0-code/0rtkapps/rtklib_improve/src/ppp_ar.c.o
[ 72%] Building C object CMakeFiles/rnx2rtkp.dir/cygdrive/c/xq/1-own/0-code/0rtkapps/rtklib_improve/src/rtcm.c.o
[ 77%] Building C object CMakeFiles/rnx2rtkp.dir/cygdrive/c/xq/1-own/0-code/0rtkapps/rtklib_improve/src/rtcm2.c.o
[ 81%] Building C object CMakeFiles/rnx2rtkp.dir/cygdrive/c/xq/1-own/0-code/0rtkapps/rtklib_improve/src/rtcm3.c.o
[ 86%] Building C object CMakeFiles/rnx2rtkp.dir/cygdrive/c/xq/1-own/0-code/0rtkapps/rtklib_improve/src/rtcm3e.c.o
[ 90%] Building C object CMakeFiles/rnx2rtkp.dir/cygdrive/c/xq/1-own/0-code/0rtkapps/rtklib_improve/src/ionex.c.o
[ 95%] Building C object CMakeFiles/rnx2rtkp.dir/cygdrive/c/xq/1-own/0-code/0rtkapps/rtklib_improve/src/tides.c.o
[100%] Linking C executable rnx2rtkp.exe
[100%] Built target rnx2rtkp

The compilation is successful. We check the following current directory and find that the executable has been generated,

$ ls
CMakeCache.txt  CMakeFiles  CTestTestfile.cmake  Makefile  cmake_install.cmake  rnx2rtkp.exe
  1. run test
    We run test with the following command,
    make test
    The output looks like the bottom,
$ make test
Running tests...
Test project /cygdrive/c/xq/1-own/0-code/0rtkapps/rtklib_improve/app/consapp/rnx2rtkp/binn
      Start  1: test1
 1/21 Test  #1: test1 ............................   Passed    0.19 sec
      Start  2: test2
 2/21 Test  #2: test2 ............................   Passed    0.30 sec
      Start  3: test3
 3/21 Test  #3: test3 ............................   Passed    0.63 sec
      Start  4: test4
 4/21 Test  #4: test4 ............................   Passed    0.73 sec
      Start  5: test5
 5/21 Test  #5: test5 ............................   Passed    0.71 sec
      Start  6: test6
 6/21 Test  #6: test6 ............................   Passed    0.64 sec
      Start  7: test7
 7/21 Test  #7: test7 ............................   Passed    0.72 sec
      Start  8: test8
 8/21 Test  #8: test8 ............................   Passed    0.72 sec
      Start  9: test9
 9/21 Test  #9: test9 ............................   Passed    0.28 sec
      Start 10: test10
10/21 Test #10: test10 ...........................   Passed    0.28 sec
      Start 11: test11
11/21 Test #11: test11 ...........................   Passed    0.30 sec
      Start 12: test12
12/21 Test #12: test12 ...........................   Passed    0.30 sec
      Start 13: test13
13/21 Test #13: test13 ...........................   Passed    0.28 sec
      Start 14: test14
14/21 Test #14: test14 ...........................   Passed    0.28 sec
      Start 15: test15
15/21 Test #15: test15 ...........................   Passed    0.27 sec
      Start 16: test16
16/21 Test #16: test16 ...........................   Passed    0.28 sec
      Start 17: test17
17/21 Test #17: test17 ...........................   Passed    0.74 sec
      Start 18: test18
18/21 Test #18: test18 ...........................   Passed    1.37 sec
      Start 19: test19
19/21 Test #19: test19 ...........................   Passed    0.73 sec
      Start 20: test20
20/21 Test #20: test20 ...........................   Passed    1.05 sec
      Start 21: test21
21/21 Test #21: test21 ...........................   Passed    0.98 sec

100% tests passed, 0 tests failed out of 21

Total Test time (real) =  11.82 sec

We can view the output file in the current directory,

Under windows, we use visual studio to open the project. It's like this below. If we want to run all test s, we just need to compile RUN_TESTS is enough,

Write at the end - welcome to join

I hope I can stick to it. In addition, friends interested in this open source are welcome to join us for discussion and improvement. I also hope you can contribute your puzzles or problems encountered in the use of rtklib. You can tell us in any way, leave a message or github issue.