How Xiaobai learns GNSS (3) - How to read rtklib source code

overview

Like the previous two articles, it is all about drawing the key points, instead of interpreting the code, it will only tell you which codes need to be read, which ones can be read later, and which ones basically do not need to be paid attention to.

First give an overview, namely input -> processing -> output.

The input observation file (o file) and ephemeris file (p file) are both in rinex format. It is recommended to have a preliminary understanding of this format. There are also some blogs on the Internet, search by yourself.

It is more recommended to read the rinex English format document, because it is often used, especially the observation file.

Other configuration files and rtklib result output files are also recommended to understand. In addition to using rtkplot for drawing analysis, you can also customize the output format and use python or matlab for result analysis.

If it is dynamic, you can only write the corresponding program for comparative analysis.

I actually uploaded a set of simple python comparison tools for dynamic comparison on git. If you need to, please reply to git in the background, switch to the mulfreq-spp branch, and pull the latest code. The tool is under the python folder.

Regarding others, such as some before the rtkpos() function, observation data reading, ephemeris reading, and some default field matching logic to support multi-file processing, I personally do not recommend reading.

It is recommended to start reading and debugging directly from the rtkpos() function, and read the previous ones after there is a need.

If you have the energy, it is recommended to understand the printing and output of the following logs, because this information is needed for algorithm iteration and debugging.


The following is the logic part of the algorithm program.

Start with the rtkpos() or relpos() function to read the code related to the rtk algorithm.

First of all, we must know how the observation data to be processed is stored. In addition, as for how to use the ephemeris and observation values ​​to calculate the position and clock error of the satellite, rtklib has already calculated it, and my personal suggestion is that there is no need to read it.

But the storage of satellite position and satellite clock needs to understand how it is stored.

When you need to use it, you know where to get it, and you don't need to pay attention to the intermediate process. When you feel that the rtklib calculation is wrong, go to understand the intermediate process.

In addition to the orbital clock information of the satellite, most of the intermediate processing information of the satellite is stored in the rtk_t->stat data structure of rtklib.

The .stat file in the previous figure is basically the output of the structure, which can be used for troubleshooting and positioning. Personally, I suggest that the .stat file can be visualized, that is, drawn as a graph, to understand the processing status of each satellite or the entire epoch more intuitively.

The other is the state of the kalman filter and the storage of the covariance matrix. The calculation and storage of various matrices in the calculation process need to be understood.

The algorithm flow is basically from top to bottom. Some simple intermediate processes do not need to be paid attention to, but the input and output of satpos need to be paid attention to.

Not only satpos, but when looking at other functions, you should also pay attention to what the input and output of this function are.

Unfortunately, except for some main processes that have detailed input and output introductions, the functions in the algorithm process need to be familiarized by yourself.

Basically, it is the entire RTK positioning process, data preprocessing->residual calculation->filtering->fixed ambiguity.

It’s just that the data preprocessing of RTKLIB is hidden in some functions. Except for the cycle slip detection and comparison system, other preprocessing, such as observation value altitude angle filtering and signal-to-noise ratio filtering, are all in some corner functions.

No public

Sometimes codes or resources are placed on the personal official account. If you have any questions, you can reply in the background of the official account, and the answer is faster. Welcome to pay attention to GNSS and automatic driving

Summary of links to other related articles

How Xiaobai learns GNSS (1) - Wutong Fighting Blog - CSDN Blog

How Xiaobai learns GNSS (2)_Indus Fighting Blog-CSDN Blog

Guess you like

Origin blog.csdn.net/dong20081991/article/details/128176792