@wemap/providers 3.3.0 → 4.0.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.
- package/debug/src/AbsoluteAttitudeComponent.jsx +12 -8
- package/debug/src/NavigationConfig.js +7 -8
- package/debug/src/RelativeAttitudeComponent.jsx +3 -3
- package/debug/src/Utils.js +32 -41
- package/index.js +6 -8
- package/package.json +8 -9
- package/src/Providers.js +26 -79
- package/src/ProvidersInterface.js +12 -9
- package/src/errors/AskImuOnDesktopError.js +4 -3
- package/src/errors/ContainsIgnoredProviderError.js +4 -3
- package/src/errors/GeolocationApiMissingError.js +4 -3
- package/src/errors/GeolocationPermissionDeniedError.js +4 -3
- package/src/errors/GeolocationPositionUnavailableError.js +4 -3
- package/src/errors/IpResolveServerError.js +4 -3
- package/src/errors/MissingAccelerometerError.js +3 -3
- package/src/errors/MissingArCoreError.js +4 -3
- package/src/errors/MissingGyroscopeError.js +3 -3
- package/src/errors/MissingNativeInterfaceError.js +4 -3
- package/src/errors/MissingSensorError.js +4 -3
- package/src/errors/NoProviderFoundError.js +4 -3
- package/src/events/ProviderEvent.js +0 -2
- package/src/events/ProvidersLoggerOld.js +35 -34
- package/src/mapmatching/MapMatchingHandler.js +138 -0
- package/src/providers/FakeProvider.spec.js +15 -17
- package/src/providers/Provider.js +5 -27
- package/src/providers/Provider.spec.js +18 -28
- package/src/providers/attitude/absolute/{AbsoluteAttitudeProvider.js → AbsoluteAttitude.js} +49 -18
- package/src/providers/attitude/absolute/{AbsoluteAttitudeFromBrowserProvider.js → AbsoluteAttitudeFromBrowser.js} +4 -5
- package/src/providers/attitude/absolute/{AbsoluteAttitudeFromRelAttProvider.js → AbsoluteAttitudeFromRelAtt.js} +8 -7
- package/src/providers/attitude/absolute/AbsoluteAttitudeFused.js +166 -0
- package/src/providers/attitude/relative/{RelativeAttitudeProvider.js → RelativeAttitude.js} +4 -5
- package/src/providers/attitude/relative/{RelativeAttitudeFromBrowserProvider.js → RelativeAttitudeFromBrowser.js} +6 -8
- package/src/providers/attitude/relative/{RelativeAttitudeFromEkfProvider.js → RelativeAttitudeFromEkf.js} +11 -11
- package/src/providers/attitude/relative/{RelativeAttitudeFromInertialProvider.js → RelativeAttitudeFromInertial.js} +5 -5
- package/src/providers/imu/{AccelerometerProvider.js → Accelerometer.js} +3 -3
- package/src/providers/imu/{GyroscopeProvider.js → Gyroscope.js} +3 -3
- package/src/providers/imu/{ImuProvider.js → Imu.js} +11 -5
- package/src/providers/inclination/{InclinationProvider.js → Inclination.js} +4 -5
- package/src/providers/inclination/{InclinationFromAccProvider.js → InclinationFromAcc.js} +5 -5
- package/src/providers/inclination/{InclinationFromRelativeAttitudeProvider.js → InclinationFromRelativeAttitude.js} +4 -4
- package/src/providers/legacy/helpers/ThugDetector.js +7 -7
- package/src/providers/others/{BarcodeProvider.js → Barcode.js} +3 -3
- package/src/providers/others/{CameraNativeProvider.js → CameraNative.js} +2 -2
- package/src/providers/others/{CameraProjectionMatrixProvider.js → CameraProjectionMatrix.js} +3 -3
- package/src/providers/position/absolute/AbsolutePosition.js +187 -0
- package/src/providers/position/absolute/{AbsolutePositionFromRelProvider.js → AbsolutePositionFromRel.js} +6 -8
- package/src/providers/position/absolute/{GnssWifiProvider.js → GnssWifi.js} +10 -9
- package/src/providers/position/absolute/{IpProvider.js → Ip.js} +4 -6
- package/src/providers/position/relative/{ArCoreProvider.js → ArCore.js} +29 -31
- package/src/providers/position/relative/{GeoRelativePositionProvider.js → GeoRelativePosition.js} +5 -5
- package/src/providers/position/relative/{GeoRelativePositionFromArCoreProvider.js → GeoRelativePositionFromArCore.js} +4 -6
- package/src/providers/position/relative/{PdrProvider.js → Pdr.js} +6 -7
- package/src/providers/steps/{StepDetectionProvider.js → StepDetection.js} +10 -9
- package/src/providers/steps/StepDetectionLadetto.js +12 -13
- package/src/providers/steps/StepDetectionMinMaxPeaks.js +19 -17
- package/src/providers/steps/StepDetectionMinMaxPeaks2.js +17 -18
- package/src/smoothers/AttitudeSmoother.js +100 -0
- package/src/providers/position/absolute/AbsolutePositionProvider.js +0 -295
|
@@ -8,7 +8,10 @@ import { TimeUtils } from '@wemap/utils';
|
|
|
8
8
|
|
|
9
9
|
import ProvidersLoggerOld from '../../src/events/ProvidersLoggerOld.js';
|
|
10
10
|
import {
|
|
11
|
-
AbsoluteAttitudeFromBrowser,
|
|
11
|
+
AbsoluteAttitudeFromBrowser,
|
|
12
|
+
AbsoluteAttitudeFromRelAtt,
|
|
13
|
+
AbsoluteAttitude,
|
|
14
|
+
AbsolutePosition
|
|
12
15
|
} from '../../src/Providers.js';
|
|
13
16
|
import Utils from './Utils.js';
|
|
14
17
|
|
|
@@ -80,14 +83,14 @@ class AbsoluteAttitudeComponent extends React.Component {
|
|
|
80
83
|
const heading = Number(this.inputHeading);
|
|
81
84
|
if (!isNaN(heading)) {
|
|
82
85
|
AbsoluteAttitude.feed(
|
|
83
|
-
new AbsoluteHeading(deg2rad(heading), TimeUtils.preciseTime / 1e3, 0)
|
|
86
|
+
new AbsoluteHeading(deg2rad(heading), TimeUtils.preciseTime() / 1e3, 0)
|
|
84
87
|
);
|
|
85
88
|
}
|
|
86
89
|
}
|
|
87
90
|
|
|
88
91
|
handlePosSubmit() {
|
|
89
92
|
AbsolutePosition.feed(
|
|
90
|
-
new UserPosition(43.61, 3.8, null, null, TimeUtils.preciseTime / 1e3, 1000)
|
|
93
|
+
new UserPosition(43.61, 3.8, null, null, TimeUtils.preciseTime() / 1e3, 1000)
|
|
91
94
|
);
|
|
92
95
|
}
|
|
93
96
|
|
|
@@ -101,11 +104,12 @@ class AbsoluteAttitudeComponent extends React.Component {
|
|
|
101
104
|
const gamma = this.state.deviceorientation.gamma;
|
|
102
105
|
const webkitCompassHeading = this.state.deviceorientation.webkitCompassHeading;
|
|
103
106
|
|
|
104
|
-
if (alpha
|
|
105
|
-
|
|
107
|
+
if (typeof alpha === 'number' && typeof beta === 'number'
|
|
108
|
+
&& typeof gamma === 'number' && typeof webkitCompassHeading === 'number') {
|
|
109
|
+
rawRender = <pre>alpha: {alpha.toFixed(2)}, <br />
|
|
106
110
|
beta: {beta.toFixed(2)}, <br />
|
|
107
111
|
gamma: {gamma.toFixed(2)}, <br />
|
|
108
|
-
webkitCompassHeading: {webkitCompassHeading.toFixed(2)}</
|
|
112
|
+
webkitCompassHeading: {webkitCompassHeading.toFixed(2)}</pre>;
|
|
109
113
|
}
|
|
110
114
|
|
|
111
115
|
} else if (this.state.deviceorientationabsolute) {
|
|
@@ -114,9 +118,9 @@ class AbsoluteAttitudeComponent extends React.Component {
|
|
|
114
118
|
const gamma = this.state.deviceorientationabsolute.gamma;
|
|
115
119
|
|
|
116
120
|
if (typeof alpha === 'number' && typeof beta === 'number' && typeof gamma === 'number') {
|
|
117
|
-
rawRender = <
|
|
121
|
+
rawRender = <pre>alpha: {alpha.toFixed(2)}, <br />
|
|
118
122
|
beta: {beta.toFixed(2)}, <br />
|
|
119
|
-
gamma: {gamma.toFixed(2)}</
|
|
123
|
+
gamma: {gamma.toFixed(2)}</pre>;
|
|
120
124
|
}
|
|
121
125
|
}
|
|
122
126
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react'; // eslint-disable-line no-unused-vars
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
|
-
AbsoluteHeading, UserPosition, Level
|
|
4
|
+
AbsoluteHeading, UserPosition, Level, Itinerary
|
|
5
5
|
} from '@wemap/geo';
|
|
6
|
-
import { Itinerary } from '@wemap/graph';
|
|
7
6
|
import { deg2rad } from '@wemap/maths';
|
|
8
7
|
import { TimeUtils } from '@wemap/utils';
|
|
9
8
|
|
|
@@ -12,10 +11,10 @@ const datasets = {};
|
|
|
12
11
|
// Wemap Office
|
|
13
12
|
const wemapOffice = {
|
|
14
13
|
get initialPosition() {
|
|
15
|
-
return new UserPosition(43.6091955, 3.8841255, 1.5, null, TimeUtils.preciseTime / 1e3, 0);
|
|
14
|
+
return new UserPosition(43.6091955, 3.8841255, 1.5, null, TimeUtils.preciseTime() / 1e3, 0);
|
|
16
15
|
},
|
|
17
16
|
get initialHeading() {
|
|
18
|
-
return new AbsoluteHeading(deg2rad(191.9), TimeUtils.preciseTime / 1e3, 0);
|
|
17
|
+
return new AbsoluteHeading(deg2rad(191.9), TimeUtils.preciseTime() / 1e3, 0);
|
|
19
18
|
}
|
|
20
19
|
};
|
|
21
20
|
wemapOffice.itinerary = Itinerary.fromOrderedPointsArray(
|
|
@@ -33,10 +32,10 @@ wemapOffice.itinerary = Itinerary.fromOrderedPointsArray(
|
|
|
33
32
|
// Wemap Office Multi-level
|
|
34
33
|
const wemapOfficeMulti = {
|
|
35
34
|
get initialPosition() {
|
|
36
|
-
return new UserPosition(43.6091965, 3.8841285, 1.5, new Level(2), TimeUtils.preciseTime / 1e3, 0);
|
|
35
|
+
return new UserPosition(43.6091965, 3.8841285, 1.5, new Level(2), TimeUtils.preciseTime() / 1e3, 0);
|
|
37
36
|
},
|
|
38
37
|
get initialHeading() {
|
|
39
|
-
return new AbsoluteHeading(deg2rad(191.9), TimeUtils.preciseTime / 1e3, 0);
|
|
38
|
+
return new AbsoluteHeading(deg2rad(191.9), TimeUtils.preciseTime() / 1e3, 0);
|
|
40
39
|
}
|
|
41
40
|
};
|
|
42
41
|
wemapOfficeMulti.itinerary = Itinerary.fromOrderedPointsArray(
|
|
@@ -60,10 +59,10 @@ wemapOfficeMulti.itinerary = Itinerary.fromOrderedPointsArray(
|
|
|
60
59
|
// Gare de Lyon RER A
|
|
61
60
|
const gareDeLyonRerA = {
|
|
62
61
|
get initialPosition() {
|
|
63
|
-
return new UserPosition(48.8442365, 2.3728267, 1.5, new Level(-2), TimeUtils.preciseTime / 1e3, 0);
|
|
62
|
+
return new UserPosition(48.8442365, 2.3728267, 1.5, new Level(-2), TimeUtils.preciseTime() / 1e3, 0);
|
|
64
63
|
},
|
|
65
64
|
get initialHeading() {
|
|
66
|
-
return new AbsoluteHeading(deg2rad(41.6), TimeUtils.preciseTime / 1e3, 0);
|
|
65
|
+
return new AbsoluteHeading(deg2rad(41.6), TimeUtils.preciseTime() / 1e3, 0);
|
|
67
66
|
}
|
|
68
67
|
};
|
|
69
68
|
gareDeLyonRerA.itinerary = Itinerary.fromOrderedPointsArray(
|
|
@@ -59,10 +59,10 @@ class RelativeAttitudeComponent extends React.Component {
|
|
|
59
59
|
const beta = this.state.deviceorientation.beta;
|
|
60
60
|
const gamma = this.state.deviceorientation.gamma;
|
|
61
61
|
|
|
62
|
-
if (alpha && beta && gamma) {
|
|
63
|
-
rawRender = <
|
|
62
|
+
if (typeof alpha === 'number' && typeof beta === 'number' && typeof gamma === 'number') {
|
|
63
|
+
rawRender = <pre>alpha: {alpha.toFixed(2)}, <br />
|
|
64
64
|
beta: {beta.toFixed(2)}, <br />
|
|
65
|
-
gamma: {gamma.toFixed(2)}</
|
|
65
|
+
gamma: {gamma.toFixed(2)}</pre>;
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
|
package/debug/src/Utils.js
CHANGED
|
@@ -40,14 +40,14 @@ class Utils {
|
|
|
40
40
|
|
|
41
41
|
return (
|
|
42
42
|
<div>
|
|
43
|
-
<
|
|
43
|
+
<pre>
|
|
44
44
|
Quat: [{w}, {x}, {y}, {z}]<br />
|
|
45
45
|
Eulers: [{yaw}, {pitch}, {roll}]<br />
|
|
46
46
|
Heading: {heading}<br />
|
|
47
47
|
Time: {attitude.time.toFixed(2)}<br />
|
|
48
48
|
Accuracy: {accuracyString}
|
|
49
|
-
</
|
|
50
|
-
{(event instanceof ProviderEvent) ? Utils.
|
|
49
|
+
</pre>
|
|
50
|
+
{(event instanceof ProviderEvent) ? Utils.renderFromStack(event) : ''}
|
|
51
51
|
</div>
|
|
52
52
|
);
|
|
53
53
|
}
|
|
@@ -62,14 +62,17 @@ class Utils {
|
|
|
62
62
|
return Utils.renderError(event);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
const {
|
|
66
|
-
|
|
65
|
+
const { values } = event.data;
|
|
67
66
|
return (
|
|
68
67
|
<div>
|
|
69
|
-
<
|
|
70
|
-
[
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
<pre>
|
|
69
|
+
[
|
|
70
|
+
{values[0].toFixed(2).padStart(6, ' ')},
|
|
71
|
+
{values[1].toFixed(2).padStart(6, ' ')},
|
|
72
|
+
{values[2].toFixed(2).padStart(6, ' ')}
|
|
73
|
+
]
|
|
74
|
+
</pre>
|
|
75
|
+
{Utils.renderFromStack(event)}
|
|
73
76
|
</div>
|
|
74
77
|
);
|
|
75
78
|
}
|
|
@@ -85,7 +88,7 @@ class Utils {
|
|
|
85
88
|
const position = event instanceof ProviderEvent ? event.data : event;
|
|
86
89
|
return (
|
|
87
90
|
<div>
|
|
88
|
-
<
|
|
91
|
+
<pre>
|
|
89
92
|
Latitude: {position.lat.toFixed(7)}<br />
|
|
90
93
|
Longitude: {position.lng.toFixed(7)}<br />
|
|
91
94
|
Altitude: {position.alt ? position.alt.toFixed(2) : NOT_AVAILABLE_STR}<br />
|
|
@@ -93,8 +96,8 @@ class Utils {
|
|
|
93
96
|
Bearing: {position.bearing !== null ? rad2deg(position.bearing).toFixed(2) : NOT_AVAILABLE_STR}<br />
|
|
94
97
|
Accuracy: {position.accuracy.toFixed(2)}<br />
|
|
95
98
|
Time: {position.time.toFixed(2)}
|
|
96
|
-
</
|
|
97
|
-
{(event instanceof ProviderEvent) ? Utils.
|
|
99
|
+
</pre>
|
|
100
|
+
{(event instanceof ProviderEvent) ? Utils.renderFromStack(event) : ''}
|
|
98
101
|
</div>
|
|
99
102
|
);
|
|
100
103
|
|
|
@@ -109,11 +112,11 @@ class Utils {
|
|
|
109
112
|
return Utils.renderError(position);
|
|
110
113
|
}
|
|
111
114
|
return (
|
|
112
|
-
<
|
|
115
|
+
<pre>
|
|
113
116
|
x: {position[0].toFixed(2)}<br />
|
|
114
117
|
y: {position[1].toFixed(2)}<br />
|
|
115
118
|
z: {position[2].toFixed(2)}
|
|
116
|
-
</
|
|
119
|
+
</pre>
|
|
117
120
|
);
|
|
118
121
|
|
|
119
122
|
}
|
|
@@ -137,13 +140,13 @@ class Utils {
|
|
|
137
140
|
|
|
138
141
|
|
|
139
142
|
return (
|
|
140
|
-
<
|
|
143
|
+
<pre>
|
|
141
144
|
projection: {info.projection.nearestElement.constructor.name}<br />
|
|
142
145
|
distanceOfProjection: {info.projection.distanceFromNearestElement.toFixed(1)}m<br />
|
|
143
146
|
traveledDistance: {info.traveledDistance.toFixed(1)}m ({(info.traveledPercentage * 100).toFixed(1)}%)<br />
|
|
144
147
|
remainingDistance: {info.remainingDistance.toFixed(1)}m ({(info.remainingPercentage * 100).toFixed(1)}%)<br />
|
|
145
148
|
nextStep: {nextStepStr}
|
|
146
|
-
</
|
|
149
|
+
</pre>
|
|
147
150
|
);
|
|
148
151
|
|
|
149
152
|
}
|
|
@@ -157,10 +160,10 @@ class Utils {
|
|
|
157
160
|
}
|
|
158
161
|
return (
|
|
159
162
|
<div>
|
|
160
|
-
<
|
|
163
|
+
<pre>
|
|
161
164
|
Inclination: {rad2deg(event.data).toFixed(2)} deg
|
|
162
|
-
</
|
|
163
|
-
{Utils.
|
|
165
|
+
</pre>
|
|
166
|
+
{Utils.renderFromStack(event)}
|
|
164
167
|
</div>
|
|
165
168
|
);
|
|
166
169
|
}
|
|
@@ -177,11 +180,11 @@ class Utils {
|
|
|
177
180
|
}
|
|
178
181
|
return (
|
|
179
182
|
<div>
|
|
180
|
-
<
|
|
183
|
+
<pre style={{ margin: 0 }}>
|
|
181
184
|
Number: {event.data.number}<br />
|
|
182
185
|
Size: {event.data.size.toFixed(2)}m
|
|
183
|
-
</
|
|
184
|
-
{Utils.
|
|
186
|
+
</pre>
|
|
187
|
+
{Utils.renderFromStack(event)}
|
|
185
188
|
</div>
|
|
186
189
|
);
|
|
187
190
|
}
|
|
@@ -190,26 +193,14 @@ class Utils {
|
|
|
190
193
|
return (<div style={{ maxWidth: '180px' }}><strong>[{error.constructor.name}]</strong><br />{error.message}</div>);
|
|
191
194
|
}
|
|
192
195
|
|
|
193
|
-
static renderFromStack(providersStack) {
|
|
194
|
-
return <
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
static renderTimeAndFromStack(event) {
|
|
202
|
-
return (
|
|
203
|
-
<p style={{
|
|
204
|
-
margin: 0,
|
|
205
|
-
fontSize: 'small'
|
|
206
|
-
}}>
|
|
207
|
-
{this.renderTime(event.timestamp)}<br />
|
|
208
|
-
{this.renderFromStack(event.providersStack)}
|
|
209
|
-
</p>
|
|
210
|
-
);
|
|
196
|
+
static renderFromStack({providersStack}) {
|
|
197
|
+
return <pre style={{
|
|
198
|
+
margin: 0,
|
|
199
|
+
fontSize: 'small'
|
|
200
|
+
}}>
|
|
201
|
+
Providers Stack: {providersStack.join(', ')}
|
|
202
|
+
</pre>;
|
|
211
203
|
}
|
|
212
|
-
|
|
213
204
|
}
|
|
214
205
|
|
|
215
206
|
export default Utils;
|
package/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import ProvidersOptions from './src/ProvidersOptions.js';
|
|
1
|
+
export { default as EventType } from './src/events/EventType.js';
|
|
2
|
+
export * as Providers from './src/Providers.js';
|
|
3
|
+
export { default as ProvidersInterface } from './src/ProvidersInterface.js';
|
|
4
|
+
export { default as ProvidersOptions } from './src/ProvidersOptions.js';
|
|
6
5
|
|
|
7
|
-
export {
|
|
8
|
-
|
|
9
|
-
};
|
|
6
|
+
export { default as PositionSmoother } from './src/smoothers/PositionSmoother.js';
|
|
7
|
+
export { default as AttitudeSmoother } from './src/smoothers/AttitudeSmoother.js';
|
package/package.json
CHANGED
|
@@ -8,19 +8,18 @@
|
|
|
8
8
|
"Guillaume Pannetier <guillaume.pannetier@getwemap.com>"
|
|
9
9
|
],
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@wemap/geo": "^
|
|
11
|
+
"@wemap/geo": "^4.0.1",
|
|
12
12
|
"@wemap/geomagnetism": "^0.1.1",
|
|
13
|
-
"@wemap/
|
|
14
|
-
"@wemap/
|
|
15
|
-
"@wemap/
|
|
16
|
-
"@wemap/
|
|
17
|
-
"@wemap/utils": "^3.3.0",
|
|
13
|
+
"@wemap/logger": "^4.0.0",
|
|
14
|
+
"@wemap/map": "^4.0.1",
|
|
15
|
+
"@wemap/maths": "^4.0.0",
|
|
16
|
+
"@wemap/utils": "^4.0.0",
|
|
18
17
|
"lodash.isempty": "^4.4.0",
|
|
19
18
|
"lodash.noop": "^3.0.1"
|
|
20
19
|
},
|
|
21
20
|
"description": "A package using different geoloc systems",
|
|
22
21
|
"devDependencies": {
|
|
23
|
-
"@wemap/osm": "^
|
|
22
|
+
"@wemap/osm": "^4.0.1",
|
|
24
23
|
"mapbox-gl": "^1.11.1"
|
|
25
24
|
},
|
|
26
25
|
"homepage": "https://github.com/wemap/wemap-modules-js#readme",
|
|
@@ -42,6 +41,6 @@
|
|
|
42
41
|
"url": "git+https://github.com/wemap/wemap-modules-js.git"
|
|
43
42
|
},
|
|
44
43
|
"type": "module",
|
|
45
|
-
"version": "
|
|
46
|
-
"gitHead": "
|
|
44
|
+
"version": "4.0.1",
|
|
45
|
+
"gitHead": "ba5cebf23d528021d4bd1a3498d51d98ac655fb9"
|
|
47
46
|
}
|
package/src/Providers.js
CHANGED
|
@@ -1,88 +1,35 @@
|
|
|
1
1
|
/* eslint-disable max-len */
|
|
2
|
-
/* eslint-disable id-length */
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const Imu = ImuProvider.instance;
|
|
8
|
-
const Accelerometer = AccelerometerProvider.instance;
|
|
9
|
-
const Gyroscope = GyroscopeProvider.instance;
|
|
3
|
+
export { default as Imu } from './providers/imu/Imu.js';
|
|
4
|
+
export { default as Accelerometer } from './providers/imu/Accelerometer.js';
|
|
5
|
+
export { default as Gyroscope } from './providers/imu/Gyroscope.js';
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const RelativeAttitudeFromBrowser = RelativeAttitudeFromBrowserProvider.instance;
|
|
16
|
-
const RelativeAttitudeFromEkf = RelativeAttitudeFromEkfProvider.instance;
|
|
17
|
-
const RelativeAttitudeFromInertial = RelativeAttitudeFromInertialProvider.instance;
|
|
18
|
-
const RelativeAttitude = RelativeAttitudeProvider.instance;
|
|
7
|
+
export { default as RelativeAttitudeFromBrowser } from './providers/attitude/relative/RelativeAttitudeFromBrowser.js';
|
|
8
|
+
export { default as RelativeAttitudeFromEkf } from './providers/attitude/relative/RelativeAttitudeFromEkf.js';
|
|
9
|
+
export { default as RelativeAttitudeFromInertial } from './providers/attitude/relative/RelativeAttitudeFromInertial.js';
|
|
10
|
+
export { default as RelativeAttitude } from './providers/attitude/relative/RelativeAttitude.js';
|
|
19
11
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const AbsoluteAttitudeFromRelAtt = AbsoluteAttitudeFromRelAttProvider.instance;
|
|
25
|
-
const AbsoluteAttitude = AbsoluteAttitudeProvider.instance;
|
|
12
|
+
export { default as AbsoluteAttitudeFromBrowser } from './providers/attitude/absolute/AbsoluteAttitudeFromBrowser.js';
|
|
13
|
+
export { default as AbsoluteAttitudeFromRelAtt } from './providers/attitude/absolute/AbsoluteAttitudeFromRelAtt.js';
|
|
14
|
+
export { default as AbsoluteAttitudeFused } from './providers/attitude/absolute/AbsoluteAttitudeFused.js';
|
|
15
|
+
export { default as AbsoluteAttitude } from './providers/attitude/absolute/AbsoluteAttitude.js';
|
|
26
16
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const InclinationFromAcc = InclinationFromAccProvider.instance;
|
|
31
|
-
const InclinationFromRelativeAttitude = InclinationFromRelativeAttitudeProvider.instance;
|
|
32
|
-
const Inclination = InclinationProvider.instance;
|
|
17
|
+
export { default as InclinationFromAcc } from './providers/inclination/InclinationFromAcc.js';
|
|
18
|
+
export { default as InclinationFromRelativeAttitude } from './providers/inclination/InclinationFromRelativeAttitude.js';
|
|
19
|
+
export { default as Inclination } from './providers/inclination/Inclination.js';
|
|
33
20
|
|
|
34
|
-
|
|
35
|
-
const StepDetection = StepDetectionProvider.instance;
|
|
21
|
+
export { default as StepDetection } from './providers/steps/StepDetection.js';
|
|
36
22
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const ArCore = ArCoreProvider.instance;
|
|
42
|
-
const Pdr = PdrProvider.instance;
|
|
43
|
-
const GeoRelativePositionFromArCore = GeoRelativePositionFromArCoreProvider.instance;
|
|
44
|
-
const GeoRelativePosition = GeoRelativePositionProvider.instance;
|
|
23
|
+
export { default as ArCore } from './providers/position/relative/ArCore.js';
|
|
24
|
+
export { default as Pdr } from './providers/position/relative/Pdr.js';
|
|
25
|
+
export { default as GeoRelativePositionFromArCore } from './providers/position/relative/GeoRelativePositionFromArCore.js';
|
|
26
|
+
export { default as GeoRelativePosition } from './providers/position/relative/GeoRelativePosition.js';
|
|
45
27
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const AbsolutePositionFromRel = AbsolutePositionFromRelProvider.instance;
|
|
51
|
-
const GnssWifi = GnssWifiProvider.instance;
|
|
52
|
-
const Ip = IpProvider.instance;
|
|
53
|
-
const AbsolutePosition = AbsolutePositionProvider.instance;
|
|
28
|
+
export { default as AbsolutePositionFromRel } from './providers/position/absolute/AbsolutePositionFromRel.js';
|
|
29
|
+
export { default as GnssWifi } from './providers/position/absolute/GnssWifi.js';
|
|
30
|
+
export { default as Ip } from './providers/position/absolute/Ip.js';
|
|
31
|
+
export { default as AbsolutePosition } from './providers/position/absolute/AbsolutePosition.js';
|
|
54
32
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const Barcode = BarcodeProvider.instance;
|
|
59
|
-
const CameraNative = CameraNativeProvider.instance;
|
|
60
|
-
const CameraProjectionMatrix = CameraProjectionMatrixProvider.instance;
|
|
61
|
-
|
|
62
|
-
export {
|
|
63
|
-
AbsoluteAttitude,
|
|
64
|
-
AbsoluteAttitudeFromBrowser,
|
|
65
|
-
AbsoluteAttitudeFromRelAtt,
|
|
66
|
-
AbsolutePosition,
|
|
67
|
-
AbsolutePositionFromRel,
|
|
68
|
-
Accelerometer,
|
|
69
|
-
ArCore,
|
|
70
|
-
Barcode,
|
|
71
|
-
CameraNative,
|
|
72
|
-
CameraProjectionMatrix,
|
|
73
|
-
GeoRelativePosition,
|
|
74
|
-
GeoRelativePositionFromArCore,
|
|
75
|
-
GnssWifi,
|
|
76
|
-
Gyroscope,
|
|
77
|
-
Imu,
|
|
78
|
-
Inclination,
|
|
79
|
-
InclinationFromAcc,
|
|
80
|
-
InclinationFromRelativeAttitude,
|
|
81
|
-
Ip,
|
|
82
|
-
Pdr,
|
|
83
|
-
RelativeAttitude,
|
|
84
|
-
RelativeAttitudeFromBrowser,
|
|
85
|
-
RelativeAttitudeFromEkf,
|
|
86
|
-
RelativeAttitudeFromInertial,
|
|
87
|
-
StepDetection
|
|
88
|
-
};
|
|
33
|
+
export { default as Barcode } from './providers/others/Barcode.js';
|
|
34
|
+
export { default as CameraNative } from './providers/others/CameraNative.js';
|
|
35
|
+
export { default as CameraProjectionMatrix } from './providers/others/CameraProjectionMatrix.js';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import {
|
|
3
|
-
Attitude, AbsoluteHeading, UserPosition
|
|
3
|
+
Attitude, AbsoluteHeading, UserPosition, Network
|
|
4
4
|
} from '@wemap/geo';
|
|
5
|
-
import { Network } from '@wemap/graph';
|
|
6
5
|
|
|
7
6
|
import EventType from './events/EventType.js';
|
|
8
7
|
import MetaProvider from './providers/MetaProvider.js';
|
|
@@ -10,6 +9,7 @@ import {
|
|
|
10
9
|
AbsoluteAttitude, AbsolutePosition, Barcode, CameraNative, CameraProjectionMatrix, Inclination, RelativeAttitude
|
|
11
10
|
} from './Providers.js';
|
|
12
11
|
import ProvidersLoggerOld from './events/ProvidersLoggerOld.js';
|
|
12
|
+
import MapMatchingHandler from './mapmatching/MapMatchingHandler.js';
|
|
13
13
|
|
|
14
14
|
class ProvidersInterface {
|
|
15
15
|
|
|
@@ -48,6 +48,10 @@ class ProvidersInterface {
|
|
|
48
48
|
*/
|
|
49
49
|
static feed(eventType, data) {
|
|
50
50
|
this._checkEventTypeDataConsistency(eventType, data);
|
|
51
|
+
if (eventType === EventType.Network) {
|
|
52
|
+
MapMatchingHandler.network = data;
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
51
55
|
this._getMetaProviderFromEventType(eventType).feed(data, eventType);
|
|
52
56
|
}
|
|
53
57
|
|
|
@@ -71,7 +75,6 @@ class ProvidersInterface {
|
|
|
71
75
|
return AbsoluteAttitude;
|
|
72
76
|
|
|
73
77
|
case EventType.AbsolutePosition:
|
|
74
|
-
case EventType.Network:
|
|
75
78
|
return AbsolutePosition;
|
|
76
79
|
|
|
77
80
|
case EventType.RelativeAttitude:
|
|
@@ -132,27 +135,27 @@ class ProvidersInterface {
|
|
|
132
135
|
}
|
|
133
136
|
|
|
134
137
|
static get mapMatchingMaxDistance() {
|
|
135
|
-
return
|
|
138
|
+
return MapMatchingHandler.maxDistance;
|
|
136
139
|
}
|
|
137
140
|
|
|
138
141
|
static set mapMatchingMaxDistance(maxDistance) {
|
|
139
|
-
|
|
142
|
+
MapMatchingHandler.maxDistance = maxDistance;
|
|
140
143
|
}
|
|
141
144
|
|
|
142
145
|
static get mapMatchingMinDistance() {
|
|
143
|
-
return
|
|
146
|
+
return MapMatchingHandler.minDistance;
|
|
144
147
|
}
|
|
145
148
|
|
|
146
149
|
static set mapMatchingMinDistance(minDistance) {
|
|
147
|
-
|
|
150
|
+
MapMatchingHandler.minDistance = minDistance;
|
|
148
151
|
}
|
|
149
152
|
|
|
150
153
|
static get mapMatchingMaxAngleBearing() {
|
|
151
|
-
return
|
|
154
|
+
return MapMatchingHandler.maxAngleBearing;
|
|
152
155
|
}
|
|
153
156
|
|
|
154
157
|
static set mapMatchingMaxAngleBearing(maxAngleBearing) {
|
|
155
|
-
|
|
158
|
+
MapMatchingHandler.maxAngleBearing = maxAngleBearing;
|
|
156
159
|
}
|
|
157
160
|
}
|
|
158
161
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
const DEFAULT_MESSAGE = 'It seems that you ask for IMU events on a desktop browser';
|
|
2
|
-
|
|
3
1
|
class AskImuOnDesktopError extends Error {
|
|
2
|
+
|
|
3
|
+
static DEFAULT_MESSAGE = 'It seems that you ask for IMU events on a desktop browser';
|
|
4
|
+
|
|
4
5
|
constructor(message) {
|
|
5
|
-
super(message || DEFAULT_MESSAGE);
|
|
6
|
+
super(message || AskImuOnDesktopError.DEFAULT_MESSAGE);
|
|
6
7
|
}
|
|
7
8
|
}
|
|
8
9
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
const DEFAULT_MESSAGE = 'Contains ignored provider';
|
|
2
|
-
|
|
3
1
|
class ContainsIgnoredProviderError extends Error {
|
|
2
|
+
|
|
3
|
+
static DEFAULT_MESSAGE = 'Contains ignored provider';
|
|
4
|
+
|
|
4
5
|
constructor(message) {
|
|
5
|
-
super(message || DEFAULT_MESSAGE);
|
|
6
|
+
super(message || ContainsIgnoredProviderError.DEFAULT_MESSAGE);
|
|
6
7
|
}
|
|
7
8
|
}
|
|
8
9
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
const DEFAULT_MESSAGE = 'Geolocation api is missing';
|
|
2
|
-
|
|
3
1
|
class GeolocationApiMissingError extends Error {
|
|
2
|
+
|
|
3
|
+
static DEFAULT_MESSAGE = 'Geolocation api is missing';
|
|
4
|
+
|
|
4
5
|
constructor(message) {
|
|
5
|
-
super(message || DEFAULT_MESSAGE);
|
|
6
|
+
super(message || GeolocationApiMissingError.DEFAULT_MESSAGE);
|
|
6
7
|
}
|
|
7
8
|
}
|
|
8
9
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
const DEFAULT_MESSAGE = 'Geolocation permission denied';
|
|
2
|
-
|
|
3
1
|
class GeolocationPermissionDeniedError extends Error {
|
|
2
|
+
|
|
3
|
+
static DEFAULT_MESSAGE = 'Geolocation permission denied';
|
|
4
|
+
|
|
4
5
|
constructor(message) {
|
|
5
|
-
super(message || DEFAULT_MESSAGE);
|
|
6
|
+
super(message || GeolocationPermissionDeniedError.DEFAULT_MESSAGE);
|
|
6
7
|
}
|
|
7
8
|
}
|
|
8
9
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
const DEFAULT_MESSAGE = 'Geolocation position unavailable';
|
|
2
|
-
|
|
3
1
|
class GeolocationPositionUnavailableError extends Error {
|
|
2
|
+
|
|
3
|
+
static DEFAULT_MESSAGE = 'Geolocation position unavailable';
|
|
4
|
+
|
|
4
5
|
constructor(message) {
|
|
5
|
-
super(message || DEFAULT_MESSAGE);
|
|
6
|
+
super(message || GeolocationPositionUnavailableError.DEFAULT_MESSAGE);
|
|
6
7
|
}
|
|
7
8
|
}
|
|
8
9
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
const DEFAULT_MESSAGE = 'IP Resolver failed';
|
|
2
|
-
|
|
3
1
|
class IpResolveServerError extends Error {
|
|
2
|
+
|
|
3
|
+
static DEFAULT_MESSAGE = 'IP Resolver failed';
|
|
4
|
+
|
|
4
5
|
constructor(message) {
|
|
5
|
-
super(message || DEFAULT_MESSAGE);
|
|
6
|
+
super(message || IpResolveServerError.DEFAULT_MESSAGE);
|
|
6
7
|
}
|
|
7
8
|
}
|
|
8
9
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import MissingSensorError from './MissingSensorError.js';
|
|
2
|
+
class MissingAccelerometerError extends MissingSensorError {
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
static DEFAULT_MESSAGE = 'Impossible to retrieve Acceleration data';
|
|
4
5
|
|
|
5
|
-
class MissingAccelerometerError extends MissingSensorError {
|
|
6
6
|
constructor(message) {
|
|
7
|
-
super(message || DEFAULT_MESSAGE);
|
|
7
|
+
super(message || MissingAccelerometerError.DEFAULT_MESSAGE);
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
const DEFAULT_MESSAGE = 'ARCore is missing';
|
|
2
|
-
|
|
3
1
|
class MissingArCoreError extends Error {
|
|
2
|
+
|
|
3
|
+
static DEFAULT_MESSAGE = 'ARCore is missing';
|
|
4
|
+
|
|
4
5
|
constructor(message) {
|
|
5
|
-
super(message || DEFAULT_MESSAGE);
|
|
6
|
+
super(message || MissingArCoreError.DEFAULT_MESSAGE);
|
|
6
7
|
}
|
|
7
8
|
}
|
|
8
9
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import MissingSensorError from './MissingSensorError.js';
|
|
2
|
+
class MissingGyroscopeError extends MissingSensorError {
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
static DEFAULT_MESSAGE = 'Impossible to retrieve Angular Rate data';
|
|
4
5
|
|
|
5
|
-
class MissingGyroscopeError extends MissingSensorError {
|
|
6
6
|
constructor(message) {
|
|
7
|
-
super(message || DEFAULT_MESSAGE);
|
|
7
|
+
super(message || MissingSensorError.DEFAULT_MESSAGE);
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
|