Skip to content

Data collection and post processing

Christian Lanegger edited this page Dec 19, 2020 · 9 revisions

Logging

CPP Driver

It is possible to log observations to binary files and later post process these using RTKLIB (see below).

  • To log observations set the param log_observations_to_file in the driver launch file to true
  • Per default observation binaries are stored in the directory: ~/.ros/ and are named: <receiver_type>_<start_date_time>.sbp
  • To overwrite filename and directory set the following params in the launch file accordingly:
    • log_dir
    • observation_filename
  • If a base station is available it is recommended to log its obervations as well and use its logged data for post-processing. Otherwise correction data from other providers like swipos work just as well.

USB Thumbdrive

  • Connect to evaluation board using the Serial connection (USB)
  • Enable Standalone Logging if not already enabled and choose file length.
  • Save to Device
  • Plug in a USB thumbdrive to the USB port of the evaluation board.

Swift Console

  • Open console /opt/swift_console_v2.0.1_linux/console
  • Choose Serial Device: /dev/ttyACM0
  • Click on CSV log and JSON log

Get correction data from swipos

swipos -> RINEX-Shop -> Start new order -> CORS -> Choose closest basestation -> Choose time (take GPS time = UTC + 18s = CET - 2h + 18s) (see https://confluence.qps.nl/qinsy/en/utc-to-gps-time-correction-32245263.html).

Post-process data

3rd party software installation

For post processing the SBP binary data it is necessary to first convert them to RINEX, then a PPK solution can be obtained using RTKLIB.

SBP2RINEX converter

  • Got to the resource library and download sbp2rinex for Linux
  • Unzip the file and move the executable sbp2rinex to /usr/local/bin
  • Change the file permission to make it executable for all users: sudo chmod 755 /usr/local/bin/sbp2rinex

RTKLib

It is recommended to use the most recent RTKLib version as the PPK quality increased dramatically in newer versions. Use at least version 2.4.3 (build 33)!

git clone [email protected]:tomojitakasu/RTKLIB.git
git checkout c6e6c03143c5b397a9217fae2f6423ccf9c03fb7
cd lib/iers/gcc
make
cd ../../../app
sudo make

# To make your life easier move the compiled binaries to `/usr/local/bin`:
sudo mv rnx2rtkp/gcc/rnx2rtkp pos2kml/gcc/pos2kml /usr/local/bin/.
sudo chmod 755 /usr/local/bin/rnx2rtkp /usr/local/bin/pos2kml
  • Alternatively RTKLib can be installed as apt package (not recommended):
    • sudo apt install -y rtklib

PPK Solution

1. Convert SBP to RINEX

sbp2rinex FILENAME.sbp

2. Set setting in config file

To create a PPK solution a configuration file needs to be passed to RTKlib. The settings in the config file can have a major inpact on the final result of the solution.

  • A example config file can be found under:
    • ./utils/piksi_rtklib_postp/kinematic.conf
  • A few important config options:
    • pos1-frequency: Which frequency bands are used
    • pos1-navsys: Constellations used for PPK. 63 should activate all.
    • out-solformat: Format of output file results (llh = lat/long/alt, xyz = ECEF, enu = enu, nmea = usually not so great)
    • out-timesys: Which timestamp the output has. Note GPST has an offset of approx. 18s to UTC. If solution is used with ROS later on, it is best to set to UTC as ROS is also UTC.
    • ant1-postype: Coordinate format of the antenna base position (-l parameter). Best to use ECEF/xyz or LLH with many numbers after comma.
  • Additional information about other config options can be found here

3. Create solution

rnx2rtkp rover_file.obs rover_file.nav rover_file.sbs base_file.18o -k kinematic.conf -o outfile.pos

Convenience script

There are a few script in the repositories utils folder, which can help to obtain a PPK solution.

  • Create PPK solution, KML files for visualization and option to add solution to ROSbag (in development):

    • ./utils/piksi_rtklib_postp/sbp2pos.sh
  • Converts positions from PPK solution to desired reference frame and adds them to ROSbag (in development):

    • ./utils/piksi_rtklib_postp/pos2bag.py
  • Calculate different solutions and compare them on OpenStreetMap:

    • ./utils/piksi_rtklib_postp/plot_gps.m

Example output

sbp2pos

KML file created using sbp2pos.sh and imported to SwissTop maps from a MAV flight. Green corresponds to a "fixed" solution and yellow to a "float". Blue (not present) would indicate no dgps solution available. Example output from a MAV flight.

plot_GPS

Map created using plot_gps.m script. Red shows an online solution of the Piksi Multi, Cyan refers to the kinematic post-processed solution and blue is the solution from an iPhone X. Example output from inside a train.