Modify

Opened 4 years ago

Closed 4 years ago

Last modified 2 years ago

#17829 closed enhancement (fixed)

RTKLib Positioning Solution File (.pos) import

Reported by: StephaneP Owned by: Don-vip
Priority: normal Milestone: 19.08
Component: Core Version:
Keywords: RTKlib, Positioning Solution File, pos, sotmfr2019 Cc:

Description (last modified by StephaneP)

Hi!

.pos file is the standard output file from the various RTKlib tools (FOSS). It's like a nmea or a gpx file with more informations inside, like Fix mode, deviation, ratio, ...

At this time, If I want to see the trace on an aerial imagery, I have to convert .pos to gpx to open it in Josm, and I lose many useful informations in the process.

Loading the pos files directly in Josm would be a great feature.

Attached with this ticket you will find a small pos file and the gpx (converted with the pos2kml tool).

There is some informations on Positioning Solution File in the documentation (page 101)

  • Header lines
% program   : RTKLIB ver.demo5 b31
% inp file  : rover_2019-06-08_08-03-52.obs
% inp file  : 2019-06-08-00_00_00-GNSS-1.obs
% inp file  : 2019-06-08-00_00_00-GNSS-1.nav
% inp file  : 2019-06-08-00_00_00-GNSS-1.sbs
% obs start : 2019/06/08 08:03:55.5 GPST (week2056 547435.5s)
% obs end   : 2019/06/08 09:46:21.0 GPST (week2056 553581.0s)
% pos mode  : kinematic
% freqs     : L1
% solution  : combined
% elev mask : 15.0 deg
% dynamics  : on
% tidecorr  : off
% ionos opt : sbas
% tropo opt : sbas
% ephemeris : broadcast
% navi sys  : gps galileo beidou sbas
% amb res   : fix and hold
% val thres : 3.0
% antenna1  :                       ( 0.0000  0.0000  0.0000)
% antenna2  :                       ( 0.0000  0.0000  0.0000)
% ref pos   : 47.060027749  -1.350495019   84.8600
%
% (lat/lon/height=WGS84/ellipsoidal,Q=1:fix,2:float,3:sbas,4:dgps,5:single,6:ppp,ns=# of satellites)
%  GPST                  latitude(deg) longitude(deg)  height(m)   Q  ns   sdn(m)   sde(m)   sdu(m)  sdne(m)  sdeu(m)  sdun(m) age(s)  ratio

These lines could be in the layer info (except the last one)
If it exists, the "ref pos" could be a marker (it's the base station coordinates)

  • Solution body
    • Line ending is CR+LF
    • The fields separator is 1 or more spaces.
    • Fields names are on the last header line
  • Fields conversion
    • Time (GPST, UTC, ...) -> conversion to time key
      As is, or GPST to UTC conversion)
    • lat/lon (WGS84, ECEF, baseline) -> lat/lon
      Accept only WGS84, or ECEF/Baseline conversion to WGS84
    • height -> ele key
      As is or Geodetic to Ellipsoid conversion if Josm can do it.
    • Q -> Q key and point's colour
    • ns -> ns key (or sat key, as for gpx files)
    • sdn, sde, sdu -> keys and use them for drawing a circle (as "Draw a circle from HDOP value" for the gpx files)
    • sdne, sdeu, sdun -> keys
      I don't understand these values
    • age -> age key
    • ratio -> ratio key

When you look at a solution in rtkplot, the first thing you look is the points' colors. The Q value set the color and the default one are:
Q=1 (fix) -> Green
Q=2 (float) -> Orange
Q=3 (sbas) -> Pink
Q=4 (dgps) -> Blue
Q=5 (single) -> Red
Q=6 (ppp) -> Light Blue
a pos file in rtkplot

If you want to use the various RTKLib tools, there is a debian package with the GUI (rtklib-qt). This package is out of date but should works to open a .pos file in rtkplot.
For Windows, the binary files are on Github.

Attachments (6)

example.pos (20.0 KB) - added by StephaneP 4 years ago.
.pos file
example.gpx (22.3 KB) - added by StephaneP 4 years ago.
.pos to gpx
rtkplot_example.jpg (108.3 KB) - added by StephaneP 4 years ago.
a pos file in rtkplot
rtklib_hdop.png (1.1 MB) - added by Don-vip 4 years ago.
rtklib_quality.png (1.0 MB) - added by Don-vip 4 years ago.
pos_in_josm.png (11.7 KB) - added by StephaneP 4 years ago.

Change History (26)

Changed 4 years ago by StephaneP

Attachment: example.pos added

.pos file

Changed 4 years ago by StephaneP

Attachment: example.gpx added

.pos to gpx

Changed 4 years ago by StephaneP

Attachment: rtkplot_example.jpg added

a pos file in rtkplot

comment:1 Changed 4 years ago by StephaneP

Description: modified (diff)

comment:2 Changed 4 years ago by Don-vip

Priority: minornormal

comment:3 Changed 4 years ago by Don-vip

Owner: changed from team to Don-vip
Status: newassigned

comment:4 Changed 4 years ago by Don-vip

Milestone: 19.08

comment:5 Changed 4 years ago by Don-vip

In 15247/josm:

see #17829 - support RTKLib Positioning Solution files. Add new "Quality" GPX color mode

Changed 4 years ago by Don-vip

Attachment: rtklib_hdop.png added

Changed 4 years ago by Don-vip

Attachment: rtklib_quality.png added

comment:6 Changed 4 years ago by Don-vip

Here you go :)



