gps_pvt 0.1.5 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8dda091173f9531e0afccd9bab371f7fab0f6c6b82c1f7332fb99cbae81bb3cb
4
- data.tar.gz: 01173b782d6848634840b6cb2946fd4cf9874ba191cb8acb0f8e072b4e17d67b
3
+ metadata.gz: cd084c2ca722a761b9dbae3ea2fde546531f403ebff8e87b5d7b9632986c3aa8
4
+ data.tar.gz: 92943ca82b4ab13794dc39c51e71a23d178baf483fd1dd782a7305fc7a121de5
5
5
  SHA512:
6
- metadata.gz: d756b85034c18bcc2069d2da6b06e1949ff868f33fd57c3c72f8a8a4e4eafa49185128cf1f5a10e35bafbef3d11d130386d3ce1996b21487bc61fb445eba2df0
7
- data.tar.gz: 26c00d4f6743a07327a57354d83ac8c565f20548748c718855a6476924a7959a3e7fac3c1b7707f7cb1cf1a324bbefa7ab8a68479b7988ae1c87a6627aca93b3
6
+ metadata.gz: 48597633d7d70da6f7458f00482873d8c2f695dfb352ce0d5a1c6529b495eb0f3c26e07df89249d5a5dd34a82b13bcfd964fcac330e775f9b2f1cf90bd3274ab
7
+ data.tar.gz: 31baba44c7d446334ed3fc9c73c73dd69500f7548ba417a1da92d20c991fc33c799a3a38e0f4651ff873e3caf4d7a3123b4e0e9514d50523cb9003f02f2affd2
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
@@ -72,11 +82,13 @@ receiver.parse_rinex_obs(rinex_obs_file){|pvt, meas| # per epoch
72
82
  }
73
83
 
74
84
  # Customize solution
75
- receiver.solver.options.exclude(prn) # Exclude satellite; the default is to use every satellite if visible
76
- receiver.solver.options.include(prn) # Discard previous setting of exclusion
77
- receiver.solver.hooks[:relative_property] = proc{|prn, rel_prop, rcv_e, t_arv, usr_pos, usr_vel|
85
+ receiver.solver.gps_options.exclude(prn) # Exclude satellite; the default is to use every satellite if visible
86
+ receiver.solver.gps_options.include(prn) # Discard previous setting of exclusion
87
+ receiver.solver.gps_options.elevation_mask = Math::PI / 180 * 10 # example 10 [deg] elevation mask
88
+ receiver.solver.hooks[:relative_property] = proc{|prn, rel_prop, meas, rcv_e, t_arv, usr_pos, usr_vel|
78
89
  # control weight per satellite per iteration
79
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.
80
92
  # rcv_e, t_arv, usr_pos, usr_vel are temporary solution of
81
93
  # receiver clock error [m], time of arrival [s], user position and velocity in ECEF, respectively.
82
94
 
@@ -93,7 +105,7 @@ receiver.solver.hooks[:relative_property] = proc{|prn, rel_prop, rcv_e, t_arv, u
93
105
  alias_method(:run_orig, :run)
94
106
  define_method(:run){|meas, t_meas, &b|
95
107
  meas # observation, same as the 2nd argument of parse_XXX
96
- 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|
97
109
  # Do something based on meas, t_meas.
98
110
  rel_prop
99
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
@@ -69,12 +71,15 @@ task :swig do
69
71
  sh [:make, :clean, wrapper,
70
72
  "BUILD_DIR=#{out_dir}",
71
73
  "SWIGFLAGS='-c++ -ruby -prefix \"GPS_PVT::\"#{" -D__MINGW__" if ENV["MSYSTEM"]}'"].join(' ')
72
- lines = open(wrapper, 'r').read.lines.collect{|line|
73
- line.sub(/rb_require\(\"([^\"]+)\"\)/){ # from camel to underscore downcase style
74
- "rb_require(\"#{$1.sub('GPS_PVT', 'gps_pvt')}\")"
74
+ open(wrapper, 'r+'){|io|
75
+ lines = io.read.lines.collect{|line|
76
+ line.sub(/rb_require\(\"([^\"]+)\"\)/){ # from camel to underscore downcase style
77
+ "rb_require(\"#{$1.sub('GPS_PVT', 'gps_pvt')}\")"
78
+ }
75
79
  }
80
+ io.rewind
81
+ io.write(lines.join)
76
82
  }
77
- open(wrapper, 'w').write(lines.join)
78
83
  }
79
84
  }
80
85
  end
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.reject!{|arg|
18
- next false unless arg =~ /^--([^=]+)=?/
19
- options[$1.to_sym] = $'
20
- true
21
- }
22
-
23
- # Check file existence
24
- ARGV.each{|arg|
25
- raise "File not found: #{arg}" unless File::exist?(arg)
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 GPS_PVT::Receiver::header
42
+ puts rcv.header
31
43
 
32
44
  # parse RINEX NAV
33
- ARGV.reject!{|arg|
34
- next false unless arg =~ /\.\d{2}n$/
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
- ARGV.each{|arg|
40
- case arg
41
- when /\.ubx$/
42
- rcv.parse_ubx(arg)
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.1
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 0x040001
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/swig4.0/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
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;