gps_pvt 0.10.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +5 -4
- data/ext/gps_pvt/GPS/GPS_wrap.cxx +837 -52
- data/ext/ninja-scan-light/tool/navigation/GLONASS_Solver.h +11 -3
- data/ext/ninja-scan-light/tool/navigation/GPS.h +2 -1
- data/ext/ninja-scan-light/tool/navigation/GPS_Solver.h +20 -16
- data/ext/ninja-scan-light/tool/navigation/GPS_Solver_Base.h +84 -46
- data/ext/ninja-scan-light/tool/navigation/GPS_Solver_RAIM.h +2 -1
- data/ext/ninja-scan-light/tool/navigation/SBAS_Solver.h +10 -2
- data/ext/ninja-scan-light/tool/swig/GPS.i +76 -5
- data/ext/ninja-scan-light/tool/swig/spec/GPS_spec.rb +7 -7
- data/lib/gps_pvt/receiver/extension.rb +0 -73
- data/lib/gps_pvt/receiver.rb +5 -4
- data/lib/gps_pvt/rtcm3.rb +4 -4
- data/lib/gps_pvt/supl.rb +3 -3
- data/lib/gps_pvt/version.rb +1 -1
- metadata +2 -2
@@ -875,10 +875,10 @@ __RINEX_CLK_TEXT__
|
|
875
875
|
expect(pvt.vdop).to be_within(1E-2).of(1.87)
|
876
876
|
expect(pvt.tdop).to be_within(1E-2).of(1.08)
|
877
877
|
expect(pvt.velocity.to_a).to eq([:e, :n, :u].collect{|k| pvt.velocity.send(k)})
|
878
|
-
expect(pvt.velocity.north).to be_within(1E-2).of(-0.
|
879
|
-
expect(pvt.velocity.east) .to be_within(1E-2).of(-
|
880
|
-
expect(pvt.velocity.down) .to be_within(1E-2).of(
|
881
|
-
expect(pvt.receiver_error_rate).to be_within(1E-2).of(-
|
878
|
+
expect(pvt.velocity.north).to be_within(1E-2).of(-0.68) # north
|
879
|
+
expect(pvt.velocity.east) .to be_within(1E-2).of(-0.90) # east
|
880
|
+
expect(pvt.velocity.down) .to be_within(1E-2).of(0.26) # down
|
881
|
+
expect(pvt.receiver_error_rate).to be_within(1E-2).of(-1062.14)
|
882
882
|
expect(pvt.G.rows).to eq(6)
|
883
883
|
expect(pvt.W.rows).to eq(6)
|
884
884
|
expect(pvt.delta_r.rows).to eq(6)
|
@@ -942,9 +942,9 @@ __RINEX_CLK_TEXT__
|
|
942
942
|
expect(t_arv).to be_a_kind_of(GPS::Time)
|
943
943
|
expect(usr_pos).to be_a_kind_of(Coordinate::XYZ)
|
944
944
|
expect(usr_vel).to be_a_kind_of(Coordinate::XYZ)
|
945
|
-
|
946
|
-
|
947
|
-
[
|
945
|
+
weight_range, range_c, range_r, weight_rate, rate_rel_neg, *los_neg = rel_prop
|
946
|
+
weight_range = 1
|
947
|
+
[weight_range, range_c, range_r, weight_rate, rate_rel_neg] + los_neg
|
948
948
|
}
|
949
949
|
solver.hooks[:update_position_solution] = proc{|mat_G, mat_W, mat_delta_r, temp_pvt|
|
950
950
|
expect(temp_pvt).to be_a_kind_of(GPS::PVT)
|
@@ -60,79 +60,6 @@ end
|
|
60
60
|
|
61
61
|
module GPS
|
62
62
|
|
63
|
-
# These ephemeris helper functions will be removed
|
64
|
-
# when native functions are available in GPS.i
|
65
|
-
class Ephemeris
|
66
|
-
URA_TABLE = [
|
67
|
-
2.40, 3.40, 4.85, 6.85, 9.65, 13.65, 24.00, 48.00,
|
68
|
-
96.00, 192.00, 384.00, 768.00, 1536.00, 3072.00, 6144.00]
|
69
|
-
def URA_index=(idx)
|
70
|
-
send(:URA=, (idx >= URA_TABLE.size) ? (URA_TABLE[-1] * 2) : (idx < 0 ? -1 : URA_TABLE[idx]))
|
71
|
-
end
|
72
|
-
def URA_index
|
73
|
-
ura = send(:URA)
|
74
|
-
(ura < 0) ? -1 : URA_TABLE.find_index{|v| ura <= v}
|
75
|
-
end
|
76
|
-
proc{
|
77
|
-
orig = instance_method(:fit_interval=)
|
78
|
-
define_method(:fit_interval=){|args|
|
79
|
-
args = case args
|
80
|
-
when Array
|
81
|
-
flag, iodc, sys = args
|
82
|
-
hr = case (sys ||= :GPS)
|
83
|
-
when :GPS, :gps
|
84
|
-
(flag == 0) ? 4 : case iodc
|
85
|
-
when 240..247; 8
|
86
|
-
when 248..255, 496; 14
|
87
|
-
when 497..503; 26
|
88
|
-
when 504..510; 50
|
89
|
-
when 511, 752..756; 74
|
90
|
-
when 757..763; 98
|
91
|
-
when 764..767, 1088..1010; 122
|
92
|
-
when 1011..1020; 146
|
93
|
-
else; 6
|
94
|
-
end
|
95
|
-
when :QZSS, :qzss
|
96
|
-
raise unless flag == 0 # TODO how to treat fit_interval > 2 hrs
|
97
|
-
2
|
98
|
-
else; raise
|
99
|
-
end
|
100
|
-
hr * 60 * 60
|
101
|
-
else
|
102
|
-
args
|
103
|
-
end
|
104
|
-
orig.bind(self).call(args)
|
105
|
-
}
|
106
|
-
}.call
|
107
|
-
end
|
108
|
-
class Ephemeris_SBAS
|
109
|
-
URA_TABLE = [ # Table 2-3 in DO-229E
|
110
|
-
2.0, 2.8, 4.0, 5.7, 8.0, 11.3, 16.0, 32.0,
|
111
|
-
64.0, 128.0, 256.0, 512.0, 1024.0, 2048.0, 4096.0]
|
112
|
-
def URA_index=(idx)
|
113
|
-
send(:URA=, (idx >= URA_TABLE.size) ? (URA_TABLE[-1] * 2) : (idx < 0 ? -1 : URA_TABLE[idx]))
|
114
|
-
end
|
115
|
-
def URA_index
|
116
|
-
ura = send(:URA)
|
117
|
-
(ura < 0) ? -1 : URA_TABLE.find_index{|v| ura <= v}
|
118
|
-
end
|
119
|
-
end
|
120
|
-
class Ephemeris_GLONASS
|
121
|
-
F_T_TABLE = [ # Table 4.4 in ICD 5.1
|
122
|
-
1, 2, 2.5, 4, 5, 7, 10, 12, 14, 16, 32, 64, 128, 256, 512, 1024]
|
123
|
-
def F_T_index=(idx)
|
124
|
-
send(:F_T=, (idx >= F_T_TABLE.size) ? (F_T_TABLE[-1] * 2) : (idx < 0 ? -1 : F_T_TABLE[idx]))
|
125
|
-
end
|
126
|
-
def F_T_index
|
127
|
-
f_t = send(:F_T)
|
128
|
-
(f_t < 0) ? -1 : F_T_TABLE.find_index{|v| f_t <= v}
|
129
|
-
end
|
130
|
-
def NA
|
131
|
-
# based on TimeProperties::date2raw
|
132
|
-
self.day_of_year + [1, 367, 732, 1097][(self.year - 1996) % 4]
|
133
|
-
end
|
134
|
-
end
|
135
|
-
|
136
63
|
[
|
137
64
|
Ionospheric_UTC_Parameters,
|
138
65
|
Ephemeris, Ephemeris_SBAS, Ephemeris_GLONASS,
|
data/lib/gps_pvt/receiver.rb
CHANGED
@@ -38,20 +38,21 @@ class Receiver
|
|
38
38
|
] + (pvt.rel_ENU.to_a rescue [nil] * 3)
|
39
39
|
}
|
40
40
|
]] + [proc{
|
41
|
-
labels = [:g, :p, :h, :v, :t].collect{|k| "#{k}dop".to_sym}
|
41
|
+
labels = [:g, :p, :h, :v, :t].collect{|k| "#{k}dop".to_sym} \
|
42
|
+
+ [:h, :v, :t].collect{|k| "#{k}sigma".to_sym}
|
42
43
|
[
|
43
44
|
labels,
|
44
45
|
proc{|pvt|
|
45
|
-
next [nil] *
|
46
|
+
next [nil] * 8 unless pvt.position_solved?
|
46
47
|
labels.collect{|k| pvt.send(k)}
|
47
48
|
}
|
48
49
|
]
|
49
50
|
}.call] + [[
|
50
|
-
[:v_north, :v_east, :v_down, :receiver_clock_error_dot_ms],
|
51
|
+
[:v_north, :v_east, :v_down, :receiver_clock_error_dot_ms, :vel_sigma],
|
51
52
|
proc{|pvt|
|
52
53
|
next [nil] * 4 unless pvt.velocity_solved?
|
53
54
|
[:north, :east, :down].collect{|k| pvt.velocity.send(k)} \
|
54
|
-
+ [pvt.receiver_error_rate]
|
55
|
+
+ [pvt.receiver_error_rate, pvt.vel_sigma]
|
55
56
|
}
|
56
57
|
]] + [
|
57
58
|
[:used_satellites, proc{|pvt| pvt.used_satellites}],
|
data/lib/gps_pvt/rtcm3.rb
CHANGED
@@ -132,7 +132,7 @@ class RTCM3
|
|
132
132
|
103 => 1,
|
133
133
|
104 => 1,
|
134
134
|
105 => 1,
|
135
|
-
106 =>
|
135
|
+
106 => 2,
|
136
136
|
107 => [12, proc{|v|
|
137
137
|
hh, mm, ss = [v >> 7, (v & 0x7E) >> 1, (v & 0x1) > 0 ? 30 : 0]
|
138
138
|
hh * 3600 + mm * 60 + ss # [sec]
|
@@ -314,7 +314,7 @@ class RTCM3
|
|
314
314
|
def params
|
315
315
|
# TODO WN is truncated to 0-1023
|
316
316
|
res = Hash[*(KEY2IDX.collect{|k, i| [k, self[i][0]]}.flatten(1))]
|
317
|
-
res[:fit_interval] =
|
317
|
+
res[:fit_interval] = (self[29][0] != 0)
|
318
318
|
res
|
319
319
|
end
|
320
320
|
end
|
@@ -334,7 +334,7 @@ class RTCM3
|
|
334
334
|
# TODO insufficient: :n => ?(String4); extra: :P3
|
335
335
|
# TODO generate time with t_b, N_T, NA, N_4
|
336
336
|
# TODO GPS.i is required to modify to generate EPhemeris_with_GPS_Time
|
337
|
-
k_i = {:svid => 1, :freq_ch => 2, :
|
337
|
+
k_i = {:svid => 1, :freq_ch => 2, :P1_index => 5, :t_k => 6, :B_n => 7, :P2 => 8, :t_b => 9,
|
338
338
|
:xn_dot => 10, :xn => 11, :xn_ddot => 12,
|
339
339
|
:yn_dot => 13, :yn => 14, :yn_ddot => 15,
|
340
340
|
:zn_dot => 16, :zn => 17, :zn_ddot => 18,
|
@@ -362,7 +362,7 @@ class RTCM3
|
|
362
362
|
def params
|
363
363
|
# TODO PRN = svid + 192, WN is truncated to 0-1023
|
364
364
|
res = Hash[*(KEY2IDX.collect{|k, i| [k, self[i][0]]}.flatten(1))]
|
365
|
-
res[:fit_interval] =
|
365
|
+
res[:fit_interval] = (self[29][0] != 0)
|
366
366
|
res
|
367
367
|
end
|
368
368
|
end
|
data/lib/gps_pvt/supl.rb
CHANGED
@@ -353,7 +353,7 @@ class SUPL_Client
|
|
353
353
|
eph.WN -= 1
|
354
354
|
end
|
355
355
|
eph.iode = eph.iodc & 0xFF
|
356
|
-
eph.fit_interval =
|
356
|
+
eph.fit_interval = (eph_src[:ephemFitFlag] != 0)
|
357
357
|
eph
|
358
358
|
}
|
359
359
|
}
|
@@ -403,7 +403,7 @@ class SUPL_Client
|
|
403
403
|
:zn => [:Z, Rational(1000, 1 << 11)], :zn_dot => [:Zdot, Rational(1000, 1 << 20)], :zn_ddot => [:Zdotdot, Rational(1000, 1 << 30)],
|
404
404
|
:tau_n => [:Tau, Rational(1, 1 << 30)],
|
405
405
|
:gamma_n => [:Gamma, Rational(1, 1 << 40)],
|
406
|
-
:M => :M, :
|
406
|
+
:M => :M, :P1_index => :P1, :P2 => :P2, :E_n => :En,
|
407
407
|
}.collect{|dst_k, (src_k, sf)|
|
408
408
|
["#{dst_k}=".to_sym, ["glo#{src_k}".to_sym, sf || 1]]
|
409
409
|
}.flatten(1))]
|
@@ -480,7 +480,7 @@ class SUPL_Client
|
|
480
480
|
elsif delta_sec < -GPS::Time::Seconds_week / 2 then
|
481
481
|
eph.WN -= 1
|
482
482
|
end
|
483
|
-
eph.fit_interval =
|
483
|
+
eph.fit_interval = (eph_src[:navFitFlag] != 0)
|
484
484
|
eph
|
485
485
|
}
|
486
486
|
}
|
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.10.
|
4
|
+
version: 0.10.1
|
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: 2024-03-
|
11
|
+
date: 2024-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyserial
|