High-precision GPS positioning using MALIB
Introduction
One way to improve the accuracy of positioning satellites such as GPS is to correct errors in satellite orbits and satellite clocks using external information. The Quasi-Zenith Satellite System (QZSS) broadcasts two types of augmentation signals at 1278.75 MHz as high-precision augmentation information: CLAS (centimeter-level augmentation service) and MADOCA-PPP (multi-GNSS advanced orbit and clock augmentation - precise point positioning).
Official software that uses MADOCA-PPP is MADOCALIB (MADOCA-PPP test library) provided by the Cabinet Office, Government of Japan.
Meanwhile, the Japan Aerospace Exploration Agency (JAXA) released MALIB (MADOCA-PPP Library) in October 2024 as another official software that uses MADOCA-PPP.
I have previously tried MADOCALIB v1.2, so this time we will try MALIB.
MALIB vs. MADOCALIB
MALIB is particularly notable for its real-time positioning and its ability to directly process raw data from L6 signal receivers from u-blox, Septentrio, and Magellan Japan. The current comparison between MALIB and MADOCALIB is summarized below.
item | MALIB | MADOCALIB |
---|---|---|
provider | JAXA Satellite Navigation Unit | QZSS Strategy Office (Cabinet Office, Government of Japan) |
current version | 1.0.0 | 1.3 |
software base | RTKLIB 2.4.3 b34 | RTKLIB 2.4.3 b34 |
analysis | PPP, PPP-AR | PPP, PPP-AR |
process | realtime, post processing | post processing |
ionosphere correction provided by QZSS’s PRN 200 and 201 | - | yes (from version of 1.2) |
Both MALIB and MADOCALIB come with sample data, so you can check the operation with just a PC. You can also try it with your own GNSS receiver that can output pseudoranges consisting of code and carrier phase by using the L6 signal receiver or the MADOCA-PPP archive or realtime stream on the official QZSS website.
Installing MALIB
Here, we use a Raspberry Pi 4 (8GB memory, Raspberry Pi OS Lite 64-bit) with an Internet connection, the Cabinet Office’s GNSS realtime stream (Mirai), and the MADOCA-PPP realtime stream. For graph plotting only, we use RTKPLOT
from RTKLIB on a Windows PC. In other words, we try MALIB without our own GNSS receiver.
For information on creating a Mirai account, please refer to Using public GNSS observation data from gnss.go.jp, and for information on applying to use MADOCA-PPP, please refer to High-precision GPS positioning using MADOCALIB.
Here is the result of running uname -a
on the Raspberry Pi 4 used here.
uname -a
Linux rpi3d 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux
Log in to the Raspberry Pi, download MALIB with git clone in any directory, and build rtkrcv (the realtime positioning application) and rnx2trkp (the post-processing positioning application).
git clone https://github.com/JAXA-SNU/MALIB mailb
cd malib/app/consapp/rtkrcv/gcc
make
make install
cd ../../rnx2rtkp/gcc
make
make install
cd ../../../..
The two MALIB applications are installed in the bin
directory. The MALIB manual manual_MALIB1.0.0.pdf
is in the doc
directory.
Realtime positioning using playback files
Here, we will perform realtime positioning using the sample playback file provided.
Run rtkrcv
from this MALIB download directory. The configuration file bin/rtkrcv.conf
contains the paths to the antenna phase files and sample data files required for positioning calculations in relative path notation. When using this configuration file, run rtkrcv
from this directory so that it can find these files.
bin/rtkrcv -o bin/rtkrcv.conf
start
sol 1
The -o
option is to read the configuration file bin/rtkrcv.conf
. When you run rtkrcv
, the rtkrcv>
prompt will be displayed. Enter start
to start playback of realtime positioning. Enter sol 1
to display the positioning results sequentially.
To exit the realtime positioning results display for sol 1
, enter ctrl
+c
. To exit rtkrcv
, enter ctrl
+d
followed by ctrl
+c
.
Immediately after the positioning started, the PPP
(precise point positioning) solution was displayed, which was augmented with the pseudorange, satellite orbit, and satellite time, which are made up of the code and carrier phase. After continuing the positioning calculation for a while, the PPP-AR (ambiguity resolution), which resolves the ambiguity (contradiction) in the relationship between the code and carrier phase, came into play, and the FIX
solution was displayed.
This configuration file outputs the positioning result to data/out/rtkrcv_test.pos
. This positioning result file is displayed with RTKPLOT
, a Windows application of RTKLIB. The 2D ground track is as follows:
Let’s display this trajectory again, but limiting it to the FIX solution.
The coordinates for the stationary target were found with a spread of about 14 centimeters.
Next, we show the coordinates over time. These three figures show the coordinate changes in the east-west direction, north-south direction, and height direction, respectively, starting from the top. The purple plot is the PPP solution, and the green plot is the FIX solution.
We reached the fixed solution in approximately 16 minutes after the start of positioning.
Post-processing positioning
Next, we will perform post-processing analysis using the sample data. The configuration file used here is bin/rnx2rtkp.conf
. Specify this configuration file with the -k
option to the post-processing application rnx2rtkp
, and specify the navigation file .nav
, observation file .obs
, and MADOCA-PPP L6 file .l6
in the data
directory as arguments.
bin/rnx2rtkp -k bin/rnx2rtkp.conf data/*.{nav,obs} data/*.l6
The positioning results were displayed one by one on the screen. What is noteworthy is that the Q (quality) column in the center changes from 6
(PPP solution) to 1
(FIX solution), and the ratio value (confidence of the solution) in the rightmost column gradually increases.
The column to the right of the quality column indicates the number of satellites used for positioning. In this case, approximately 21 satellites were used.
This output can be output to the file solution.pos
using the option -o solution.pos
, and the planar trajectory and time-dependent changes in coordinates can be displayed using RTKPLOT
in the same way.
(Full solution) (Limited to FIX solution) (Changes in coordinates over time)
Compared to realtime positioning, this post-processing analysis was able to obtain a FIX solution in about 10 minutes, which is slightly shorter. Also, the variability of the FIX solution was slightly different between real-time processing and post-processing. Post-processing of this one-hour sample data took about 2 minutes.
$ time bin/rnx2rtkp -k bin/rnx2rtkp.conf data/*.{nav,obs} data/*.l6 -o solution.pos
real 2m13.401s
user 2m12.833s
sys 0m0.505s
MADOCA-PPP positioning using realtime stream
Now, we will perform MADOCA-PPP positioning using realtime stream. Open Mirai’s Receiver Map, select a receiver, and perform MADOCA-PPP positioning of its coordinates. Since navigation data is required for positioning, from the total of over 300 receiving points, use the Type
tab search to select an operating receiving point that outputs navigation data.
Here, as an example, we have selected the realtime stream from the receiving point in Kobe of Japan (mount point name is QKBP00JPN
).
Copy the sample configuration file to the installation directory with cp bin/rtkrcv.conf .
and modify this file. The modifications related to data input switching are as follows:
inpstr1-type =ntrip # (0:off,1:serial,2:file,3:tcpsvr,4:tcpcli,6:ntripcli,7:ftp,8:http,10:udpsvr,11:udpcli)
inpstr1-path =CHANGEME-MIRAI-ID:CHANGEME-MIRAI-PASSWORD@ntrip.go.gnss.go.jp/QKBP00JPN
inpstr1-format =rtcm3 # (0:rtcm2,1:rtcm3,2:oem4,3:oem3,4:ubx,5:ss2,6:hemis,7:skytraq,8:javad,9:nvs,10:binex,11:rt17,12:sbf,14:sp3,21:l6e)
inpstr3-type =ntrip # (0:off,1:serial,2:file,3:tcpsvr,4:tcpcli,6:ntripcli,7:ftp,8:http,10:udpsvr,11:udpcli)
inpstr3-path =CHANGEME-MDCPPP-ID:CHANGEME-MDCPPP-PASSWORD@CHANGEME-MDCPPP-SVR/CHANGEME-MDCPPP-PRN209
inpstr3-format =l6e # (0:rtcm2,1:rtcm3,2:oem4,3:oem3,4:ubx,5:ss2,6:hemis,7:skytraq,8:javad,9:nvs,10:binex,11:rt17,12:sbf,14:sp3,21:l6e)
Here,
- Replace
CHANGEME-MIRAI-ID
andCHANGEME-MIRAI-PASSWORD
with your Mirai ID and password, - Replace
CHANGEME-MDCPPP-ID
,CHANGEME-MDCPPP-PASSWORD
,CHANGEME-MDCPPP-SVR
,CHANGEME-MDCPPP-PRN209
with your MADOCA-PPP realtime stream service ID, password, server URL, PRN 209 (204, 205, 206 are also OK) mount point name,
respectively. MALIB can directly interpret the MADOCA-PPP L6 format by setting inpstr3-format
to l6e
.
Also, set it to output the results to the solution.pos
file in the current directory.
outstr1-path =./solution.pos
In fact, it was not always possible to obtain a fixed solution. Sometimes an hour would pass with the PPP solution, and sometimes the coordinates would no longer be output after a while. Here, we will limit the satellite systems to GPS and QZSS.
pos1-navsys =17 # (1:gps+2:sbas+4:glo+8:gal+16:qzs+32:bds+64:navic)
pos2-arsys =25 # (1:gps+8:gal+16:qzs)
With this configuration file, run the following command:
bin/rtkrcv -o rtkrcv.conf -s -t 3
The options have the following meanings:
-s
is an option to start positioning immediately without entering the start command at the rtkrcv prompt.-o rtkrcv.conf
is an option to read the configuration filertkrcv.conf
.-t 3
is an option to output debug information to the filertkrcv_[date and time].trace
(where [date and time] is the date and time of execution).
Log in to the Raspberry Pi on two screens, run rtkrcv
on one screen to check that it works, and observe debug information and positioning results on the other screen.
After positioning begins, the following commands are entered into rtkrcv
on the left screen.
ssr 1
: Displays augmentation information sequentially at 1 second intervals. Once the augmentation information has been confirmed, pressctrl
+c
to end this sequential display.obs
: Displays observation data.nav
: Displays navigation data.stat
: Displays the positioning status.sol 1
: Displays positioning results sequentially at 1 second intervals.
Meanwhile, the following commands are entered on the right screen.
tail -f rtkrcv_[date and time].trace
: Displays debug information incrementally with thetail
command. In bash or zsh, pressing thetab
key after enteringrtkrcv_
will complete the rest of the file name.tail -f solution.pos
: Displays positioning results incrementally.
In fact, at this time, after a while of positioning calculations, the output of solutions stopped, and in the end I was unable to obtain a fixed solution. The debug information left a message saying large chi-squared
. The reason I excluded Galileo from the satellite systems used in the configuration file mentioned above is to reduce this error. It seems that this error is more likely to occur when the systems used include anything other than GPS and QZSS. There may be an error in my procedure.
The following results are from the next day when I performed positioning under the same conditions and obtained a fixed solution.
(Full solution) (Limited to FIX solution) (Changes in coordinates over time)
Using this realtime stream, I was able to get a fix in about 30 minutes. With this setting, the number of satellites used for positioning was about 11. I plan to record the realtime stream and use playback to find better settings.
Conclusion
I tried the MADOCA-PPP realtime positioning library MALIB. MALIB has the advantage of being able to perform realtime positioning and use data from many L6 signal receivers as is. By accumulating know-how, such as specifying options, it seems possible to perform stable positioning.
In the future, I would like to try to create a MADOCA-PPP autonomous crawler by combining the Pocket SDR FE4CH, MALIB, PixHawk, and CuGo V3 complete kit.