gps_pvt 0.8.5 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -2
- data/exe/gps2ubx +39 -22
- data/exe/gps_get +15 -24
- data/exe/gps_pvt +14 -17
- data/ext/gps_pvt/GPS/GPS_wrap.cxx +615 -84
- data/ext/ninja-scan-light/tool/navigation/GLONASS.h +24 -10
- data/ext/ninja-scan-light/tool/navigation/GPS_Solver_Base.h +2 -1
- data/ext/ninja-scan-light/tool/navigation/RINEX.h +1 -1
- data/ext/ninja-scan-light/tool/swig/GPS.i +32 -23
- data/ext/ninja-scan-light/tool/swig/spec/GPS_spec.rb +2 -0
- data/lib/gps_pvt/ntrip.rb +23 -4
- data/lib/gps_pvt/receiver/rtcm3.rb +110 -0
- data/lib/gps_pvt/receiver.rb +2 -1
- data/lib/gps_pvt/rtcm3.rb +364 -0
- data/lib/gps_pvt/util.rb +63 -9
- data/lib/gps_pvt/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a75bed6b9453e7fe5b435eb2c10bd82e7c736654b6d34461368b79274ee223e3
|
4
|
+
data.tar.gz: 55577769f09988ce63809f52b14a82bfa7fd958f68547f36263647b147559831
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01c350f1e321119d0b4693a9b96bc99003b92e37783cdc53f0779e02111ec880d2b26e30e1f1ccec81faaaca16d730b8e17a5d24eb9bacd2934fe0ffaf083284
|
7
|
+
data.tar.gz: 6cab5c290099b0dd7604940822c9399dc93d7656651fe4c38003202745c8b5f561c68cb452ece7c2d9b35740d7621b47e809341cec2228d3551e3238e2648c23
|
data/README.md
CHANGED
@@ -32,7 +32,7 @@ An attached executable is useful. After installation, type
|
|
32
32
|
|
33
33
|
$ gps_pvt file_or_URI(s)
|
34
34
|
|
35
|
-
The format of file is automatically determined with its extension, such as .ubx will be treated as UBX format. A compressed file of .gz or .Z can be specified directly (decompression is internally performed). URI such as http(s)://... and ftp://, and serial port (COMn for Windows and /dev/tty* for *NIX, version >= 0.8.0) are also acceptable. Moreover, Ntrip URI of ntrip://(username):(password)@(caster_host):(port)/(mount_point), for exmaple, ```ntrip://test%40example.com:none@rtk2go.com:2101/NAIST-UBX``` (%40 is recognized as '@') is supported (version >= 0.8.4). If you want to specify the file format, instead of file_or_URI(s), use the following arguments:
|
35
|
+
The format of file is automatically determined with its extension, such as .ubx will be treated as UBX format. A compressed file of .gz or .Z can be specified directly (decompression is internally performed). URI such as http(s)://... and ftp://, and serial port (COMn for Windows and /dev/tty* for *NIX, version >= 0.8.0) are also acceptable. Moreover, Ntrip URI of ntrip://(username):(password)@(caster_host):(port)/(mount_point), for exmaple, ```ntrip://test%40example.com:none@rtk2go.com:2101/NAIST-UBX``` (%40 is recognized as '@') is supported (version >= 0.8.4), and its content format can be automatically determined (version >= 0.9.0). If you want to specify the file format, instead of file_or_URI(s), use the following arguments:
|
36
36
|
|
37
37
|
| specification | recoginized as |
|
38
38
|
----|----
|
@@ -42,6 +42,7 @@ The format of file is automatically determined with its extension, such as .ubx
|
|
42
42
|
| --sp3=file_or_URI | [Standard Product 3 Orbit Format](https://files.igs.org/pub/data/format/sp3c.txt) (supported gps_pvt version >= 0.6.0) |
|
43
43
|
| --antex=file_or_URI | [Antenna Exchange Format](https://igs.org/wg/antenna#files) (supported gps_pvt version >= 0.6.0) |
|
44
44
|
| --rinex_clk=file_or_URI | [RINEX clock](https://files.igs.org/pub/data/format/rinex_clock304.txt) file (supported gps_pvt version >= 0.7.0) |
|
45
|
+
| <a name=opt_rtcm3>--rtcm3=file_or_URI</a> | [RTCM 10403.x](https://rtcm.myshopify.com/collections/differential-global-navigation-satellite-dgnss-standards), ephemeris and MSM7 are used. (supported gps_pvt version >= 0.9.0) |
|
45
46
|
|
46
47
|
Since version 0.2.0, SBAS and QZSS are supported in addition to GPS. Since version 0.4.0, GLONASS is also available. QZSS ranging is activated in default, however, SBAS is just utilized for ionospheric correction. GLONASS is also turned off by default. If you want to activate SBAS or GLONASS ranging, "--with=(system or PRN)" options are used with gps_pvt executable like
|
47
48
|
|
@@ -156,7 +157,7 @@ Utility to convert observation into u-blox ubx format and dump standard input. A
|
|
156
157
|
|
157
158
|
$ gps2ubx file_or_URI(s) (options) > out.ubx
|
158
159
|
|
159
|
-
saves resultant into out.ubx by using redirection. The shared options with gps_pvt executable are [rinex_obs](#opt_rinex_obs), [rinex_nav](#opt_rinex_nav), [ubx](#opt_ubx), and [online_ephemeris](#opt_online_ephemeris). In addition, the following options are available.
|
160
|
+
saves resultant into out.ubx by using redirection. The shared options with gps_pvt executable are [rinex_obs](#opt_rinex_obs), [rinex_nav](#opt_rinex_nav), [ubx](#opt_ubx), [rtcm3](#opt_rtcm3) and [online_ephemeris](#opt_online_ephemeris). In addition, the following options are available.
|
160
161
|
|
161
162
|
| key | value | comment | since |
|
162
163
|
----|----|----|----
|
data/exe/gps2ubx
CHANGED
@@ -9,14 +9,15 @@ require 'gps_pvt/ubx'
|
|
9
9
|
|
10
10
|
$stderr.puts <<__STRING__
|
11
11
|
Usage: #{__FILE__} GPS_file ... > as_you_like.ubx
|
12
|
-
As GPS_file,
|
12
|
+
As GPS_file, rinex_obs(*.YYo) and rtcm3 stream are supported.
|
13
13
|
(YY = last two digit of year)
|
14
14
|
File format is automatically determined based on its extention described in above parentheses.
|
15
15
|
If you want to specify its format manually, command options like --rinex_obs=file_name are available.
|
16
16
|
Supported RINEX versions are 2 and 3.
|
17
17
|
RXM-RAWX and RXM-SFRBX are included in output UBX if corresponding file(s) is given.
|
18
18
|
A file having additional ".gz" or ".Z" extension is recognized as a compressed file.
|
19
|
-
Major URL such as http(s)://... or ftp://... is acceptable as an input file name.
|
19
|
+
Major URL such as http(s)://... or ftp://... is acceptable as an input file name.
|
20
|
+
Ntrip specified in URI as ntrip://(username):(password)@(caster_host):(port)/(mount_point) is also supported, and its format is automatically detected.
|
20
21
|
__STRING__
|
21
22
|
|
22
23
|
options = []
|
@@ -30,7 +31,7 @@ misc_options = {
|
|
30
31
|
files = ARGV.collect{|arg|
|
31
32
|
next [arg, nil] unless arg =~ /^--([^=]+)=?/
|
32
33
|
k, v = [$1.downcase.to_sym, $']
|
33
|
-
next [v, k] if [:rinex_nav, :rinex_obs].include?(k) # file type
|
34
|
+
next [v, k] if [:rinex_nav, :rinex_obs, :ubx, :rtcm3].include?(k) # file type
|
34
35
|
options << [$1.to_sym, $']
|
35
36
|
nil
|
36
37
|
}.compact
|
@@ -41,16 +42,12 @@ files.collect!{|fname, ftype|
|
|
41
42
|
when /\.\d{2}[nhqg](?:\.gz)?$/; :rinex_nav
|
42
43
|
when /\.\d{2}o(?:\.gz)?$/; :rinex_obs
|
43
44
|
when /\.ubx$/; :ubx
|
44
|
-
else
|
45
|
-
raise "Format cannot be guessed, use --(format, ex. rinex_obs)=#{fname}"
|
46
45
|
end
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
raise "File not found: #{fname}"
|
53
|
-
}.call
|
46
|
+
if (!(uri = URI::parse(fname)).instance_of?(URI::Generic) rescue false) then
|
47
|
+
ftype ||= uri.read_format if uri.instance_of?(URI::Ntrip)
|
48
|
+
fname = uri
|
49
|
+
end
|
50
|
+
raise "Format cannot be guessed, use --(format, ex. rinex_obs)=#{fname}" unless ftype
|
54
51
|
[fname, ftype]
|
55
52
|
}
|
56
53
|
|
@@ -69,7 +66,7 @@ options.reject!{|opt|
|
|
69
66
|
|
70
67
|
rcv = GPS_PVT::Receiver::new(options)
|
71
68
|
|
72
|
-
obs =
|
69
|
+
obs = Queue::new
|
73
70
|
rcv.define_singleton_method(:run){|meas, t_meas, *args|
|
74
71
|
obs << [t_meas, meas]
|
75
72
|
}
|
@@ -97,14 +94,23 @@ files.each{|fname, ftype|
|
|
97
94
|
}
|
98
95
|
|
99
96
|
# other files
|
100
|
-
files.
|
101
|
-
case ftype
|
102
|
-
when :ubx; rcv.parse_ubx(fname){}
|
103
|
-
when :rinex_obs; rcv.parse_rinex_obs(fname){}
|
97
|
+
threads = files.collect{|fname, ftype|
|
98
|
+
task = case ftype
|
99
|
+
when :ubx; proc{rcv.parse_ubx(fname){}}
|
100
|
+
when :rinex_obs; proc{rcv.parse_rinex_obs(fname){}}
|
101
|
+
when :rtcm3; proc{rcv.parse_rtcm3(fname){}}
|
104
102
|
end
|
105
|
-
|
103
|
+
case fname
|
104
|
+
when URI::Ntrip; Thread::new(&task)
|
105
|
+
else; task.call; nil
|
106
|
+
end
|
107
|
+
}.compact
|
106
108
|
|
107
|
-
obs
|
109
|
+
obs = proc{
|
110
|
+
tmp = []
|
111
|
+
tmp << obs.pop until obs.empty?
|
112
|
+
tmp
|
113
|
+
}.call.sort!{|a, b| b[0] <=> a[0]} if threads.empty? # Sort by measurement time
|
108
114
|
|
109
115
|
# Time packet for solution of leap seconds
|
110
116
|
gen_gpstime = proc{
|
@@ -366,7 +372,18 @@ gen_list << gen_gpstime unless misc_options[:ubx_rawx]
|
|
366
372
|
gen_list << (misc_options[:ubx_rawx] ? gen_sfrbx : gen_sfrb) if misc_options[:broadcast_data]
|
367
373
|
gen_list << (misc_options[:ubx_rawx] ? gen_rawx : gen_raw)
|
368
374
|
STDOUT.binmode
|
369
|
-
|
370
|
-
|
371
|
-
|
375
|
+
|
376
|
+
task_dump = proc{
|
377
|
+
until obs.empty? do
|
378
|
+
t_meas, meas = obs.pop
|
379
|
+
meas2 = meas.to_hash
|
380
|
+
gen_list.each{|gen| print gen.call(t_meas, meas2)}
|
381
|
+
end
|
372
382
|
}
|
383
|
+
if threads.empty? then
|
384
|
+
task_dump.call
|
385
|
+
else
|
386
|
+
(threads << Thread::new{loop{
|
387
|
+
task_dump.call
|
388
|
+
}}).each{|th| th.join}
|
389
|
+
end
|
data/exe/gps_get
CHANGED
@@ -20,30 +20,21 @@ files = ARGV.collect{|arg|
|
|
20
20
|
nil
|
21
21
|
}.compact
|
22
22
|
|
23
|
-
spec2io = proc{
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
next STDIN if spec == '-'
|
39
|
-
next open(GPS_PVT::Util::get_txt(spec), 'r') if File::exist?(spec)
|
40
|
-
raise "File not found: #{spec}"
|
41
|
-
else
|
42
|
-
next STDOUT if spec == '-'
|
43
|
-
open(spec, 'a+')
|
44
|
-
end
|
45
|
-
}
|
46
|
-
}.call
|
23
|
+
spec2io = proc{|spec, mode_r|
|
24
|
+
mode_r = ((nil == mode_r) || mode_r)
|
25
|
+
is_stream = false
|
26
|
+
if (!(uri = URI::parse(spec)).instance_of?(URI::Generic) rescue false) then
|
27
|
+
spec = uri
|
28
|
+
is_stream = true if uri.kind_of?(URI::Ntrip)
|
29
|
+
else
|
30
|
+
is_stream = GPS_PVT::Util::special_stream?(spec)
|
31
|
+
end
|
32
|
+
if is_stream || (!mode_r) then
|
33
|
+
GPS_PVT::Util::open(spec, mode_r ? 'r' : 'a+')
|
34
|
+
else
|
35
|
+
open(GPS_PVT::Util::get_txt(spec), 'r')
|
36
|
+
end
|
37
|
+
}
|
47
38
|
|
48
39
|
STDIN.binmode
|
49
40
|
STDOUT.binmode
|
data/exe/gps_pvt
CHANGED
@@ -11,11 +11,11 @@ As GPS_file, rinex_nav(*.YYn, *.YYh, *.YYq, *.YYg), rinex_obs(*.YYo), ubx(*.ubx)
|
|
11
11
|
(YY = last two digit of year)
|
12
12
|
File format is automatically determined based on its extention described in above parentheses.
|
13
13
|
If you want to specify its format manually, command options like --rinex_nav=file_name are available.
|
14
|
-
Other than --rinex_nav, --rinex_obs,
|
14
|
+
Other than --rinex_nav, --rinex_obs, --rinex_clk, --ubx, --sp3, --antex or --rtcm3 are supported.
|
15
15
|
Supported RINEX versions are 2 and 3.
|
16
16
|
A file having additional ".gz" or ".Z" extension is recognized as a compressed file.
|
17
17
|
Major URI such as http(s)://... or ftp://..., and serial port (COMn for Windows, /dev/tty* for *NIX) is acceptable as an input file name.
|
18
|
-
Ntrip specified in URI as ntrip://(username):(password)@(caster_host):(port)/(mount_point) is also supported.
|
18
|
+
Ntrip specified in URI as ntrip://(username):(password)@(caster_host):(port)/(mount_point) is also supported, and its format is automatically detected.
|
19
19
|
__STRING__
|
20
20
|
|
21
21
|
options = []
|
@@ -25,7 +25,7 @@ misc_options = {}
|
|
25
25
|
files = ARGV.collect{|arg|
|
26
26
|
next [arg, nil] unless arg =~ /^--([^=]+)=?/
|
27
27
|
k, v = [$1.downcase.to_sym, $']
|
28
|
-
next [v, k] if [:rinex_nav, :rinex_obs, :ubx, :sp3, :antex, :rinex_clk].include?(k) # file type
|
28
|
+
next [v, k] if [:rinex_nav, :rinex_obs, :ubx, :sp3, :antex, :rinex_clk, :rtcm3].include?(k) # file type
|
29
29
|
options << [$1.to_sym, $']
|
30
30
|
nil
|
31
31
|
}.compact
|
@@ -76,17 +76,12 @@ files.collect!{|fname, ftype|
|
|
76
76
|
when /\.sp3(?:\.Z)?$/; :sp3
|
77
77
|
when /\.atx(?:\.Z)?$/; :antex
|
78
78
|
when /\.clk$/; :rinex_clk
|
79
|
-
else
|
80
|
-
raise "Format cannot be guessed, use --(format, ex. rinex_nav)=#{fname}"
|
81
79
|
end
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
end
|
88
|
-
raise "File not found: #{fname}"
|
89
|
-
}.call
|
80
|
+
if (!(uri = URI::parse(fname)).instance_of?(URI::Generic) rescue false) then
|
81
|
+
ftype ||= uri.read_format if uri.instance_of?(URI::Ntrip)
|
82
|
+
fname = uri
|
83
|
+
end
|
84
|
+
raise "Format cannot be guessed, use --(format, ex. rinex_nav)=#{fname}" unless ftype
|
90
85
|
[fname, ftype]
|
91
86
|
}
|
92
87
|
|
@@ -137,9 +132,11 @@ files.each{|fname, ftype|
|
|
137
132
|
}
|
138
133
|
|
139
134
|
# other files
|
140
|
-
files.
|
135
|
+
files.collect{|fname, ftype|
|
141
136
|
case ftype
|
142
|
-
when :ubx; rcv.parse_ubx(fname)
|
143
|
-
when :rinex_obs; rcv.parse_rinex_obs(fname)
|
137
|
+
when :ubx; Thread::new{rcv.parse_ubx(fname)}
|
138
|
+
when :rinex_obs; Thread::new{rcv.parse_rinex_obs(fname)}
|
139
|
+
when :rtcm3; Thread::new{rcv.parse_rtcm3(fname)}
|
140
|
+
else; nil
|
144
141
|
end
|
145
|
-
}
|
142
|
+
}.compact.each{|th| th.join}
|