gps_pvt 0.1.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 +7 -0
- data/.rspec +3 -0
- data/CHANGELOG.md +5 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/Gemfile +10 -0
- data/README.md +86 -0
- data/Rakefile +86 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/ext/gps_pvt/Coordinate/Coordinate_wrap.cxx +6613 -0
- data/ext/gps_pvt/GPS/GPS_wrap.cxx +16019 -0
- data/ext/gps_pvt/SylphideMath/SylphideMath_wrap.cxx +21050 -0
- data/ext/gps_pvt/extconf.rb +70 -0
- data/ext/ninja-scan-light/tool/navigation/EGM.h +2971 -0
- data/ext/ninja-scan-light/tool/navigation/GPS.h +2432 -0
- data/ext/ninja-scan-light/tool/navigation/GPS_Solver.h +479 -0
- data/ext/ninja-scan-light/tool/navigation/GPS_Solver_Base.h +1081 -0
- data/ext/ninja-scan-light/tool/navigation/GPS_Solver_MultiFrequency.h +199 -0
- data/ext/ninja-scan-light/tool/navigation/GPS_Solver_RAIM.h +210 -0
- data/ext/ninja-scan-light/tool/navigation/MagneticField.h +928 -0
- data/ext/ninja-scan-light/tool/navigation/NTCM.h +211 -0
- data/ext/ninja-scan-light/tool/navigation/RINEX.h +1781 -0
- data/ext/ninja-scan-light/tool/navigation/WGS84.h +186 -0
- data/ext/ninja-scan-light/tool/navigation/coordinate.h +406 -0
- data/ext/ninja-scan-light/tool/param/bit_array.h +145 -0
- data/ext/ninja-scan-light/tool/param/complex.h +558 -0
- data/ext/ninja-scan-light/tool/param/matrix.h +4049 -0
- data/ext/ninja-scan-light/tool/param/matrix_fixed.h +665 -0
- data/ext/ninja-scan-light/tool/param/matrix_special.h +562 -0
- data/ext/ninja-scan-light/tool/param/quaternion.h +765 -0
- data/ext/ninja-scan-light/tool/param/vector3.h +651 -0
- data/ext/ninja-scan-light/tool/swig/Coordinate.i +177 -0
- data/ext/ninja-scan-light/tool/swig/GPS.i +1102 -0
- data/ext/ninja-scan-light/tool/swig/SylphideMath.i +1234 -0
- data/ext/ninja-scan-light/tool/swig/extconf.rb +5 -0
- data/ext/ninja-scan-light/tool/swig/makefile +53 -0
- data/ext/ninja-scan-light/tool/swig/spec/GPS_spec.rb +417 -0
- data/ext/ninja-scan-light/tool/swig/spec/SylphideMath_spec.rb +489 -0
- data/gps_pvt.gemspec +57 -0
- data/lib/gps_pvt/receiver.rb +375 -0
- data/lib/gps_pvt/ubx.rb +148 -0
- data/lib/gps_pvt/version.rb +5 -0
- data/lib/gps_pvt.rb +9 -0
- data/sig/gps_pvt.rbs +4 -0
- metadata +117 -0
@@ -0,0 +1,177 @@
|
|
1
|
+
%module Coordinate
|
2
|
+
|
3
|
+
%{
|
4
|
+
#include <sstream>
|
5
|
+
#include <string>
|
6
|
+
#include <exception>
|
7
|
+
|
8
|
+
#if defined(SWIGRUBY) && defined(isfinite)
|
9
|
+
#undef isfinite_
|
10
|
+
#undef isfinite
|
11
|
+
#endif
|
12
|
+
|
13
|
+
#include "navigation/coordinate.h"
|
14
|
+
%}
|
15
|
+
|
16
|
+
%include std_common.i
|
17
|
+
%include std_string.i
|
18
|
+
%include exception.i
|
19
|
+
|
20
|
+
//%import "SylphideMath.i"
|
21
|
+
|
22
|
+
%feature("autodoc", "1");
|
23
|
+
|
24
|
+
%define MAKE_SETTER(name, type)
|
25
|
+
%rename(%str(name ## =)) set_ ## name;
|
26
|
+
type set_ ## name (const type &v) {
|
27
|
+
return self->name() = v;
|
28
|
+
}
|
29
|
+
%enddef
|
30
|
+
|
31
|
+
#if !defined(SWIGIMPORTED)
|
32
|
+
%header {
|
33
|
+
struct native_exception : public std::exception {
|
34
|
+
#if defined(SWIGRUBY)
|
35
|
+
int state;
|
36
|
+
native_exception(const int &state_) : std::exception(), state(state_) {}
|
37
|
+
void regenerate() const {rb_jump_tag(state);}
|
38
|
+
#else
|
39
|
+
void regenerate() const {}
|
40
|
+
#endif
|
41
|
+
};
|
42
|
+
}
|
43
|
+
#endif
|
44
|
+
|
45
|
+
%extend System_3D {
|
46
|
+
std::string __str__() const {
|
47
|
+
std::stringstream s;
|
48
|
+
s << (*self);
|
49
|
+
return s.str();
|
50
|
+
}
|
51
|
+
%fragment(SWIG_Traits_frag(FloatT));
|
52
|
+
%typemap(out) FloatT & {
|
53
|
+
$result = swig::from(*$1);
|
54
|
+
}
|
55
|
+
#if !defined(SWIGRUBY)
|
56
|
+
%typemap(in,numinputs=0) FloatT values[3] (FloatT temp[3]) %{
|
57
|
+
$1 = temp;
|
58
|
+
%}
|
59
|
+
%typemap(argout) FloatT values[3] {
|
60
|
+
for(int i(0); i < 3; ++i){
|
61
|
+
%append_output(swig::from($1[i]));
|
62
|
+
}
|
63
|
+
}
|
64
|
+
void to_a(FloatT values[3]) const {
|
65
|
+
for(int i(0); i < 3; ++i){
|
66
|
+
values[i] = (*self)[i];
|
67
|
+
}
|
68
|
+
}
|
69
|
+
#endif
|
70
|
+
%exception each {
|
71
|
+
#ifdef SWIGRUBY
|
72
|
+
if(!rb_block_given_p()){
|
73
|
+
return rb_enumeratorize(self, ID2SYM(rb_intern("each")), argc, argv);
|
74
|
+
}
|
75
|
+
#endif
|
76
|
+
try {
|
77
|
+
$action
|
78
|
+
} catch (const native_exception &e) {
|
79
|
+
e.regenerate();
|
80
|
+
SWIG_fail;
|
81
|
+
} catch (const std::exception& e) {
|
82
|
+
SWIG_exception(SWIG_RuntimeError, e.what());
|
83
|
+
}
|
84
|
+
}
|
85
|
+
void each() const {
|
86
|
+
for(int i(0); i < 3; ++i){
|
87
|
+
#ifdef SWIGRUBY
|
88
|
+
int state;
|
89
|
+
struct yield_t {
|
90
|
+
const VALUE v;
|
91
|
+
static VALUE run(VALUE v){
|
92
|
+
yield_t *arg(reinterpret_cast<yield_t *>(v));
|
93
|
+
return rb_yield_values(1, arg->v);
|
94
|
+
}
|
95
|
+
} arg = {swig::from((*self)[i])};
|
96
|
+
rb_protect(yield_t::run, reinterpret_cast<VALUE>(&arg), &state);
|
97
|
+
if(state != 0){throw native_exception(state);}
|
98
|
+
#endif
|
99
|
+
}
|
100
|
+
}
|
101
|
+
};
|
102
|
+
#ifdef SWIGRUBY
|
103
|
+
%mixin System_3D "Enumerable";
|
104
|
+
#endif
|
105
|
+
|
106
|
+
%extend System_XYZ {
|
107
|
+
#ifdef SWIGRUBY
|
108
|
+
MAKE_SETTER(x, FloatT);
|
109
|
+
MAKE_SETTER(y, FloatT);
|
110
|
+
MAKE_SETTER(z, FloatT);
|
111
|
+
#endif
|
112
|
+
};
|
113
|
+
|
114
|
+
%extend System_LLH {
|
115
|
+
%typemap(in,numinputs=0) (FloatT (&res)[3][3]) (FloatT temp[3][3]) {
|
116
|
+
$1 = &($1_type)(temp);
|
117
|
+
}
|
118
|
+
#ifdef SWIGRUBY
|
119
|
+
%typemap(argout, fragment=SWIG_Traits_frag(FloatT)) FloatT (&res)[3][3] {
|
120
|
+
$result = rb_ary_new_capa(3);
|
121
|
+
for(int i(0); i < 3; ++i){
|
122
|
+
rb_ary_store($result, i,
|
123
|
+
rb_ary_new_from_args(3,
|
124
|
+
swig::from((*$1)[i][0]),
|
125
|
+
swig::from((*$1)[i][1]),
|
126
|
+
swig::from((*$1)[i][2]) ));
|
127
|
+
}
|
128
|
+
}
|
129
|
+
%alias latitude "lat";
|
130
|
+
%alias longitude "lng";
|
131
|
+
%alias height "h,alt";
|
132
|
+
MAKE_SETTER(latitude, FloatT);
|
133
|
+
MAKE_SETTER(longitude, FloatT);
|
134
|
+
MAKE_SETTER(height, FloatT);
|
135
|
+
%alias set_latitude "lat=";
|
136
|
+
%alias set_longitude "lng=";
|
137
|
+
%alias set_height "h=,alt=";
|
138
|
+
#endif
|
139
|
+
}
|
140
|
+
|
141
|
+
%extend System_ENU {
|
142
|
+
FloatT down() const {
|
143
|
+
return self->up() * -1;
|
144
|
+
}
|
145
|
+
FloatT set_down(const FloatT &v) {
|
146
|
+
return (self->up() = (v * -1)) * -1;
|
147
|
+
}
|
148
|
+
#ifdef SWIGRUBY
|
149
|
+
%alias east "e";
|
150
|
+
%alias north "n";
|
151
|
+
%alias up "u";
|
152
|
+
MAKE_SETTER(east, FloatT);
|
153
|
+
MAKE_SETTER(north, FloatT);
|
154
|
+
MAKE_SETTER(up, FloatT);
|
155
|
+
%alias set_east "e=";
|
156
|
+
%alias set_north "n=";
|
157
|
+
%alias set_up "u=";
|
158
|
+
|
159
|
+
%alias down "d";
|
160
|
+
%alias set_down "d=";
|
161
|
+
#endif
|
162
|
+
}
|
163
|
+
|
164
|
+
#undef MAKE_SETTER
|
165
|
+
|
166
|
+
%include navigation/coordinate.h
|
167
|
+
|
168
|
+
%define CONCRETIZE(type)
|
169
|
+
%template(Base) System_3D<type>;
|
170
|
+
%template(XYZ) System_XYZ<type, WGS84>;
|
171
|
+
%template(LLH) System_LLH<type, WGS84>;
|
172
|
+
%template(ENU) System_ENU<type, WGS84>;
|
173
|
+
%enddef
|
174
|
+
|
175
|
+
CONCRETIZE(double);
|
176
|
+
|
177
|
+
#undef CONCRETIZE
|