gps_pvt 0.2.1 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/gps_pvt/GPS/GPS_wrap.cxx +434 -434
- data/ext/gps_pvt/SylphideMath/SylphideMath_wrap.cxx +277 -14
- data/ext/ninja-scan-light/tool/navigation/GPS.h +8 -43
- data/ext/ninja-scan-light/tool/navigation/GPS_Solver.h +61 -147
- data/ext/ninja-scan-light/tool/navigation/GPS_Solver_Base.h +54 -0
- data/ext/ninja-scan-light/tool/navigation/SBAS.h +2 -2
- data/ext/ninja-scan-light/tool/navigation/SBAS_Solver.h +55 -78
- data/ext/ninja-scan-light/tool/param/bit_array.h +4 -3
- data/ext/ninja-scan-light/tool/swig/GPS.i +167 -61
- data/ext/ninja-scan-light/tool/swig/SylphideMath.i +53 -6
- data/ext/ninja-scan-light/tool/swig/spec/GPS_spec.rb +19 -5
- data/ext/ninja-scan-light/tool/swig/spec/SylphideMath_spec.rb +38 -4
- data/gps_pvt.gemspec +63 -0
- data/lib/gps_pvt/receiver.rb +39 -27
- data/lib/gps_pvt/version.rb +1 -1
- metadata +4 -3
data/lib/gps_pvt/receiver.rb
CHANGED
@@ -73,12 +73,12 @@ class Receiver
|
|
73
73
|
next ([nil] * 6 * opt[:satellites].size) unless pvt.position_solved?
|
74
74
|
sats = pvt.used_satellite_list
|
75
75
|
r, w = [:delta_r, :W].collect{|f| pvt.send(f)}
|
76
|
-
opt[:satellites].collect{|
|
77
|
-
next ([nil] * 6) unless i2 = sats.index(
|
76
|
+
opt[:satellites].collect{|prn, label|
|
77
|
+
next ([nil] * 6) unless i2 = sats.index(prn)
|
78
78
|
[r[i2, 0], w[i2, i2]] +
|
79
79
|
[:azimuth, :elevation].collect{|f|
|
80
|
-
pvt.send(f)[
|
81
|
-
} + [pvt.slopeH[
|
80
|
+
pvt.send(f)[prn] / Math::PI * 180
|
81
|
+
} + [pvt.slopeH[prn], pvt.slopeV[prn]]
|
82
82
|
}.flatten
|
83
83
|
},
|
84
84
|
]] + [[
|
@@ -106,16 +106,19 @@ class Receiver
|
|
106
106
|
opt = {
|
107
107
|
:satellites => (1..32).to_a,
|
108
108
|
}.merge(opt)
|
109
|
+
keys = [:PSEUDORANGE, :RANGE_RATE, :DOPPLER, :FREQUENCY].collect{|k|
|
110
|
+
GPS::Measurement.const_get("L1_#{k}".to_sym)
|
111
|
+
}
|
109
112
|
[[
|
110
113
|
opt[:satellites].collect{|prn, label|
|
111
114
|
[:L1_range, :L1_rate].collect{|str| "#{str}(#{label || prn})"}
|
112
115
|
}.flatten,
|
113
116
|
proc{|meas|
|
114
|
-
meas_hash =
|
115
|
-
opt[:satellites].collect{|prn|
|
116
|
-
|
117
|
-
|
118
|
-
|
117
|
+
meas_hash = meas.to_hash
|
118
|
+
opt[:satellites].collect{|prn, label|
|
119
|
+
pr, rate, doppler, freq = keys.collect{|k| meas_hash[prn][k] rescue nil}
|
120
|
+
freq ||= GPS::SpaceNode.L1_Frequency
|
121
|
+
[pr, rate || ((doppler * GPS::SpaceNode::light_speed / freq) rescue nil)]
|
119
122
|
}
|
120
123
|
}
|
121
124
|
]]
|
@@ -135,6 +138,11 @@ class Receiver
|
|
135
138
|
rel_prop
|
136
139
|
}
|
137
140
|
@debug = {}
|
141
|
+
[:gps_options, :sbas_options].each{|target|
|
142
|
+
opt = @solver.send(target) # default solver options
|
143
|
+
opt.elevation_mask = 0.0 / 180 * Math::PI # 0 deg (use satellite over horizon)
|
144
|
+
opt.residual_mask = 1E4 # 10 km (without residual filter, practically)
|
145
|
+
}
|
138
146
|
output_options = {
|
139
147
|
:system => [[:GPS, 1..32], [:QZSS, 193..202]],
|
140
148
|
:satellites => (1..32).to_a + (193..202).to_a, # [idx, ...] or [[idx, label], ...] is acceptable
|
@@ -193,9 +201,9 @@ class Receiver
|
|
193
201
|
sys, svid = case spec
|
194
202
|
when Integer
|
195
203
|
[nil, spec]
|
196
|
-
when
|
197
|
-
[$1.upcase.to_sym, (
|
198
|
-
when
|
204
|
+
when /^([a-zA-Z]+)(?::(-?\d+))?$/
|
205
|
+
[$1.upcase.to_sym, (Integer($2) rescue nil)]
|
206
|
+
when /^-?\d+$/
|
199
207
|
[nil, $&.to_i]
|
200
208
|
else
|
201
209
|
next false
|
@@ -206,27 +214,35 @@ class Receiver
|
|
206
214
|
else
|
207
215
|
(k == :with) ? :include : :exclude
|
208
216
|
end
|
209
|
-
|
210
|
-
|
211
|
-
[svid || ((1..32).to_a + (193..202).to_a)].flatten.each{
|
212
|
-
@solver.gps_options.send(mode, svid)
|
213
|
-
}
|
214
|
-
elsif (sys == :SBAS) || (svid && (120..158).include?(svid)) then
|
215
|
-
prns = [svid || (120..158).to_a].flatten
|
216
|
-
unless (i = output_options[:system].index{|sys, range| sys == :SBAS}) then
|
217
|
+
update_output = proc{|sys_target, prns, labels|
|
218
|
+
unless (i = output_options[:system].index{|sys, range| sys == sys_target}) then
|
217
219
|
i = -1
|
218
|
-
output_options[:system] << [
|
220
|
+
output_options[:system] << [sys_target, []]
|
219
221
|
else
|
220
222
|
output_options[:system][i].reject!{|prn| prns.include?(prn)}
|
221
223
|
end
|
222
224
|
output_options[:satellites].reject!{|prn, label| prns.include?(prn)}
|
223
225
|
if mode == :include then
|
224
226
|
output_options[:system][i][1] += prns
|
225
|
-
output_options[:satellites] += prns
|
227
|
+
output_options[:satellites] += (labels ? prns.zip(labels) : prns)
|
226
228
|
end
|
229
|
+
}
|
230
|
+
check_sys_svid = proc{|sys_target, range_in_sys, offset|
|
231
|
+
next range_in_sys.include?(svid - (offset || 0)) unless sys # svid is specified without system
|
232
|
+
next false unless sys == sys_target
|
233
|
+
next true unless svid # All satellites in a target system (svid == nil)
|
234
|
+
range_in_sys.include?(svid)
|
235
|
+
}
|
236
|
+
if check_sys_svid.call(:GPS, 1..32) then
|
237
|
+
[svid || (1..32).to_a].flatten.each{|prn| @solver.gps_options.send(mode, prn)}
|
238
|
+
elsif check_sys_svid.call(:SBAS, 120..158) then
|
239
|
+
prns = [svid || (120..158).to_a].flatten
|
240
|
+
update_output.call(:SBAS, prns)
|
227
241
|
prns.each{|prn| @solver.sbas_options.send(mode, prn)}
|
242
|
+
elsif check_sys_svid.call(:QZSS, 193..202) then
|
243
|
+
[svid || (193..202).to_a].flatten.each{|prn| @solver.gps_options.send(mode, prn)}
|
228
244
|
else
|
229
|
-
|
245
|
+
raise "Unknown satellite: #{spec}"
|
230
246
|
end
|
231
247
|
$stderr.puts "#{mode.capitalize} satellite: #{[sys, svid].compact.join(':')}"
|
232
248
|
}
|
@@ -235,10 +251,6 @@ class Receiver
|
|
235
251
|
false
|
236
252
|
}
|
237
253
|
raise "Unknown receiver options: #{options.inspect}" unless options.empty?
|
238
|
-
proc{|opt|
|
239
|
-
opt.elevation_mask = 0.0 / 180 * Math::PI # 0 deg
|
240
|
-
opt.residual_mask = 1E4 # 10 km
|
241
|
-
}.call(@solver.gps_options)
|
242
254
|
@output = {
|
243
255
|
:pvt => Receiver::pvt_items(output_options),
|
244
256
|
:meas => Receiver::meas_items(output_options),
|
data/lib/gps_pvt/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gps_pvt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- fenrir(M.Naruoka)
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -89,6 +89,7 @@ files:
|
|
89
89
|
- ext/ninja-scan-light/tool/swig/makefile
|
90
90
|
- ext/ninja-scan-light/tool/swig/spec/GPS_spec.rb
|
91
91
|
- ext/ninja-scan-light/tool/swig/spec/SylphideMath_spec.rb
|
92
|
+
- gps_pvt.gemspec
|
92
93
|
- lib/gps_pvt.rb
|
93
94
|
- lib/gps_pvt/receiver.rb
|
94
95
|
- lib/gps_pvt/ubx.rb
|
@@ -114,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
115
|
- !ruby/object:Gem::Version
|
115
116
|
version: '0'
|
116
117
|
requirements: []
|
117
|
-
rubygems_version: 3.
|
118
|
+
rubygems_version: 3.3.7
|
118
119
|
signing_key:
|
119
120
|
specification_version: 4
|
120
121
|
summary: GPS position, velocity, and time (PVT) solver
|