RTKLIB: Code comments + new Github repository

If you’ve spent any time perusing the RTKLIB source code you will surely be aware that it is very much what I would call “old-school” code. Comments are sparse and variable names tend to be short and not always very descriptive. The upside is that the code is quite compact, significant pieces of it can be seen on a single page which can sometimes be quite nice. The downside is it can be difficult to follow if you have not been poring over it for a long time. To help myself understand the code I have added a fair bit of commenting to most of the code used to calculate the carrier-phase solution, which is really the heart of the RTKLIB kinematic solution.  This is mostly in the rtkpos.c file.

The changes are too extensive to spell out here so I have forked the RTKLIB code in Github and posted my commented code there. If you are interested, you can download it from the demo1 branch at https://github.com/rtklibexplorer/RTKLIB.  

All the previous code changes are also there as well as a couple I have not yet posted about.  The receiver data I have been using for these posts is also there in the rtklib/data/demo1 folder.  The solution file updates for VS2010 c++ are in the rtklib/app/rnx2rtkp/msc folder and the modified executable is in the rtklib/bin folder.


4 thoughts on “RTKLIB: Code comments + new Github repository”

  1. Hi there, could you provide some writeup on how RTKLIB works? Or just more informative code comments on what’s a subprogram do.
    I got an assignment to try fitting RTK processing on small ARM uC, that means stripping down the code into barebones with fixed options, without the command switch, etc. And right now I’m lost on how the program flows.
    I figured out that the UI programs (rtkrcv) just parsing the commands and starting the rtkserver, and that is all i know. Rhe structure of the header isn’t help either.


    1. Hi ArdBot. Have you looked at Appendix E in the RTKLIB user manual? It has quite a good explanation on how RTKLIB works.

      Also, I have added a fair bit of commenting to the core routines in rtkpos.c and lambda.c where most of the solution computations are done. You can find my comments in the demo1 branch of my Github repository.

      I do also have a few pages of notes on the program flow and variables used through this section of the code. At some point, I will try to translate this into something readable and post it.


      1. I’m already figure out how the mathematics works, but my understanding of the library code itself is a mess. With (IMO) unnecessarily complicated calls here and there and non-intuitive thread starting.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s