I’ve had a few questions recently about differences showing up when the same set of raw data measurements are processed real-time and when they are post-processed. Since I haven’t done a lot of real-time work I didn’t have a good answer to these questions, but it seemed like an interesting problem so I thought I would dig into a little bit.
In many cases, these differences can be traced to a poorly performing data link between base and rover that loses, delays or corrupts the base measurement data. These problems are usually diagnosed fairly easily by looking at the “age of differential” between base and rover or by seeing missing data in plots of the base observations. My interest is not in these cases but rather where the data link is performing well and there is still a difference between the real-time and post-process solutions.
To troubleshoot real-time solutions is a little trickier than post-processing solutions because you may need a way to re-run the data through the real-time RTKLIB app (either RTKRCV or RTKNAVI) to recreate the problem. The standard *.ubx log files do not contain enough information to do this since they contain only a time stamp for when the measurement was made and not when it was actually available to the solution. There will usually be some delay between the two because of latencies in the data link between rover and base. The post-processing solutions ignore this delay and simply align the two measurements assuming zero delay but we need to know what these delays are to recreate the real-time solution.
The real-time solution apps have an option in the input stream setup to read from a file instead of a real-time stream. This allows you to re-run previously recorded log files but when doing this they require a *.ubx.tag file in addition to the *.ubx file to provide the latency information. These *.ubx.tag files are generated automatically when you log real-time data if you select the appropriate option before you collect the data. For RTKRCV, this is a “::T” appended on to the end of the log file name. For RTKNAVI, it is checking the “Time Tag” box in the log stream options. I recommend always enabling these options when you are running real-time solutions because the extra files are not very large and you never know when you are going to get something unusual in the data that you would like to investigate later.
Since none of the data sets I had been sent to look at contained tag files, my first step was to try and collect some data that looked good in post-processing but not in real-time with time tags enabled. I chose to use my Emlid Reach receivers to do this, in part because it is easy to do real-time solutions with the onboard wireless, and in part because I wanted to try out their recently released 2.1.6 version of the RTKLIB code. This version is a very close cousin to my demo5 code and contains all of its features (although many of them are not currently accessible through the Reachview GUI).
I first added or modified a couple of lines of code in the Reach startup files to save time tag versions of both the base and rover data on the rover, and the base data on the base. I’ve added some notes at the bottom of this post on how I did it but I don’t necessarily recommend doing it yourself unless you are fairly comfortable with linux because it can be a little tricky to recover without reflashing the unit if you make a mistake. I wanted to be able to collect data on the Reach units using the command line based RTKRCV app but use the GUI based RTKNAVI on my laptop to re-create the realtime run. This is because RTKNAVI has a much nicer interface with a lot more information available. However, this meant that I needed to fix an incompatibility in the RTKLIB code between the time stamp formats of RTKRCV and RTKNAVI as described in the RTKLIB Github issue #99. Using the fix recommended in the issue description, I rebuilt the code on the Reach unit to create a new str2str executable with this fix incorporated.
With these changes, I can collect measurement data that gives me the option to run post-process solutions or re-created real-time solutions. In addition, these can be run either with measurements made before or after the data link and raw binary to RTCM conversion. This gives me quite a bit of capability to investigate where a potential problem might be occurring.
To test this setup, I first collected some static data with both base and rover exposed to open skies. I got all three sets of data and tag files and using these I was able to re-run the data using RTKNAVI. Both real-time and post-processed solutions got a fix fairly quickly and the two solutions were very similar. So, nothing interesting to look at in this example.
Next I placed both base and rover on my back patio, just a few meters away from the house and partially blocked by a large tree, knowing that this would be a more stressful measurement environment. I may have just got lucky, but the very first data set I collected gave me multiple fixes in post-processing but none in real-time as shown below (post-process on the left, real-time on the right). The two loss of fixes are caused by me restarting the data collection on the Reach rover. In this case I ran the post-processing solution using the base data collected on the base in raw binary format (*.ubx), not the data after it had been converted to RTCM and transmitted to the rover (*.rtcm) since this is the way post-processing is usually done.
Next I ran a second post-processing solution, this time using the raw measurement file saved in RTCM format on the rover. This time there was no fix and the solution looked nearly identical to the real-time solution plotted above. So somewhere between when these two data files were saved, the problem is occurring. Note that in this case I was able to do all this without the time tag files or re recreating a real-time run but I imagine this capability will be helpful in future analysis.
I had monitored the age of differential while collecting the data and after collecting the data I plotted the base observations to verify there was no missing data. This suggests that the data link was working fine. So my next guess was that the conversion from raw binary measurements to RTCM format might be the cause of the problem. In real-time solutions, the base data is typically translated to RTCM before transmitting over the data link to the rover to compress the data and reduce bandwidth requirements on the data link, and this is the default configuration of the Reach units. The amount of compression will vary depending on the details of the data but in this case the RTCM file (*.rtcm) was about one third as large as the raw binary file (*.ubx). Some of this is lossless compression but not all of it so there is potential for degrading the solution with this translation.
The next step was to isolate the effects of the RTCM translation from any effects from the data link latency. I did this by using the STRSVR app to translate the raw binary base data saved on the base station to RTCM format. I configured the conversion options to use the same RTCM messages as used by Reach. ran this data through a post-process solution. Sure enough, just converting the undelayed raw binary data to RTCM was enough to break the solution. That means, at least for this case, we can ignore any effect of the data link delays and focus on the RTCM conversion.
Note that the post-processing apps require all the measurement input files to be in RINEX format. This means that both the raw binary files and the RTCM files are converted to RINEX first using RTKCONV first as part of the post-processing procedure. One thing to be aware of when using RTKCONV to convert from RTCM to RINEX is the signal mask input options. The default signal mask has all observation types selected and if left this way it will cause the file header to be incorrect. If you do not de-select all the extra observation types you will see this in your observation file header
The number of observations is 8 instead of 4 and there are extra observation types listed. This will confuse RTKLIB and it will not interpret the rest of the file properly. Specifically it will not pick up any of the GLONASS observations. It won’t flag an error but it will cause all the GLONASS measurements to be left out of your solution. The signal mask button is on the options page as shown below. You want to un-check all options except “1C”.
This post is already getting fairly long so I will put off to the next post the rest of the story including discussion about what is actually lost in the translation to RTCM and why it caused this particular example to fail. In general, though, it is important to understand there are real losses in this translation and that they may affect the quality of your solution. If you have the bandwidth to transfer the raw binary format instead of the RTCM format I would recommend you consider doing that. If you don’t have the bandwidth, I would suggest you consider the trade-offs from reducing the base sample rate enough so that you are able to transfer the measurements in raw format. As I mentioned above, in this example the raw binary file was about three times as large as the RTCM file.
Notes on how I set up the Reach to collect extra data. There may be a more elegant way to do this but I just wanted a quick hack. Please be careful if you try to do this yourself and be sure to back up any files before modifying them:
RTKLIB has a “::T” option to record the time-tags but I don’t believe Reach supports this option. I got around this by adding extra instances of str2str initiated from a function call I added to the “reach_setup” script in the /usr/bin folder. This, and all the instructions below assume you are running the 2.1.6 version of Reach code.
ncat -k -l 2000 < /dev/ttyMFD1 > /dev/ttyMFD1 &#start logging data files with time stampsreach_time_logs# Run ReachViewled set_color green
I created the “reach_time_logs” script in the /usr/bin folder and put in the following lines of code
#!/bin/bash# Log u-blox data to file with time stamp logs
# find unused file namepath=”/home/root/logs/”i=0fname=$path”rover”$i”.ubx”while [ -f $fname ]; dolet “i=i+1”fname=$path”rover”$i”.ubx”donefnameR=$path”rover”$i”.ubx”fnameB=$path”base”$i”.rtcm”# start data collection from rover/usr/bin/RTKLIB/app/str2str/gcc/str2str_tag -in tcpcli://localhost:2000 -out $fnameR::T &# start data collection from base/usr/bin/RTKLIB/app/str2str/gcc/str2str_tag -in tcpcli://192.168.43.186:9000 -out $fnameB::T &
This finds an unused filename and saves the measurements and the tags for both the rover and base data. You will need to modify the specified input stream for the base data to match what you are using. You can look at the inpstr2-type and path in the /usr/bin/RTKLIB/app/rtkrcv/rtk.conf file for the exact format. You might be able to use the RTKLIB wildcards instead to create the file name but I just copied this code from my PiZero logger which doesn’t update the clock. I don’t know if on the Reach the clock has been updated yet at this point in the start-up.