gps_pvt 0.1.7 → 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/README.md +13 -2
- data/Rakefile +2 -0
- data/exe/gps_pvt +32 -23
- data/ext/gps_pvt/Coordinate/Coordinate_wrap.cxx +5 -3
- data/ext/gps_pvt/GPS/GPS_wrap.cxx +4444 -671
- data/ext/gps_pvt/SylphideMath/SylphideMath_wrap.cxx +284 -19
- data/ext/ninja-scan-light/tool/navigation/GPS.h +12 -46
- data/ext/ninja-scan-light/tool/navigation/GPS_Solver.h +61 -100
- data/ext/ninja-scan-light/tool/navigation/GPS_Solver_Base.h +87 -25
- data/ext/ninja-scan-light/tool/navigation/QZSS.h +62 -0
- data/ext/ninja-scan-light/tool/navigation/RINEX.h +335 -27
- data/ext/ninja-scan-light/tool/navigation/SBAS.h +2330 -0
- data/ext/ninja-scan-light/tool/navigation/SBAS_Solver.h +306 -0
- data/ext/ninja-scan-light/tool/param/bit_array.h +4 -3
- data/ext/ninja-scan-light/tool/swig/GPS.i +429 -138
- data/ext/ninja-scan-light/tool/swig/SylphideMath.i +53 -6
- data/ext/ninja-scan-light/tool/swig/spec/GPS_spec.rb +37 -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 +281 -140
- data/lib/gps_pvt/version.rb +1 -1
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6820c87f08dcf6c64e70d304c634b32c1bea265d6f360fc79c8c9405822569a
|
4
|
+
data.tar.gz: 75b9db05a1c23827fc9e1163b476f4e3293a7d09efbf4a9a1cd9636dda7387bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f22eb60b17dc0bbd6a8c249deedd39e0fa5ec179bf28abb5c36cdf4191d79219af0dd456af93e8432f93173d07e42debdef11cdcdf6c9327395c38535c7d8de5
|
7
|
+
data.tar.gz: a7643df74fd9947d07383353d4cdf860b45494b13e2c332ccb2176a771112acd3887a9a8dc95e62ad8f97841506cceaccb79d8ba990dc6148aeb66efc07f51a3
|
data/README.md
CHANGED
@@ -31,6 +31,16 @@ 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
|
+
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
|
+
|
34
44
|
For developer, this library will be used in the following:
|
35
45
|
|
36
46
|
```ruby
|
@@ -75,9 +85,10 @@ receiver.parse_rinex_obs(rinex_obs_file){|pvt, meas| # per epoch
|
|
75
85
|
receiver.solver.gps_options.exclude(prn) # Exclude satellite; the default is to use every satellite if visible
|
76
86
|
receiver.solver.gps_options.include(prn) # Discard previous setting of exclusion
|
77
87
|
receiver.solver.gps_options.elevation_mask = Math::PI / 180 * 10 # example 10 [deg] elevation mask
|
78
|
-
receiver.solver.hooks[:relative_property] = proc{|prn, rel_prop, rcv_e, t_arv, usr_pos, usr_vel|
|
88
|
+
receiver.solver.hooks[:relative_property] = proc{|prn, rel_prop, meas, rcv_e, t_arv, usr_pos, usr_vel|
|
79
89
|
# control weight per satellite per iteration
|
80
90
|
weight, range_c, range_r, rate_rel_neg, *los_neg = rel_prop # relative property
|
91
|
+
# meas is measurement represented by pseudo range of the selected satellite.
|
81
92
|
# rcv_e, t_arv, usr_pos, usr_vel are temporary solution of
|
82
93
|
# receiver clock error [m], time of arrival [s], user position and velocity in ECEF, respectively.
|
83
94
|
|
@@ -94,7 +105,7 @@ receiver.solver.hooks[:relative_property] = proc{|prn, rel_prop, rcv_e, t_arv, u
|
|
94
105
|
alias_method(:run_orig, :run)
|
95
106
|
define_method(:run){|meas, t_meas, &b|
|
96
107
|
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|
|
108
|
+
receiver.solver.hooks[:relative_property] = proc{|prn, rel_prop, meas, rcv_e, t_arv, usr_pos, usr_vel|
|
98
109
|
# Do something based on meas, t_meas.
|
99
110
|
rel_prop
|
100
111
|
}
|
data/Rakefile
CHANGED
@@ -30,6 +30,8 @@ namespace :git do
|
|
30
30
|
"sparse-checkout set" + (<<-__SPARSE_PATTERNS__).lines.collect{|str| str.chomp.gsub(/^ */, ' ')}.join,
|
31
31
|
/tool/param/
|
32
32
|
/tool/navigation/GPS*
|
33
|
+
/tool/navigation/SBAS*
|
34
|
+
/tool/navigation/QZSS*
|
33
35
|
/tool/navigation/coordinate.h
|
34
36
|
/tool/navigation/EGM.h
|
35
37
|
/tool/navigation/MagneticField.h
|
data/exe/gps_pvt
CHANGED
@@ -6,41 +6,50 @@ 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
|
-
options =
|
15
|
-
|
16
|
-
# check options
|
17
|
-
ARGV.
|
18
|
-
next
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
16
|
+
options = []
|
17
|
+
|
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
|
23
|
+
options << [$1.to_sym, $']
|
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)
|
29
41
|
|
30
|
-
puts
|
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
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* ----------------------------------------------------------------------------
|
2
2
|
* This file was automatically generated by SWIG (http://www.swig.org).
|
3
|
-
* Version 4.0.
|
3
|
+
* Version 4.0.2
|
4
4
|
*
|
5
5
|
* This file is not intended to be easily readable and contains a number of
|
6
6
|
* coding conventions designed to improve portability and efficiency. Do not make
|
@@ -1612,6 +1612,8 @@ SWIGRUNTIMEINLINE char *
|
|
1612
1612
|
SWIG_Ruby_MangleStr(VALUE obj)
|
1613
1613
|
{
|
1614
1614
|
VALUE stype = rb_iv_get(obj, "@__swigtype__");
|
1615
|
+
if (NIL_P(stype))
|
1616
|
+
return NULL;
|
1615
1617
|
return StringValuePtr(stype);
|
1616
1618
|
}
|
1617
1619
|
|
@@ -1872,7 +1874,7 @@ static VALUE mCoordinate;
|
|
1872
1874
|
#define SWIG_RUBY_THREAD_END_BLOCK
|
1873
1875
|
|
1874
1876
|
|
1875
|
-
#define SWIGVERSION
|
1877
|
+
#define SWIGVERSION 0x040002
|
1876
1878
|
#define SWIG_VERSION SWIGVERSION
|
1877
1879
|
|
1878
1880
|
|
@@ -2205,7 +2207,7 @@ SWIG_ruby_failed(VALUE SWIGUNUSEDPARM(arg1), VALUE SWIGUNUSEDPARM(arg2))
|
|
2205
2207
|
}
|
2206
2208
|
|
2207
2209
|
|
2208
|
-
/*@SWIG:/usr/share/
|
2210
|
+
/*@SWIG:/usr/local/share/swig/4.0.2/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
|
2209
2211
|
SWIGINTERN VALUE SWIG_AUX_NUM2DBL(VALUE arg)
|
2210
2212
|
{
|
2211
2213
|
VALUE *args = (VALUE *)arg;
|