comment:7 Changed 4 years ago by Don-vip

@StephaneP please test and let me know if you find issues! :)

comment:8 Changed 4 years ago by Don-vip

Resolution: fixed
Status: assignedclosed

comment:9 Changed 4 years ago by StephaneP

A big thank you @Don-vip!

It looks Ok.

Small remarks. When you convert a pos file to a data layer:
-On nodes, there is a small typo. key "ration" instead of "ratio"
-Q value is correctly used to select a color, but I don't see it as a key/value


Last edited 4 years ago by StephaneP (previous) (diff)

Changed 4 years ago by StephaneP

Attachment: pos_in_josm.png added

comment:10 Changed 4 years ago by Don-vip

In 15249/josm:

see #17829 - fix gpx conversion issues

comment:11 Changed 4 years ago by StephaneP

In example.pos file, timedate is GPS Time. It's like UTC time but without the leap seconds. Today, GPS Time is 18 seconds ahead of UTC Time.
When I convert a pos file to a data layer. Josm apply a time offset. It looks like a local time to UTC offset (-2 Hours). That's weird.

last point in example.pos: 2019/06/08 08:23:52.800
last node in josm: 2019-06-08T06:23:52.8Z
last point in example.gpx (GPST to UTC conversion made by rtklib): 2019-06-08T08:23:34.80Z

comment:12 Changed 4 years ago by StephaneP

Description: modified (diff)

comment:13 Changed 4 years ago by StephaneP

Description: modified (diff)

comment:14 Changed 4 years ago by StephaneP

Discussion on gps time to utc time conversion: https://coderanch.com/t/667087/java/Reconciling-Java-date-time-GPS

comment:15 Changed 4 years ago by Don-vip

Thanks, interesting reading. It appears embedded Java classes don't handle leap seconds. Time4J does, I'll see how they do it so we can support them as well in #17925. Going to fix the local time issue, considering it is UTC time for now, until we have a proper leap second support.

Last edited 4 years ago by Don-vip (previous) (diff)

comment:16 Changed 4 years ago by Don-vip

In 15250/josm:

see #17829 - use UTC timezone instead of local one

comment:17 Changed 4 years ago by StephaneP

It's ok for me as I can set RTKLib to output the .pos file with UTC time.

comment:18 Changed 4 years ago by Don-vip

