RTKLIB Documentation

repository·main·Indexed 21 days ago

https://github.com/rtklibexplorer/rtklib

A software library for GNSS positioning providing tools for real-time kinematic (RTK) and post-processing applications. It includes command-line binaries and Qt-based graphical applications such as rtkget_qt, rtklaunch_qt, and rtknavi_qt. The library supports antenna calibration via ANTEX (.atx) and Phase Center Variation (.pcv) file formats, and provides configuration scripts for OEM3 serial communication and raw data logging.

Tokens
17.5K
Snippets
73
Records
86
Agent score
75%

What's inside RTKLIB

  1. Overview of RTKLIB-EX

    main

    RTKLIB-EX (formerly RTKLIB demo5) is a version of RTKLIB optimized for low-cost GNSS receivers (single, dual, or triple frequency), with specific optimization for u-blox receivers. It is based on RTKLIB 2.4.3.

    Warning: This software is provided "AS IS" without warranties. Use extreme caution, especially in real-time applications.

  2. Build and install for Linux (Deprecated)

    main

    The following methods for Linux are considered deprecated. Use the CMake method instead.

    Command Line User Interfaces (CUIs)

    1. Navigate to the specific app directory: app/consapp/<appName>/gcc.
    2. Run make.

    Graphical User Interfaces (Qt based)

    1. Navigate to app/qtapp.
    2. Run qmake.
    3. Run make.
    4. Run ./install_qtapp.

    Note: The installation step copies compiled executables into a directory named RTKLIB_bin located next to the rtklib source directory.

  3. Build CLI and GUI using CMake (Windows/Linux)

    main

    You can build both the CLI and GUI (except for the Embarcadero GUI) using CMake.

    Prerequisites for GUI: You must have the following Qt5/6 modules installed:

    • Core
    • Gui
    • Widgets
    • SerialPort
    • Xml
    • Concurrent
    • WebEngineWidgets or WebKitWidgets (optional, required for maps)
    • LinguistTools (optional, required for translations)

    Build Steps:

    1. Create a build directory.
    2. Setup the CMake project.
    3. Compile the CLI & GUI.
    4. Run tests.
    # 1) create a build directory
    mkdir build
    cd build/
    
    # 2) setup CMake project
    cmake ..
    
    # 3) compile CLI & GUI
    make
    
    # 4) run tests
    make test
  4. Build and install for Windows using Embarcadero compiler

    main

    To build the Windows-specific versions using the Embarcadero compiler, follow these steps based on the application type:

    Graphical User Interfaces (GUIs)

    1. Build the executables using the app/winapp/rtklib_winapp.groupproj project file.
    2. Install the executables and DLLs to ../RTKLIB/bin by running app/winapp/install_winapp.bat.

    Command Line User Interfaces (CUIs)

    1. Build the executables using the app/consapp/rtklib_consapp.groupproj project file.
    2. Install the executables to ../RTKLIB/bin by running app/consapp/install_consapp.bat.
  5. Understand the NGS Phase Center Variation (PCV) data format

    main

    The .pcv files in RTKLIB contain Phase Center Variation (PCV) data, typically sourced from NGS (National Geodetic Survey). This data is used to correct for variations in the antenna's phase center as a function of the signal's angle of arrival.

    Each antenna entry in the file follows a structured multi-line format:

    1. Header Line: Contains the antenna identifier, a description, the source (e.g., NGS), a version/index number, and a date.
    2. Primary Coefficients: A line of three floating-point values representing core parameters.
    3. Elevation/Azimuth Coefficients (Set 1): Two blocks of coefficients used to model variations based on the signal's geometry.
    4. Elevation/Azimuth Coefficients (Set 2): A second set of coefficients for different frequency bands or modeling requirements.

    Note: The specific mathematical application of these coefficients depends on the RTKLIB processing engine's implementation of the PCV model.

  6. Understand the ANTEX antenna calibration file format

    main

    An ANTEX (.atx) file contains GNSS receiver antenna corrections, including Phase Center Variation (PCV) data. The file structure consists of a header section followed by antenna-specific blocks.

    Key components include:

    • Header: Contains the ANTEX version, PCV type, and reference antenna information.
    • Antenna Block: Starts with START OF ANTENNA and includes the antenna type, serial number, manufacturer, and calibration method.
    • Frequency Blocks: Each frequency (e.g., G01, R01) is enclosed between START OF FREQUENCY and END OF FREQUENCY. These blocks contain the antenna's phase center offsets (North, East, Up) and PCV values mapped to specific frequencies or azimuths.
  7. Understand the Phase Center Variation (PCV) data file format

    main

    The .pcv file format contains Phase Center Variation (PCV) data used to correct antenna phase center offsets. Each entry in the file represents a specific antenna model and follows a structured multi-line format.

    An entry consists of:

    1. Header Line: Contains the antenna name (e.g., TPS_CR4+RD), a description (e.g., SCIS Choke Ring+rd), a source/organization identifier (e.g., NGS ( 3)), and a date (e.g., 05/05/20).
    2. Parameter Block 1: Three numeric values representing primary coefficients or offsets.
    3. Data Series 1: A sequence of values representing variations (often related to elevation or azimuth).
    4. Parameter Block 2: Three numeric values.
    5. Data Series 2: A second sequence of variation values.

    Note that different antenna models may have different numbers of parameter blocks and data series depending on the complexity of the model (e.g., L1 vs L1/L2 support).

  8. Understand the format of Phase Center Variation (PCV) data files

    main

    The .pcv files (specifically the <ant_info.003> format) contain antenna phase center variation data used for high-precision GNSS positioning. The file structure provides antenna offsets and phase variations for different elevation angles across multiple frequency bands (e.g., L1 and L2).

    Key data components include:

    • Antenna ID and Description: Identifies the specific antenna.
    • L1/L2 Offsets: The physical offset in millimeters.
    • L1/L2 Phase Variations: The phase variation in millimeters, indexed by elevation angle.
    • Elevation Angles: Data is provided for specific elevation angles ranging from 0 to 90 degrees (e.g., 90, 85, 80, ..., 0).
    • Data Source/Averaging: Indicates the number of tests used to calculate the average values.
    <ant_info.003>                                                <BGK-07/03/20=228>
    
    ANTENNA ID        DESCRIPTION                  DATA SOURCE (# OF TESTS) YR/MO/DY
                                                                 |AVE = # in average
     [north]  [ east]  [  up ]                                   | L1 Offset (mm)   
     [90]  [85]  [80]  [75]  [70]  [65]  [60]  [55]  [50]  [45]  | L1 Phase at      
     [40]  [35]  [30]  [25]  [20]  [15]  [10]  [ 5]  [ 0]        | Elevation (mm)   
     [north]  [ east]  [  up ]                                   | L2 Offset (mm)   
     [90]  [85]  [80]  [75]  [70]  [65]  [60]  [55]  [50]  [45]  | L2 Phase at      
     [40]  [35]  [30]  [25]  [20]  [15]  [10]  [ 5]  [ 0]        | Elevation (mm)
  9. Understand the ATX antenna calibration file format

    main

    An .atx file is a text-based format used to store antenna calibration data, specifically phase center variations (PCV) and zenith offsets. The file is structured into blocks for different frequencies (e.g., R01, R02, G01, G02) and includes metadata about the antenna type, serial number, and the coordinate system used (typically NORTH / EAST / UP).

    Key structural elements include:

    • Frequency Blocks: Defined by START OF FREQUENCY and END OF FREQUENCY markers.
    • Coordinate Reference: Often explicitly stated as NORTH / EAST / UP.
    • Azimuth/Zenith Tables: Data is typically organized by azimuth (NOAZI) and zenith angles, providing corrections for the North, East, and Up components.
  10. Configure u-blox M8N via UBX commands

    main

    This command script provides a sequence of UBX protocol messages to configure a u-blox M8N GNSS receiver for a 1Hz sample rate, specific satellite constellations (GPS/GLONASS), raw data output, and message filtering.

    Key Configuration Tasks:

    • Set Sample Rate: Use !UBX CFG-RATE to set the measurement interval (e.g., 1000 ms for 1Hz).
    • Configure GNSS: Use !UBX CFG-GNSS to enable/disable GPS and GLONASS and set satellite counts.
    • Enable Raw Data: Use !UBX CFG-MSG with specific message IDs (e.g., 15, 16, 32) to output raw data via UART/USB.
    • Set Navigation Mode: Use !UBX CFG-NAV5 to adjust the navigation model (e.g., setting to pedestrian mode).
    • Disable NMEA Messages: Use !UBX CFG-MSG with protocol ID 240 to turn off standard NMEA messages like GGA, GLL, GSA, GSV, RMC, and VTG to reduce bandwidth usage.
    # Sample rate 1 Hz for setup
    !UBX CFG-RATE 1000 1 1
    
    # Configure GPS and GLONASS satellites
    !UBX CFG-GNSS 0 32 32 1 0 10 32 0 65537
    !UBX CFG-GNSS 0 32 32 1 6 8 16 0 65537
    
    # Set up raw data out for UART and USB
    !UBX CFG-MSG 3 15 0 1 0 1 0 0
    !UBX CFG-MSG 3 16 0 1 0 1 0 0
    !UBX CFG-MSG 1 32 0 1 0 1 0 0
    
    # change NAV5 mode to pedestrian
    !UBX CFG-NAV5 1 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    
    # turn off extra messages default messages
    # NMEA GGA
    !UBX CFG-MSG 240 0 0 0 0 0 0 0
    # NMEA GLL
    !UBX CFG-MSG 240 1 0 0 0 0 0 0
    # NMEA GSA
    !UBX CFG-MSG 240 2 0 0 0 0 0 0
    # NMEA GSV
    !UBX CFG-MSG 240 3 0 0 0 0 0 0
    # NMEA RMC
    !UBX CFG-MSG 240 4 0 0 0 0 0 0
    # NMEA VTG
    !UBX CFG-MSG 240 5 0 0 0 0 0 0
    # NMEA ZDA + others
    !UBX CFG-MSG 240 8 0 0 0 0 0 0
    !UBX CFG-MSG 1 3 0 0 0 0 0 0
    !UBX CFG-MSG 1 3 0 0 0 0 0 0
    !UBX CFG-MSG 1 6 0 0 0 0 0 0
    !UBX CFG-MSG 1 18 0 0 0 0 0 0
    !UBX CFG-MSG 1 34 0 0 0 0 0 0
    !UBX CFG-MSG 1 48 0 0 0 0 0 0
  11. Launch the RTKLAUNCH Qt application

    main

    The rtklaunch_qt application is a graphical interface for RTKLIB built using the Qt framework. The entry point initializes a QApplication instance, loads internationalization (i18n) translation files from the :/i18n/ resource path using the rtklib domain, and displays the MainForm window. To run the application, ensure the Qt environment is configured and the translation resources are compiled into the binary.

    // The application entry point initializes the Qt event loop
    // and displays the MainForm.
    int main(int argc, char *argv[])
    {
        QApplication a(argc, argv);
        QTranslator translator;
    
        // Load translations from the internal resource path
        bool ok = translator.load(QLocale(), "rtklib", "_", ":/i18n/");
        if (!ok)
            qDebug("Failed to open translation file.");
    
        a.installTranslator(&translator);
    
        MainForm w;
        w.show();
    
        return a.exec();
    }
  12. Launch the RTKGET Qt application

    main

    The rtkget_qt application is the graphical user interface for RTKGET, built using the Qt framework. The entry point initializes a QApplication instance, loads internationalization (i18n) translation files from the internal resource path :/i18n/, and displays the MainForm window. If translation files fail to load, a debug message is emitted, but the application continues to run using default locales.

    // The application entry point initializes the Qt environment,
    // loads translations, and shows the MainForm.
    int main(int argc, char *argv[])
    {
        QApplication a(argc, argv);
        QTranslator translator;
    
        bool ok = translator.load(QLocale(), "rtklib", "_", ":/i18n/");
        if (!ok)
            qDebug("Failed to open translation file.");
    
        a.installTranslator(&translator);
    
        MainForm w(NULL);
        w.show();
    
        return a.exec();
    }