gps_pvt 0.7.0 → 0.7.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/ext/gps_pvt/GPS/GPS_wrap.cxx +109 -0
- data/ext/ninja-scan-light/tool/navigation/GPS_Solver_Base.h +1 -6
- data/ext/ninja-scan-light/tool/navigation/GPS_Solver_RAIM.h +29 -1
- data/ext/ninja-scan-light/tool/param/bit_array.h +2 -2
- data/ext/ninja-scan-light/tool/swig/GPS.i +22 -0
- data/ext/ninja-scan-light/tool/swig/spec/GPS_spec.rb +121 -0
- data/lib/gps_pvt/receiver.rb +11 -2
- data/lib/gps_pvt/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14551de3c8e0eae8a584044249ff80a04e5c834929ec7968b39839aa611b3050
|
4
|
+
data.tar.gz: 0c82a31aec65f372d5221d5c6c7ef8e0fa72d6b5fa4d5d6f5d2174ad7a6cfa82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb245345b2d07710c7df3419eefee79720b63dc9820776612d0d5e9270d1f2186f54abd4d92f8e6967457b54f8b3fc5ea2fa3448232780847c6e57b66b42a116
|
7
|
+
data.tar.gz: a3f6edf6a85ef786305f15788a4e4b28d32287ec9727d2b3f2885ac3653524c264b10f82c6dcd009ee32c8cab956c6e1dcc8c14025495027a80b3d10100e89f0
|
@@ -4171,6 +4171,19 @@ SWIGINTERN VALUE GPS_Solver_Sl_double_Sg__get_correction(GPS_Solver< double > co
|
|
4171
4171
|
SWIGINTERN VALUE GPS_Solver_Sl_double_Sg__set_correction(GPS_Solver< double > *self,VALUE hash){
|
4172
4172
|
return self->update_correction(true, hash);
|
4173
4173
|
}
|
4174
|
+
SWIGINTERN GPS_Solver< double >::super_t::options_t GPS_Solver_Sl_double_Sg__get_options(GPS_Solver< double > const *self){
|
4175
|
+
return self->available_options();
|
4176
|
+
}
|
4177
|
+
SWIGINTERN GPS_Solver< double >::super_t::options_t GPS_Solver_Sl_double_Sg__set_options(GPS_Solver< double > *self,VALUE obj){
|
4178
|
+
GPS_Solver<double>::super_t::options_t opt(self->available_options());
|
4179
|
+
|
4180
|
+
if(!RB_TYPE_P(obj, T_HASH)){SWIG_exception(SWIG_TypeError, "Hash is expected");}
|
4181
|
+
SWIG_AsVal_bool (
|
4182
|
+
rb_hash_lookup(obj, ID2SYM(rb_intern("skip_exclusion"))),
|
4183
|
+
&opt.skip_exclusion);
|
4184
|
+
|
4185
|
+
return self->update_options(opt);
|
4186
|
+
}
|
4174
4187
|
SWIGINTERN unsigned int SBAS_Ephemeris_Sl_double_Sg__set_svid(SBAS_Ephemeris< double > *self,unsigned int const &v){
|
4175
4188
|
return self->svid = v;
|
4176
4189
|
}
|
@@ -17225,6 +17238,100 @@ fail:
|
|
17225
17238
|
}
|
17226
17239
|
|
17227
17240
|
|
17241
|
+
/*
|
17242
|
+
Document-method: GPS_PVT::GPS::Solver.options
|
17243
|
+
|
17244
|
+
call-seq:
|
17245
|
+
options -> GPS_Solver< double >::super_t::options_t
|
17246
|
+
|
17247
|
+
An instance method.
|
17248
|
+
|
17249
|
+
*/
|
17250
|
+
SWIGINTERN VALUE
|
17251
|
+
_wrap_Solver_options(int argc, VALUE *argv, VALUE self) {
|
17252
|
+
GPS_Solver< double > *arg1 = (GPS_Solver< double > *) 0 ;
|
17253
|
+
void *argp1 = 0 ;
|
17254
|
+
int res1 = 0 ;
|
17255
|
+
GPS_Solver< double >::super_t::options_t result;
|
17256
|
+
VALUE vresult = Qnil;
|
17257
|
+
|
17258
|
+
if ((argc < 0) || (argc > 0)) {
|
17259
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
|
17260
|
+
}
|
17261
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_GPS_SolverT_double_t, 0 | 0 );
|
17262
|
+
if (!SWIG_IsOK(res1)) {
|
17263
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "GPS_Solver< double > const *","get_options", 1, self ));
|
17264
|
+
}
|
17265
|
+
arg1 = reinterpret_cast< GPS_Solver< double > * >(argp1);
|
17266
|
+
{
|
17267
|
+
try {
|
17268
|
+
result = GPS_Solver_Sl_double_Sg__get_options((GPS_Solver< double > const *)arg1);
|
17269
|
+
} catch (const native_exception &e) {
|
17270
|
+
e.regenerate();
|
17271
|
+
SWIG_fail;
|
17272
|
+
} catch (const std::exception& e) {
|
17273
|
+
SWIG_exception_fail(SWIG_RuntimeError, e.what());
|
17274
|
+
}
|
17275
|
+
}
|
17276
|
+
{
|
17277
|
+
VALUE res(rb_hash_new());
|
17278
|
+
rb_hash_aset(res, ID2SYM(rb_intern("skip_exclusion")), SWIG_From_bool ((&result)->skip_exclusion));
|
17279
|
+
vresult = res;
|
17280
|
+
}
|
17281
|
+
return vresult;
|
17282
|
+
fail:
|
17283
|
+
return Qnil;
|
17284
|
+
}
|
17285
|
+
|
17286
|
+
|
17287
|
+
/*
|
17288
|
+
Document-method: GPS_PVT::GPS::Solver.options=
|
17289
|
+
|
17290
|
+
call-seq:
|
17291
|
+
options=(VALUE obj) -> GPS_Solver< double >::super_t::options_t
|
17292
|
+
|
17293
|
+
An instance method.
|
17294
|
+
|
17295
|
+
*/
|
17296
|
+
SWIGINTERN VALUE
|
17297
|
+
_wrap_Solver_optionse___(int argc, VALUE *argv, VALUE self) {
|
17298
|
+
GPS_Solver< double > *arg1 = (GPS_Solver< double > *) 0 ;
|
17299
|
+
VALUE arg2 = (VALUE) 0 ;
|
17300
|
+
void *argp1 = 0 ;
|
17301
|
+
int res1 = 0 ;
|
17302
|
+
GPS_Solver< double >::super_t::options_t result;
|
17303
|
+
VALUE vresult = Qnil;
|
17304
|
+
|
17305
|
+
if ((argc < 1) || (argc > 1)) {
|
17306
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
|
17307
|
+
}
|
17308
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_GPS_SolverT_double_t, 0 | 0 );
|
17309
|
+
if (!SWIG_IsOK(res1)) {
|
17310
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "GPS_Solver< double > *","set_options", 1, self ));
|
17311
|
+
}
|
17312
|
+
arg1 = reinterpret_cast< GPS_Solver< double > * >(argp1);
|
17313
|
+
arg2 = argv[0];
|
17314
|
+
{
|
17315
|
+
try {
|
17316
|
+
result = GPS_Solver_Sl_double_Sg__set_options(arg1,arg2);
|
17317
|
+
} catch (const native_exception &e) {
|
17318
|
+
e.regenerate();
|
17319
|
+
SWIG_fail;
|
17320
|
+
} catch (const std::exception& e) {
|
17321
|
+
SWIG_exception_fail(SWIG_RuntimeError, e.what());
|
17322
|
+
}
|
17323
|
+
}
|
17324
|
+
{
|
17325
|
+
VALUE res(rb_hash_new());
|
17326
|
+
rb_hash_aset(res, ID2SYM(rb_intern("skip_exclusion")), SWIG_From_bool ((&result)->skip_exclusion));
|
17327
|
+
vresult = res;
|
17328
|
+
}
|
17329
|
+
return vresult;
|
17330
|
+
fail:
|
17331
|
+
return Qnil;
|
17332
|
+
}
|
17333
|
+
|
17334
|
+
|
17228
17335
|
SWIGINTERN void
|
17229
17336
|
free_GPS_Solver_Sl_double_Sg_(void *self) {
|
17230
17337
|
GPS_Solver< double > *arg1 = (GPS_Solver< double > *)self;
|
@@ -26933,6 +27040,8 @@ SWIGEXPORT void Init_GPS(void) {
|
|
26933
27040
|
rb_define_method(SwigClassSolver.klass, "solve", VALUEFUNC(_wrap_Solver_solve), -1);
|
26934
27041
|
rb_define_method(SwigClassSolver.klass, "correction", VALUEFUNC(_wrap_Solver_correction), -1);
|
26935
27042
|
rb_define_method(SwigClassSolver.klass, "correction=", VALUEFUNC(_wrap_Solver_correctione___), -1);
|
27043
|
+
rb_define_method(SwigClassSolver.klass, "options", VALUEFUNC(_wrap_Solver_options), -1);
|
27044
|
+
rb_define_method(SwigClassSolver.klass, "options=", VALUEFUNC(_wrap_Solver_optionse___), -1);
|
26936
27045
|
SwigClassSolver.mark = (void (*)(void *)) GPS_Solver<double>::mark;
|
26937
27046
|
SwigClassSolver.destroy = (void (*)(void *)) free_GPS_Solver_Sl_double_Sg_;
|
26938
27047
|
SwigClassSolver.trackObjects = 0;
|
@@ -474,12 +474,7 @@ struct GPS_Solver_Base {
|
|
474
474
|
using super_t::reset;
|
475
475
|
void reset(const int &prn) {set(prn, false);}
|
476
476
|
std::vector<int> excluded() const {
|
477
|
-
|
478
|
-
for(std::vector<int>::iterator it(res.begin()), it_end(res.end());
|
479
|
-
it != it_end; ++it){
|
480
|
-
*it += prn_begin;
|
481
|
-
}
|
482
|
-
return res;
|
477
|
+
return super_t::indices_one(prn_begin);
|
483
478
|
}
|
484
479
|
};
|
485
480
|
};
|
@@ -60,6 +60,12 @@ struct GPS_PVT_RAIM_LSR : public PVT_BaseT {
|
|
60
60
|
} FDE_min, FDE_2nd; ///< Fault exclusion
|
61
61
|
};
|
62
62
|
|
63
|
+
template <class FloatT>
|
64
|
+
struct GPS_Solver_RAIM_LSR_Options {
|
65
|
+
bool skip_exclusion;
|
66
|
+
GPS_Solver_RAIM_LSR_Options() : skip_exclusion(false) {}
|
67
|
+
};
|
68
|
+
|
63
69
|
/*
|
64
70
|
* Comment on implementation of protection level (PL) calculation
|
65
71
|
*
|
@@ -96,6 +102,27 @@ struct GPS_Solver_RAIM_LSR : public SolverBaseT {
|
|
96
102
|
inheritate_type(measurement2_t);
|
97
103
|
#undef inheritate_type
|
98
104
|
|
105
|
+
typedef typename GPS_Solver_Base<float_t>::options_t::template merge_t<
|
106
|
+
GPS_Solver_RAIM_LSR_Options<float_t>, super_t> options_t;
|
107
|
+
|
108
|
+
protected:
|
109
|
+
GPS_Solver_RAIM_LSR_Options<float_t> _options;
|
110
|
+
|
111
|
+
public:
|
112
|
+
options_t available_options() const {
|
113
|
+
return options_t(super_t::available_options(), _options);
|
114
|
+
}
|
115
|
+
|
116
|
+
options_t available_options(const options_t &opt_wish) const {
|
117
|
+
GPS_Solver_RAIM_LSR_Options<float_t> opt(opt_wish);
|
118
|
+
return options_t(super_t::available_options(opt_wish), opt);
|
119
|
+
}
|
120
|
+
|
121
|
+
options_t update_options(const options_t &opt_wish){
|
122
|
+
_options = opt_wish;
|
123
|
+
return options_t(super_t::update_options(opt_wish), _options);
|
124
|
+
}
|
125
|
+
|
99
126
|
typedef GPS_PVT_RAIM_LSR<float_t, typename super_t::user_pvt_t> user_pvt_t;
|
100
127
|
|
101
128
|
typename super_t::template solver_interface_t<self_t> solve() const {
|
@@ -155,7 +182,8 @@ protected:
|
|
155
182
|
user_position_init, receiver_error_init,
|
156
183
|
opt);
|
157
184
|
|
158
|
-
if(
|
185
|
+
if(_options.skip_exclusion
|
186
|
+
|| !pvt.position_solved()
|
159
187
|
|| (!pvt.FD.valid)
|
160
188
|
|| (pvt.used_satellites < 6)){return;}
|
161
189
|
|
@@ -125,9 +125,9 @@ struct BitArray {
|
|
125
125
|
return (unsigned int)res;
|
126
126
|
}
|
127
127
|
}
|
128
|
-
std::vector<int> indices_one() const {
|
128
|
+
std::vector<int> indices_one(const int &offset = 0) const {
|
129
129
|
std::vector<int> res;
|
130
|
-
int idx(
|
130
|
+
int idx(offset);
|
131
131
|
static const const_div_t<bits_per_addr> qr(MAX_SIZE);
|
132
132
|
int rem(qr.rem), i(0);
|
133
133
|
for(; i < qr.quot; ++i, idx += bits_per_addr){
|
@@ -1356,6 +1356,28 @@ struct GPS_RangeCorrector
|
|
1356
1356
|
return self->update_correction(true, hash);
|
1357
1357
|
}
|
1358
1358
|
#endif
|
1359
|
+
#ifdef SWIGRUBY
|
1360
|
+
%typemap(out) typename super_t::options_t {
|
1361
|
+
VALUE res(rb_hash_new());
|
1362
|
+
rb_hash_aset(res, ID2SYM(rb_intern("skip_exclusion")), SWIG_From(bool)($1.skip_exclusion));
|
1363
|
+
%set_output(res);
|
1364
|
+
}
|
1365
|
+
#endif
|
1366
|
+
%rename("options") get_options;
|
1367
|
+
typename super_t::options_t get_options() const {
|
1368
|
+
return self->available_options();
|
1369
|
+
}
|
1370
|
+
%rename("options=") set_options;
|
1371
|
+
typename super_t::options_t set_options(SWIG_Object obj) {
|
1372
|
+
GPS_Solver<FloatT>::super_t::options_t opt(self->available_options());
|
1373
|
+
#ifdef SWIGRUBY
|
1374
|
+
if(!RB_TYPE_P(obj, T_HASH)){SWIG_exception(SWIG_TypeError, "Hash is expected");}
|
1375
|
+
SWIG_AsVal(bool)(
|
1376
|
+
rb_hash_lookup(obj, ID2SYM(rb_intern("skip_exclusion"))),
|
1377
|
+
&opt.skip_exclusion);
|
1378
|
+
#endif
|
1379
|
+
return self->update_options(opt);
|
1380
|
+
}
|
1359
1381
|
}
|
1360
1382
|
%inline {
|
1361
1383
|
template <class FloatT>
|
@@ -658,6 +658,73 @@ __ANTEX_TEXT__
|
|
658
658
|
# https://files.igs.org/pub/station/general/igs14.atx
|
659
659
|
f.path
|
660
660
|
},
|
661
|
+
:rinex_clk => Tempfile::open{|f|
|
662
|
+
f.write(<<-__RINEX_CLK_TEXT__)
|
663
|
+
3.00 C RINEX VERSION / TYPE
|
664
|
+
CCLOCK IGSACC @ NOAA NGS PGM / RUN BY / DATE
|
665
|
+
GPS week: 1849 Day: 2 MJD: 57189 COMMENT
|
666
|
+
THE COMBINED CLOCKS ARE A WEIGHTED AVERAGE OF: COMMENT
|
667
|
+
cod emr esa gfz grg jpl COMMENT
|
668
|
+
THE FOLLOWING REFERENCE CLOCKS WERE USED BY ACs: COMMENT
|
669
|
+
WSRT AMC2 BRUX HRAO COMMENT
|
670
|
+
THE COMBINED CLOCKS ARE ALIGNED TO GPS TIME COMMENT
|
671
|
+
USING THE SATELLITE BROADCAST EPHEMERIDES COMMENT
|
672
|
+
All clocks have been re-aligned to the IGS time scale: IGST COMMENT
|
673
|
+
16 LEAP SECONDS
|
674
|
+
1 AS # / TYPES OF DATA
|
675
|
+
IGS IGSACC @ NOAA NGS ANALYSIS CENTER
|
676
|
+
6 # OF SOLN SATS
|
677
|
+
G12 G18 G24 G25 G29 G31 PRN LIST
|
678
|
+
G igs08_1848.atx SYS / PCVS APPLIED
|
679
|
+
END OF HEADER
|
680
|
+
AS G12 2015 06 15 23 45 0.000000 2 3.017937472687e-04 1.069824072610e-11
|
681
|
+
AS G18 2015 06 15 23 45 0.000000 2 4.096815344517e-04 9.225410060960e-12
|
682
|
+
AS G24 2015 06 15 23 45 0.000000 2 -4.998574751545e-05 2.372704308220e-11
|
683
|
+
AS G25 2015 06 15 23 45 0.000000 2 -2.290169594092e-06 1.683218228880e-11
|
684
|
+
AS G29 2015 06 15 23 45 0.000000 2 6.168866864097e-04 1.206217360840e-11
|
685
|
+
AS G31 2015 06 15 23 45 0.000000 2 3.128244102077e-04 2.173867579920e-11
|
686
|
+
AS G12 2015 06 15 23 50 0.000000 2 3.017948525918e-04 1.300769315700e-11
|
687
|
+
AS G18 2015 06 15 23 50 0.000000 2 4.096823340968e-04 8.242414325510e-12
|
688
|
+
AS G24 2015 06 15 23 50 0.000000 2 -4.998578937856e-05 3.095238106380e-11
|
689
|
+
AS G25 2015 06 15 23 50 0.000000 2 -2.291410963946e-06 2.242880773880e-11
|
690
|
+
AS G29 2015 06 15 23 50 0.000000 2 6.168873857128e-04 1.695910016600e-11
|
691
|
+
AS G31 2015 06 15 23 50 0.000000 2 3.128241216228e-04 1.904362802980e-11
|
692
|
+
AS G12 2015 06 15 23 55 0.000000 2 3.017958412577e-04 1.171495359430e-11
|
693
|
+
AS G18 2015 06 15 23 55 0.000000 2 4.096833491457e-04 1.008770038860e-11
|
694
|
+
AS G24 2015 06 15 23 55 0.000000 2 -4.998596967628e-05 2.600074192880e-11
|
695
|
+
AS G25 2015 06 15 23 55 0.000000 2 -2.292650290468e-06 2.671557682290e-11
|
696
|
+
AS G29 2015 06 15 23 55 0.000000 2 6.168880208367e-04 1.729095211710e-11
|
697
|
+
AS G31 2015 06 15 23 55 0.000000 2 3.128236493567e-04 1.807462018720e-11
|
698
|
+
AS G12 2015 06 16 00 00 0.000000 2 3.017967728708e-04 1.000801049580e-11
|
699
|
+
AS G18 2015 06 16 00 00 0.000000 2 4.096840539308e-04 1.041670195750e-11
|
700
|
+
AS G24 2015 06 16 00 00 0.000000 2 -4.998614775959e-05 1.699628132880e-11
|
701
|
+
AS G25 2015 06 16 00 00 0.000000 2 -2.293760646361e-06 1.805118466830e-11
|
702
|
+
AS G29 2015 06 16 00 00 0.000000 2 6.168886213338e-04 2.220055594770e-11
|
703
|
+
AS G31 2015 06 16 00 00 0.000000 2 3.128233311248e-04 1.215284180360e-11
|
704
|
+
AS G12 2015 06 16 00 05 0.000000 2 3.017980078016e-04 1.152529430320e-11
|
705
|
+
AS G18 2015 06 16 00 05 0.000000 2 4.096851745816e-04 1.517949585220e-11
|
706
|
+
AS G24 2015 06 16 00 05 0.000000 2 -4.998569129850e-05 1.987308774570e-11
|
707
|
+
AS G25 2015 06 16 00 05 0.000000 2 -2.295014987154e-06 1.568891027900e-11
|
708
|
+
AS G29 2015 06 16 00 05 0.000000 2 6.168894672506e-04 1.906237292480e-11
|
709
|
+
AS G31 2015 06 16 00 05 0.000000 2 3.128231387506e-04 1.007829428500e-11
|
710
|
+
AS G12 2015 06 16 00 10 0.000000 2 3.017987334831e-04 8.726251168980e-12
|
711
|
+
AS G18 2015 06 16 00 10 0.000000 2 4.096859333261e-04 1.403166740100e-11
|
712
|
+
AS G24 2015 06 16 00 10 0.000000 2 -4.998597422529e-05 1.727695888430e-11
|
713
|
+
AS G25 2015 06 16 00 10 0.000000 2 -2.296262879345e-06 1.460867818340e-11
|
714
|
+
AS G29 2015 06 16 00 10 0.000000 2 6.168900483001e-04 1.556536485070e-11
|
715
|
+
AS G31 2015 06 16 00 10 0.000000 2 3.128226535741e-04 1.258498073020e-11
|
716
|
+
AS G12 2015 06 16 00 15 0.000000 2 3.017999301583e-04 1.006627990480e-11
|
717
|
+
AS G18 2015 06 16 00 15 0.000000 2 4.096864636193e-04 1.460541676660e-11
|
718
|
+
AS G24 2015 06 16 00 15 0.000000 2 -4.998605241609e-05 1.970841363000e-11
|
719
|
+
AS G25 2015 06 16 00 15 0.000000 2 -2.297477664413e-06 1.598459869060e-11
|
720
|
+
AS G29 2015 06 16 00 15 0.000000 2 6.168906691983e-04 1.729396319140e-11
|
721
|
+
AS G31 2015 06 16 00 15 0.000000 2 3.128222195893e-04 1.358710059900e-11
|
722
|
+
__RINEX_CLK_TEXT__
|
723
|
+
# modified version. original data are
|
724
|
+
# https://cddis.nasa.gov/archive/gnss/products/1849/igs1849[12].clk.Z
|
725
|
+
# mirrored: ftp://garner.ucsd.edu/pub/products/1849/igs1849[12].clk.Z
|
726
|
+
f.path
|
727
|
+
},
|
661
728
|
}}
|
662
729
|
let(:solver){
|
663
730
|
res = GPS::Solver::new
|
@@ -778,6 +845,10 @@ __ANTEX_TEXT__
|
|
778
845
|
|
779
846
|
it 'can be modified through hooks' do
|
780
847
|
sn = solver.gps_space_node
|
848
|
+
expect(solver.options).to be_a_kind_of(Hash)
|
849
|
+
expect(solver.options.keys).to include(:skip_exclusion)
|
850
|
+
expect{solver.options = {:skip_exclusion => true}}.not_to raise_error
|
851
|
+
expect(solver.options[:skip_exclusion]).to eq(true)
|
781
852
|
expect(solver.correction[:gps_ionospheric]).to include(:klobuchar)
|
782
853
|
expect(solver.correction[:gps_tropospheric]).to include(:hopfield)
|
783
854
|
expect{solver.correction = nil}.to raise_error(RuntimeError)
|
@@ -937,5 +1008,55 @@ __ANTEX_TEXT__
|
|
937
1008
|
puts ([:lat, :lng].collect{|f| pvt.llh.send(f) / Math::PI * 180} + [pvt.llh.alt]).inspect
|
938
1009
|
}
|
939
1010
|
end
|
1011
|
+
it 'calculates satellite clock error based on RINEX clock' do
|
1012
|
+
clk, sn = [GPS::RINEX_Clock::new, solver.gps_space_node]
|
1013
|
+
expect(clk.read(input[:rinex_clk])).to eq(6 * 7)
|
1014
|
+
proc{|sats|
|
1015
|
+
expect(sats.kind_of?(Array)).to eq(true)
|
1016
|
+
expect(sats[clk.class::SYS_GPS]).to eq(6)
|
1017
|
+
}.call(clk.satellites)
|
1018
|
+
sn.read(input[:rinex_nav])
|
1019
|
+
t0 = GPS::Time::new(1849, 172800)
|
1020
|
+
sn.update_all_ephemeris(t0)
|
1021
|
+
(-5..5).step(1){|dt_min|
|
1022
|
+
t = t0 + (dt_min * 60)
|
1023
|
+
[12, 18, 24, 25, 29, 31].each{|sat_id|
|
1024
|
+
eph = sn.ephemeris(sat_id).constellation(t)
|
1025
|
+
expect(clk.clock_error(sat_id, t)).to be_within(1E-7).of(eph[2]) # 100 ns
|
1026
|
+
expect(clk.clock_error_dot(sat_id, t)).to be_within(1E-10).of(eph[3]) # 100 ps
|
1027
|
+
}
|
1028
|
+
}
|
1029
|
+
end
|
1030
|
+
it 'calculates position without any error with RINEX NAV and CLK' do
|
1031
|
+
sn = solver.gps_space_node
|
1032
|
+
sn.read(input[:rinex_nav])
|
1033
|
+
clk = GPS::RINEX_Clock::new
|
1034
|
+
clk.read(input[:rinex_clk])
|
1035
|
+
expect(clk.push(solver, clk.class::SYS_GPS)).to eq(true)
|
1036
|
+
GPS::RINEX_Observation::read(input[:rinex_obs]){|item|
|
1037
|
+
t_meas = item[:time]
|
1038
|
+
sn.update_all_ephemeris(t_meas)
|
1039
|
+
meas = GPS::Measurement::new
|
1040
|
+
types = (item[:meas_types]['G'] || item[:meas_types][' ']).collect.with_index{|type_, i|
|
1041
|
+
type_ = {
|
1042
|
+
"C1" => :L1_PSEUDORANGE,
|
1043
|
+
"D1" => :L1_RANGE_RATE,
|
1044
|
+
}[type_]
|
1045
|
+
type_ && [i, GPS::Measurement::const_get(type_)]
|
1046
|
+
}.compact
|
1047
|
+
item[:meas].each{|k, v|
|
1048
|
+
sys, prn = k
|
1049
|
+
next unless sys == 'G' # GPS only
|
1050
|
+
types.each{|i, type_|
|
1051
|
+
meas.add(prn, type_, v[i][0]) if v[i]
|
1052
|
+
}
|
1053
|
+
}
|
1054
|
+
pvt = solver.solve(meas, t_meas)
|
1055
|
+
expect(pvt.position_solved?).to eq(true)
|
1056
|
+
[-3952590.4754, 3360273.8926, 3697987.2632].zip(pvt.xyz.to_a).each{|a, b|
|
1057
|
+
expect(a).to be_within(1E+2).of(b) # 10 m
|
1058
|
+
}
|
1059
|
+
}
|
1060
|
+
end
|
940
1061
|
end
|
941
1062
|
end
|
data/lib/gps_pvt/receiver.rb
CHANGED
@@ -19,6 +19,7 @@ class Receiver
|
|
19
19
|
opt = {
|
20
20
|
:system => [[:GPS, 1..32]],
|
21
21
|
:satellites => (1..32).to_a,
|
22
|
+
:FDE => true,
|
22
23
|
}.merge(opt)
|
23
24
|
[[
|
24
25
|
[:week, :itow_rcv, :year, :month, :mday, :hour, :min, :sec_rcv_UTC],
|
@@ -106,7 +107,7 @@ class Receiver
|
|
106
107
|
el_deg = [4, 6].collect{|i| pvt.elevation[fd[i]] / Math::PI * 180}
|
107
108
|
fd[0..4] + [el_deg[0]] + fd[5..6] + [el_deg[1]]
|
108
109
|
}
|
109
|
-
]] + [[
|
110
|
+
]] + (opt[:FDE] ? [[
|
110
111
|
[:wssr_FDE_min, :wssr_FDE_min_PRN, :wssr_FDE_2nd, :wssr_FDE_2nd_PRN],
|
111
112
|
proc{|pvt|
|
112
113
|
[:fde_min, :fde_2nd].collect{|f|
|
@@ -115,7 +116,7 @@ class Receiver
|
|
115
116
|
[info[0], info[-3]]
|
116
117
|
}.flatten
|
117
118
|
}
|
118
|
-
]]
|
119
|
+
]] : [])
|
119
120
|
end
|
120
121
|
|
121
122
|
def self.meas_items(opt = {})
|
@@ -153,6 +154,9 @@ class Receiver
|
|
153
154
|
rel_prop[0] = 1 if rel_prop[0] > 0 # weight = 1
|
154
155
|
rel_prop
|
155
156
|
}
|
157
|
+
@solver.options = {
|
158
|
+
:skip_exclusion => true, # default is to skip fault exclusion calculation
|
159
|
+
}
|
156
160
|
@debug = {}
|
157
161
|
solver_opts = [:gps_options, :sbas_options, :glonass_options].collect{|target|
|
158
162
|
@solver.send(target)
|
@@ -165,8 +169,10 @@ class Receiver
|
|
165
169
|
output_options = {
|
166
170
|
:system => [[:GPS, 1..32], [:QZSS, 193..202]],
|
167
171
|
:satellites => (1..32).to_a + (193..202).to_a, # [idx, ...] or [[idx, label], ...] is acceptable
|
172
|
+
:FDE => false,
|
168
173
|
}
|
169
174
|
options = options.reject{|k, v|
|
175
|
+
def v.to_b; !(self =~ /^(?:false|0|f|off)$/i); end
|
170
176
|
case k
|
171
177
|
when :debug
|
172
178
|
v = v.split(/,/)
|
@@ -280,6 +286,9 @@ class Receiver
|
|
280
286
|
$stderr.puts "#{mode.capitalize} satellite: #{[sys, svid].compact.join(':')}"
|
281
287
|
}
|
282
288
|
next true
|
289
|
+
when :fault_exclusion
|
290
|
+
@solver.options = {:skip_exclusion => !(output_options[:FDE] = v.to_b)}
|
291
|
+
next true
|
283
292
|
end
|
284
293
|
false
|
285
294
|
}
|
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.7.
|
4
|
+
version: 0.7.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: 2022-08-
|
11
|
+
date: 2022-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|