Can you please attach an example with UTC? I must be sure how to detect if it's GPS Time or UTC.

comment:19 Changed 4 years ago by StephaneP

GPST:

% program   : RTKPOST ver.demo5 b31a
% inp file  : C:\Users\Stéphane\Documents\RTK\data\rover_divers\2019-07-12\2019-07-12_06H\rover_2019-07-12_06-26-52.obs
% inp file  : C:\Users\Stéphane\Documents\RTK\data\rover_divers\2019-07-12\2019-07-12_06H\boug193z.19o
% inp file  : C:\Users\Stéphane\Documents\RTK\data\rover_divers\2019-07-12\2019-07-12_06H\rover_2019-07-12_06-26-52.nav
% obs start : 2019/07/12 06:28:20.4 GPST (week2061 455300.4s)
% obs end   : 2019/07/12 07:51:02.1 GPST (week2061 460262.1s)
% pos mode  : kinematic
% freqs     : L1+L2+E5b+L5
% solution  : combined
% elev mask : 15.0 deg
% dynamics  : on
% tidecorr  : off
% ionos opt : broadcast
% tropo opt : saastamoinen
% ephemeris : broadcast
% navi sys  : gps galileo beidou sbas
% amb res   : fix and hold
% val thres : 3.0
% antenna1  :                       ( 0.0000  0.0000  0.0000)
% antenna2  :                       ( 0.0000  0.0000  0.0000)
% ref pos   : 47.165589172   -1.640961015   118.0940
%
% (lat/lon/height=WGS84/ellipsoidal,Q=1:fix,2:float,3:sbas,4:dgps,5:single,6:ppp,ns=# of satellites)
%  GPST                  latitude(deg) longitude(deg)  height(m)   Q  ns   sdn(m)   sde(m)   sdu(m)  sdne(m)  sdeu(m)  sdun(m) age(s)  ratio
2019/07/12 06:28:20.400   46.987981139   -1.400660975    83.2759   1   8   0.0058   0.0041   0.0122   0.0023  -0.0017  -0.0047  -0.61   30.4
2019/07/12 06:28:20.700   46.987981154   -1.400660971    83.2786   1   8   0.0057   0.0041   0.0122   0.0023  -0.0017  -0.0047  -0.31   30.4
2019/07/12 06:28:21.000   46.987981145   -1.400660975    83.2795   1   8   0.0057   0.0041   0.0122   0.0023  -0.0017  -0.0047  -0.01   30.4

UTC:

% program   : RTKPOST ver.demo5 b31a
% inp file  : C:\Users\Stéphane\Documents\RTK\data\rover_divers\2019-07-12\2019-07-12_06H\rover_2019-07-12_06-26-52.obs
% inp file  : C:\Users\Stéphane\Documents\RTK\data\rover_divers\2019-07-12\2019-07-12_06H\boug193z.19o
% inp file  : C:\Users\Stéphane\Documents\RTK\data\rover_divers\2019-07-12\2019-07-12_06H\rover_2019-07-12_06-26-52.nav
% obs start : 2019/07/12 06:28:02.4 UTC (week2061 455300.4s)
% obs end   : 2019/07/12 07:50:44.1 UTC (week2061 460262.1s)
% pos mode  : kinematic
% freqs     : L1
% solution  : forward
% elev mask : 15.0 deg
% dynamics  : on
% tidecorr  : off
% ionos opt : broadcast
% tropo opt : saastamoinen
% ephemeris : broadcast
% navi sys  : gps galileo beidou sbas
% amb res   : fix and hold
% val thres : 3.0
% antenna1  :                       ( 0.0000  0.0000  0.0000)
% antenna2  :                       ( 0.0000  0.0000  0.0000)
% ref pos   : 47.165589172   -1.640961015   118.0940
%
% (lat/lon/height=WGS84/ellipsoidal,Q=1:fix,2:float,3:sbas,4:dgps,5:single,6:ppp,ns=# of satellites)
%  UTC                   latitude(deg) longitude(deg)  height(m)   Q  ns   sdn(m)   sde(m)   sdu(m)  sdne(m)  sdeu(m)  sdun(m) age(s)  ratio
2019/07/12 06:28:02.400   46.987973053   -1.400673775    83.2217   2   8   2.1080   1.4308   4.3602   0.8909   0.2758  -1.3394   0.39    0.0
2019/07/12 06:28:02.700   46.987972899   -1.400673506    83.1819   2   8   1.5608   1.0578   3.2397   0.6457   0.1841  -1.0408   0.69    0.0
2019/07/12 06:28:03.000   46.987972807   -1.400673339    83.1678   2   8   1.2955   0.8774   2.6924   0.5315   0.1466  -0.8790  -0.01    0.0
2019/07/12 06:28:03.300   46.987972899   -1.400673186    83.1420   2   8   1.1314   0.7660   2.3528   0.4620   0.1250  -0.7747   0.29    0.0

JST (I think it's the Japan time (UTC+9)):

% program   : RTKPOST ver.demo5 b31a
% inp file  : C:\Users\Stéphane\Documents\RTK\data\rover_divers\2019-07-12\2019-07-12_06H\rover_2019-07-12_06-26-52.obs
% inp file  : C:\Users\Stéphane\Documents\RTK\data\rover_divers\2019-07-12\2019-07-12_06H\boug193z.19o
% inp file  : C:\Users\Stéphane\Documents\RTK\data\rover_divers\2019-07-12\2019-07-12_06H\rover_2019-07-12_06-26-52.nav
% obs start : 2019/07/12 15:28:02.4 JST (week2061 455300.4s)
% obs end   : 2019/07/12 16:50:44.1 JST (week2061 460262.1s)
% pos mode  : kinematic
% freqs     : L1
% solution  : forward
% elev mask : 15.0 deg
% dynamics  : on
% tidecorr  : off
% ionos opt : broadcast
% tropo opt : saastamoinen
% ephemeris : broadcast
% navi sys  : gps galileo beidou sbas
% amb res   : fix and hold
% val thres : 3.0
% antenna1  :                       ( 0.0000  0.0000  0.0000)
% antenna2  :                       ( 0.0000  0.0000  0.0000)
% ref pos   : 47.165589172   -1.640961015   118.0940
%
% (lat/lon/height=WGS84/ellipsoidal,Q=1:fix,2:float,3:sbas,4:dgps,5:single,6:ppp,ns=# of satellites)
%  JST                   latitude(deg) longitude(deg)  height(m)   Q  ns   sdn(m)   sde(m)   sdu(m)  sdne(m)  sdeu(m)  sdun(m) age(s)  ratio
2019/07/12 15:28:02.400   46.987973053   -1.400673775    83.2217   2   8   2.1080   1.4308   4.3602   0.8909   0.2758  -1.3394   0.39    0.0
2019/07/12 15:28:02.700   46.987972899   -1.400673506    83.1819   2   8   1.5608   1.0578   3.2397   0.6457   0.1841  -1.0408   0.69    0.0
2019/07/12 15:28:03.000   46.987972807   -1.400673339    83.1678   2   8   1.2955   0.8774   2.6924   0.5315   0.1466  -0.8790  -0.01    0.0
2019/07/12 15:28:03.300   46.987972899   -1.400673186    83.1420   2   8   1.1314   0.7660   2.3528   0.4620   0.1250  -0.7747   0.29    0.0

GPS week
You won't like this one. It's the same keyword as GPS Time.
Perharps I should ask the RTKLib dev to use another keyword, something like GPSWT.

% program   : RTKPOST ver.demo5 b31a
% inp file  : C:\Users\Stéphane\Documents\RTK\data\rover_divers\2019-07-12\2019-07-12_06H\rover_2019-07-12_06-26-52.obs
% inp file  : C:\Users\Stéphane\Documents\RTK\data\rover_divers\2019-07-12\2019-07-12_06H\boug193z.19o
% inp file  : C:\Users\Stéphane\Documents\RTK\data\rover_divers\2019-07-12\2019-07-12_06H\rover_2019-07-12_06-26-52.nav
% obs start : 2019/07/12 06:28:20.4 GPST (week2061 455300.4s)
% obs end   : 2019/07/12 07:51:02.1 GPST (week2061 460262.1s)
% pos mode  : kinematic
% freqs     : L1
% solution  : forward
% elev mask : 15.0 deg
% dynamics  : on
% tidecorr  : off
% ionos opt : broadcast
% tropo opt : saastamoinen
% ephemeris : broadcast
% navi sys  : gps galileo beidou sbas
% amb res   : fix and hold
% val thres : 3.0
% antenna1  :                       ( 0.0000  0.0000  0.0000)
% antenna2  :                       ( 0.0000  0.0000  0.0000)
% ref pos   : 47.165589172   -1.640961015   118.0940
%
% (lat/lon/height=WGS84/ellipsoidal,Q=1:fix,2:float,3:sbas,4:dgps,5:single,6:ppp,ns=# of satellites)
%  GPST          latitude(deg) longitude(deg)  height(m)   Q  ns   sdn(m)   sde(m)   sdu(m)  sdne(m)  sdeu(m)  sdun(m) age(s)  ratio
2061 455300.400   46.987973053   -1.400673775    83.2217   2   8   2.1080   1.4308   4.3602   0.8909   0.2758  -1.3394   0.39    0.0
2061 455300.700   46.987972899   -1.400673506    83.1819   2   8   1.5608   1.0578   3.2397   0.6457   0.1841  -1.0408   0.69    0.0
2061 455301.000   46.987972807   -1.400673339    83.1678   2   8   1.2955   0.8774   2.6924   0.5315   0.1466  -0.8790  -0.01    0.0

There is a setting to choose the number of decimal.
UTC with 0 decimal:

% (lat/lon/height=WGS84/ellipsoidal,Q=1:fix,2:float,3:sbas,4:dgps,5:single,6:ppp,ns=# of satellites)
%  UTC                latitude(deg) longitude(deg)  height(m)   Q  ns   sdn(m)   sde(m)   sdu(m)  sdne(m)  sdeu(m)  sdun(m) age(s)  ratio
2019/07/12 06:28:02   46.987973053   -1.400673775    83.2217   2   8   2.1080   1.4308   4.3602   0.8909   0.2758  -1.3394   0.39    0.0
2019/07/12 06:28:03   46.987972899   -1.400673506    83.1819   2   8   1.5608   1.0578   3.2397   0.6457   0.1841  -1.0408   0.69    0.0

UTC with 6 decimals:

% (lat/lon/height=WGS84/ellipsoidal,Q=1:fix,2:float,3:sbas,4:dgps,5:single,6:ppp,ns=# of satellites)
%  UTC                      latitude(deg) longitude(deg)  height(m)   Q  ns   sdn(m)   sde(m)   sdu(m)  sdne(m)  sdeu(m)  sdun(m) age(s)  ratio
2019/07/12 06:28:02.399680   46.987973053   -1.400673775    83.2217   2   8   2.1080   1.4308   4.3602   0.8909   0.2758  -1.3394   0.39    0.0
2019/07/12 06:28:02.699680   46.987972899   -1.400673506    83.1819   2   8   1.5608   1.0578   3.2397   0.6457   0.1841  -1.0408   0.69    0.0
2019/07/12 06:28:02.999680   46.987972807   -1.400673339    83.1678   2   8   1.2955   0.8774   2.6924   0.5315   0.1466  -0.8790  -0.01    0.0

comment:20 Changed 2 years ago by Don-vip

In 17987/josm:

fix #20992 - see #17829 - support UTC dates with 6 digits

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Don-vip.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.