Sub Centimeter GPS With RTKLIB




Introduction: Sub Centimeter GPS With RTKLIB

I recently had the need for a very accurate and precise positioning system, but had a hard time finding one. So I figured I'd share my discovery here so everyone will know centimeter or decimeter accuracy is easily within reach.

I plan to use this with 3d Robotics Ardupilot/rover/copter since their software is so well funded/researched, widely supported, and open source. The processing software is called RTKLIB and runs on Linux, Windows, Android, and with some work maybe Mac.

In my specific case Navio+ and a Raspberry Pi will be used on a UAV. I'll update when i have more data and pictures.

Step 1: Capabilities

This method does typically require you to have two GPS receivers that can output raw data to achieve maximum accuracy. This is the only additional cost compared to traditional GPS since the software is free.

(1) It supports standard and precise positioning algorithms with: GPS(USA), GLONASS(Russia), Galileo(EU), QZSS, BeiDou(China) and SBAS. Most antennas only support GPS. Be sure to purchase one with multiple constellations.

(2) It supports various positioning modes with GNSS for both real-time and post-processing: Single, DGPS/DGNSS, Kinematic, Static, Moving-Baseline, Fixed, PPP Kinematic, PPP-Static, and PPP-Fixed

(3) It supports external communication via: Serial, TCP/IP, NTRIP, local log file (record and playback) and FTP/HTTP (automatic download)

(4) It supports L1 signals and L2 if you can afford military spec. receivers.

Step 2: How It Works

Real Time Kinematic (RTK) GPS uses a known static point compared with where the GPS signal says it is and applies that error correction to your "rover" in order to find its exact position. All via raw frequency measurement not GPS messages.

These corrections can be sent many ways, but typically some type of Bluetooth or internet protocol(TCP) is used (as mentioned before) specifically for GPS NTRIP via NTRIP caster.

-Exploring these sources should tell you everything you ever wanted to know.

Realtime and post-processing modes


Enables positioning as a normal GNSS receiver using supplied ephemerides and clock data from the satellites. If the SBAS data is available for this geographic region, it can be used to improve the rover's position (Single+SBAS)


GPS/GNSS where positioning results from a rover and base station are used to improve the rover's position.

Real Time Kinematic

(RTK) Kinematic

Raw data from a moving rover is combined with raw data from a static base station to improve the rover's position. Static Similar to above, but the rover is stationary.


Similar to above, but the distance between the rover and base station is calculated irrespective of the base station's position.


Used for RTKLIB residuals analysis (Tropo+Iono+integer ambiguity resolution+Errors, see Section B.3 in the RTKLIB Manual).

Precise Point Positioning (PPP)

PPP-Kinematic Raw

Data from a moving rover is combined with real time predicted or non-real time measured precise ephemerides and satellite clocks to improve the rover's position.


Similar to above, but the rover is stationary.

PPP-Fixed Used for residuals analysis.

For android app (RTK+): It does everything RTKLIB does. But the GPS in the device can't be used for RTK since none currently support the output of Raw GPS data. However you can still use a separate GPS via ftdi USB adapter.

Step 3: Example

Differential code+phase static positioning relative to an IGS station. Short base vector length.

Base station: EUREF/SVTL

Date: 2013-12-28 (WEEK=1772 DOY=362)

Time interval: 100 ms Time alignment: 1s

Distance to base station: ~0.8 km

Geoid/Pseudo-geoid model: EGM2008

Measurement site: near SVTL

Antenna: Trimble Bullet III 3.3V

Receiver: EVK-6T-0

Picture of results above.

The closer you rover is to the base station the more accurate you results will be. I wouldn't go any further than 20km.

All states in the US should have broadcasting base stations covering most most the state (Typically the DOT). Some charge a nominal fee and some cost $1000 for access.

Navio+Raspberry Pi from Emlid also has some tutorials and product suggestions for using RTKLIB. Which is what I am currently working on.

Supported receivers under supported hardware.

Ground plates (Ground plane) are also necessary in high accuracy applications. Typically a conductive disc λ/4 in radius. So for GPS =1575mhz wavelength = 19cm 9.5cm (~4"+) and up will isolate the antenna well. Bigger is always better.

More details for RTK fix solution:

Step 4: Hardware and Software Vendors


U-blox (receivers)

-Compatible models 6t, 8t


Navspark (receivers)




Tallysman (antennas)
-Buy on digikey

Additional Software tools:
U-center (u-blox)
GNSS Viewer (Navspark/Skytraq)
CDDIS (Nasa database)
glab (ESA)

All RTKLIB supported receivers

Tools Contest

Participated in the
Tools Contest

Small Spaces Contest

Participated in the
Small Spaces Contest

Pi/e Day Contest

Participated in the
Pi/e Day Contest

Be the First to Share


    • Block Code Contest

      Block Code Contest
    • Clocks Contest

      Clocks Contest
    • Organization Challenge

      Organization Challenge



    Question 3 years ago on Introduction

    Hi, great article. Any developments with your UAV? I'm at the start of a similar journey, I'd like to get small UGVs driving beaches when the tide is out taking continuous RTK measurements... For a reasonable cost. Thanks in advance.


    3 years ago

    I am currently working on developing something utilizing RTKLIB source coding.

    It was very refreshing to stumble on this article. Thank you for sharing.


    5 years ago

    A bit over my head, wish there was a dumbed down version of this


    Reply 5 years ago

    Hey ildarius, did you ever get a good understanding of this stuff? I have been trying for 2-3 months to understand all of this and it just seems >1cm past my reach! I have written and downright begged for some videos that take this stuff from say 7th grade level to Grad School. The problem is that all of the Post Processing is discussed at a level that beginners simply can not grasp an understanding. So anyway, I just wanted to check and see if you ever got there, if so, do you have any words of wisdom, etc? I have 2 Reach RS units and a Reach module to put on my Phantom 4 but I want and must get an understanding of PPK (post processing)


    Reply 5 years ago

    Hi Timmy

    No, I finally gave up. There's definitely a lack of clear videos for beginners about this stuff


    Reply 5 years ago

    I've only got one ublox-M8T, and I was eventually able to get it to report some sub-centimeter scale positions referenced to a CORS station, but that was including averaging over a long, stationary time. I liked the stuff for guidance. I eventually got it working under Wine on OSX, communicating with the M8t and finally getting fixes. The big tricks for me was using the updated 2.4.3 and rtkexplorer demo5 code which actually decoded the M8T messages, then figuring out how to turn on some monitors/logs (tiny box just above the RTKNAVI Start button) and see where it might be having problems.


    6 years ago

    With this setup can the raw data be sent out in RINEX?


    Reply 5 years ago

    The RTKLIB program `conv2bin rover.ubx` file can convert files into RINEX files:

    $ bin/convbin rover_20171211T165315.ubx

    input file: rover_20171211T165315.ubx (u-blox)

    ->rinex obs : rover_20171211T165315.obs

    ->rinex nav : rover_20171211T165315.nav

    ->rinex gnav: rover_20171211T165315.gnav

    ->rinex hnav: rover_20171211T165315.hnav

    ->rinex qnav: rover_20171211T165315.qnav

    ->rinex lnav: rover_20171211T165315.lnav

    ->rinex cnav: rover_20171211T165315.cnav

    ->rinex inav: rover_20171211T165315.inav

    ->sbas log:

    2017/12/11 16:53:36-12/11 23:54:54: O=25279 N=50 G=102 H=75 L=88 S=13470