gps_pvt 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +33 -6
- data/Rakefile +0 -0
- data/exe/gps_pvt +28 -19
- data/ext/gps_pvt/GPS/GPS_wrap.cxx +596 -467
- 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 +83 -22
- data/ext/ninja-scan-light/tool/navigation/RINEX.h +15 -5
- 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 +342 -103
- data/ext/ninja-scan-light/tool/swig/SylphideMath.i +53 -6
- data/ext/ninja-scan-light/tool/swig/spec/GPS_spec.rb +42 -6
- 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 +86 -41
- data/lib/gps_pvt/version.rb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ceeb392e9d4a3df9a3b6af1ed6b19a92fec4fae110c9c89118602f3213d6905
|
4
|
+
data.tar.gz: c91c94043d2e39dde8ea0909dbd862f0194b15a4f2baa3030b48d760f933a147
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bcf702f83fd0df488470b385df370c3639e953b064a6acd9cdc4418a98b03ffab9c15dc9af0ad79185177bc3feb03e74b0ee0c9dba667bf73af1e1afabdca7be
|
7
|
+
data.tar.gz: eac046233bfd52db17a3fb94d2c74fcf01c8cd3200d0d5dce2546a669bb9313cccda4bdb74e2b991f1397d27325ec87d79d8c0e87be36b05fa6856daf0342ad0
|
data/README.md
CHANGED
@@ -31,7 +31,17 @@ For user who just generate PVT solution, an attached executable is useful. After
|
|
31
31
|
|
32
32
|
$ gps_pvt RINEX_or_UBX_file(s)
|
33
33
|
|
34
|
-
|
34
|
+
The format of RINEX_or_UBX_file is automatically determined with its extention, such as .ubx will be treated as UBX format. If you want to specify the file format, instead of RINEX_or_UBX_file(s), use the following arguments:
|
35
|
+
|
36
|
+
--rinex_nav=filename
|
37
|
+
--rinex_obs=filename
|
38
|
+
--ubx=filename
|
39
|
+
|
40
|
+
From version 0.2.0, SBAS and QZSS are supported in addition to GPS. QZSS ranging is activated in default, however, SBAS is just utilized for ionospheric correction. If you want to activate SBAS ranging, "--with=(SBAS PRN number, ex. 137)" option is used with gps_pvt executable like
|
41
|
+
|
42
|
+
$ gps_pvt --with=137 RINEX_or_UBX_file(s)
|
43
|
+
|
44
|
+
For developer, this library will be used like:
|
35
45
|
|
36
46
|
```ruby
|
37
47
|
require 'gps_pvt'
|
@@ -71,30 +81,47 @@ receiver.parse_rinex_obs(rinex_obs_file){|pvt, meas| # per epoch
|
|
71
81
|
}
|
72
82
|
}
|
73
83
|
|
74
|
-
|
84
|
+
## Further customization
|
85
|
+
# General options
|
75
86
|
receiver.solver.gps_options.exclude(prn) # Exclude satellite; the default is to use every satellite if visible
|
76
87
|
receiver.solver.gps_options.include(prn) # Discard previous setting of exclusion
|
77
88
|
receiver.solver.gps_options.elevation_mask = Math::PI / 180 * 10 # example 10 [deg] elevation mask
|
78
|
-
receiver.solver.
|
79
|
-
|
89
|
+
# receiver.solver.sbas_options is for SBAS.
|
90
|
+
|
91
|
+
# Precise control of properties for each satellite and for each iteration
|
92
|
+
receiver.solver.hooks[:relative_property] = proc{|prn, rel_prop, meas, rcv_e, t_arv, usr_pos, usr_vel|
|
80
93
|
weight, range_c, range_r, rate_rel_neg, *los_neg = rel_prop # relative property
|
94
|
+
# meas is measurement represented by pseudo range of the selected satellite.
|
81
95
|
# rcv_e, t_arv, usr_pos, usr_vel are temporary solution of
|
82
96
|
# receiver clock error [m], time of arrival [s], user position and velocity in ECEF, respectively.
|
83
97
|
|
84
98
|
weight = 1 # same as default; identical weight for each visible satellite
|
85
|
-
# or weight based on elevation
|
99
|
+
# or weight based on elevation, for example:
|
86
100
|
# elv = GPS_PVT::Coordinate::ENU::relative_rel(GPS_PVT::Coordinate::XYZ::new(*los_neg), usr_pos).elevation
|
87
101
|
# weight = (Math::sin(elv)/0.8)**2
|
88
102
|
|
89
103
|
[weight, range_c, range_r, rate_rel_neg] + los_neg # must return relative property
|
90
104
|
}
|
91
105
|
|
106
|
+
# Range correction (since v0.3.0)
|
107
|
+
receiver.solver.correction = { # provide by using a Hash
|
108
|
+
# ionospheric and transpheric models are changeable, and current configuration
|
109
|
+
# can be obtained by receiver.solver.correction without assigner.
|
110
|
+
:gps_ionospheric => proc{|t, usr_pos_xyz, sat_pos_enu|
|
111
|
+
# t, usr_pos_xyz, sat_pos_enu are temporary solution of
|
112
|
+
# time of arrival [s], user position in ECEF,
|
113
|
+
# and satellite position in ENU respectively.
|
114
|
+
0 # must return correction value, delaying is negative.
|
115
|
+
},
|
116
|
+
# combination of (gps or sbas) and (ionospheric or tropospheric) are available
|
117
|
+
}
|
118
|
+
|
92
119
|
# Dynamic customization of weight for each epoch
|
93
120
|
(class << receiver; self; end).instance_eval{ # do before parse_XXX
|
94
121
|
alias_method(:run_orig, :run)
|
95
122
|
define_method(:run){|meas, t_meas, &b|
|
96
123
|
meas # observation, same as the 2nd argument of parse_XXX
|
97
|
-
receiver.solver.hooks[:relative_property] = proc{|prn, rel_prop, rcv_e, t_arv, usr_pos, usr_vel|
|
124
|
+
receiver.solver.hooks[:relative_property] = proc{|prn, rel_prop, meas, rcv_e, t_arv, usr_pos, usr_vel|
|
98
125
|
# Do something based on meas, t_meas.
|
99
126
|
rel_prop
|
100
127
|
}
|
data/Rakefile
CHANGED
File without changes
|
data/exe/gps_pvt
CHANGED
@@ -6,23 +6,35 @@ require 'gps_pvt'
|
|
6
6
|
|
7
7
|
$stderr.puts <<__STRING__
|
8
8
|
Usage: #{__FILE__} GPS_file1 GPS_file2 ...
|
9
|
-
As GPS_file, rinex_nav(*.YYn), rinex_obs(*.YYo), and ubx(*.ubx) format are currently supported.
|
9
|
+
As GPS_file, rinex_nav(*.YYn, *.YYh, *.YYq), rinex_obs(*.YYo), and ubx(*.ubx) format are currently supported.
|
10
10
|
File format is automatically determined based on its extention described in above parentheses.
|
11
|
+
If you want to specify its format manually, --rinex_(nav|obs)=file_name or --ubx=file_name are available.
|
12
|
+
Supported RINEX versions are 2 and 3.
|
11
13
|
Note: YY = last two digit of year.
|
12
14
|
__STRING__
|
13
15
|
|
14
16
|
options = []
|
15
17
|
|
16
|
-
# check options
|
17
|
-
ARGV.
|
18
|
-
next
|
18
|
+
# check options and file format
|
19
|
+
files = ARGV.collect{|arg|
|
20
|
+
next [arg, nil] unless arg =~ /^--([^=]+)=?/
|
21
|
+
k, v = [$1.downcase.to_sym, $']
|
22
|
+
next [v, k] if [:rinex_nav, :rinex_obs, :ubx].include?(k) # file type
|
19
23
|
options << [$1.to_sym, $']
|
20
|
-
|
21
|
-
}
|
22
|
-
|
23
|
-
# Check file existence
|
24
|
-
|
25
|
-
raise "File not found: #{
|
24
|
+
nil
|
25
|
+
}.compact
|
26
|
+
|
27
|
+
# Check file existence and extension
|
28
|
+
files.collect!{|fname, ftype|
|
29
|
+
raise "File not found: #{fname}" unless File::exist?(fname)
|
30
|
+
ftype ||= case fname
|
31
|
+
when /\.\d{2}[nhq]$/; :rinex_nav
|
32
|
+
when /\.\d{2}o$/; :rinex_obs
|
33
|
+
when /\.ubx$/; :ubx
|
34
|
+
else
|
35
|
+
raise "Format cannot be guessed, use --(format, ex. rinex_nav)=#{fname}"
|
36
|
+
end
|
37
|
+
[fname, ftype]
|
26
38
|
}
|
27
39
|
|
28
40
|
rcv = GPS_PVT::Receiver::new(options)
|
@@ -30,17 +42,14 @@ rcv = GPS_PVT::Receiver::new(options)
|
|
30
42
|
puts rcv.header
|
31
43
|
|
32
44
|
# parse RINEX NAV
|
33
|
-
|
34
|
-
|
35
|
-
rcv.parse_rinex_nav(arg)
|
45
|
+
files.each{|fname, ftype|
|
46
|
+
rcv.parse_rinex_nav(fname) if ftype == :rinex_nav
|
36
47
|
}
|
37
48
|
|
38
49
|
# other files
|
39
|
-
|
40
|
-
case
|
41
|
-
when
|
42
|
-
|
43
|
-
when /\.\d{2}o$/
|
44
|
-
rcv.parse_rinex_obs(arg)
|
50
|
+
files.each{|fname, ftype|
|
51
|
+
case ftype
|
52
|
+
when :ubx; rcv.parse_ubx(fname)
|
53
|
+
when :rinex_obs; rcv.parse_rinex_obs(fname)
|
45
54
|
end
|
46
55
|
}
|