@wemap/positioning 1.2.0

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.
Files changed (51) hide show
  1. package/.eslintrc.json +479 -0
  2. package/.nvmrc +1 -0
  3. package/babel.config.js +11 -0
  4. package/config.json +7 -0
  5. package/debug/index.html +15 -0
  6. package/debug/index.old.html +37 -0
  7. package/package.json +82 -0
  8. package/scripts/release-github.js +216 -0
  9. package/src/Constants.js +11 -0
  10. package/src/NavigationHandler.js +244 -0
  11. package/src/Pose.js +8 -0
  12. package/src/attitude/Attitude.js +65 -0
  13. package/src/attitude/AttitudeHandler.js +343 -0
  14. package/src/attitude/EkfAttitude.js +238 -0
  15. package/src/attitude/EkfAttitude.spec.js +116 -0
  16. package/src/components/AbsoluteAttitude.jsx +136 -0
  17. package/src/components/Imu.jsx +89 -0
  18. package/src/components/LocationSource.jsx +434 -0
  19. package/src/components/Logger.jsx +113 -0
  20. package/src/components/NavigationDebugApp.jsx +106 -0
  21. package/src/components/Others.jsx +121 -0
  22. package/src/components/RelativeAttitude.jsx +104 -0
  23. package/src/components/Utils.js +35 -0
  24. package/src/components/index.js +13 -0
  25. package/src/index.js +9 -0
  26. package/src/providers/FixedLocationImuLocationSource.js +66 -0
  27. package/src/providers/GnssLocationSource.js +118 -0
  28. package/src/providers/GnssPdrLocationSource.js +182 -0
  29. package/src/providers/IPLocationSource.js +96 -0
  30. package/src/providers/LocationSource.js +290 -0
  31. package/src/providers/PdrLocationSource.js +312 -0
  32. package/src/providers/ProvidersLogger.js +77 -0
  33. package/src/providers/pdr/HeadingUnlocker.js +41 -0
  34. package/src/providers/pdr/HeadingUnlocker.spec.js +26 -0
  35. package/src/providers/pdr/Smoother.js +90 -0
  36. package/src/providers/pdr/Smoother.spec.js +424 -0
  37. package/src/providers/pdr/ThugDetector.js +37 -0
  38. package/src/providers/steps/StepDetection.js +7 -0
  39. package/src/providers/steps/StepDetectionLadetto.js +67 -0
  40. package/src/providers/steps/StepDetectionMinMaxPeaks.js +80 -0
  41. package/src/providers/steps/StepDetectionMinMaxPeaks2.js +108 -0
  42. package/src/sensors/SensorsCompatibility.js +484 -0
  43. package/src/sensors/SensorsCompatibility.spec.js +270 -0
  44. package/src/sensors/SensorsLogger.js +94 -0
  45. package/src/sensors/SensorsLoggerUtils.js +35 -0
  46. package/src.new/NavigationHandler.js +62 -0
  47. package/src.new/index.js +3 -0
  48. package/src.new/providers/FakeLocationSource.js +39 -0
  49. package/webpack/webpack.common.js +20 -0
  50. package/webpack/webpack.dev.js +24 -0
  51. package/webpack/webpack.prod.js +15 -0
package/.eslintrc.json ADDED
@@ -0,0 +1,479 @@
1
+ {
2
+ "env": {
3
+ "amd": true,
4
+ "browser": true,
5
+ "commonjs": true,
6
+ "es6": true,
7
+ "mocha": true,
8
+ "node": true
9
+ },
10
+ "parser": "babel-eslint",
11
+ "parserOptions": {
12
+ "ecmaFeatures": {
13
+ "experimentalObjectRestSpread": true,
14
+ "jsx": true
15
+ },
16
+ "ecmaVersion": 6,
17
+ "sourceType": "module"
18
+ },
19
+ "plugins": [
20
+ "react"
21
+ ],
22
+ "rules": {
23
+ "accessor-pairs": [
24
+ 2,
25
+ {
26
+ "getWithoutSet": false,
27
+ "setWithoutGet": true
28
+ }
29
+ ],
30
+ "array-bracket-spacing": [
31
+ 2,
32
+ "never",
33
+ {}
34
+ ],
35
+ "arrow-parens": 0,
36
+ "arrow-spacing": 0,
37
+ "block-scoped-var": 2,
38
+ "brace-style": [
39
+ 2,
40
+ "1tbs"
41
+ ],
42
+ "callback-return": 0,
43
+ "camelcase": [
44
+ 2,
45
+ {
46
+ "properties": "never"
47
+ }
48
+ ],
49
+ "comma-dangle": [
50
+ 2,
51
+ "never"
52
+ ],
53
+ "comma-spacing": [
54
+ 2,
55
+ {
56
+ "after": true
57
+ }
58
+ ],
59
+ "comma-style": 2,
60
+ "complexity": [
61
+ 2,
62
+ 20
63
+ ],
64
+ "computed-property-spacing": [
65
+ 2,
66
+ "never"
67
+ ],
68
+ "consistent-return": 2,
69
+ "consistent-this": [
70
+ 2,
71
+ "self"
72
+ ],
73
+ "constructor-super": 0,
74
+ "curly": [
75
+ 2,
76
+ "all"
77
+ ],
78
+ "default-case": 0,
79
+ "dot-location": [
80
+ 2,
81
+ "property"
82
+ ],
83
+ "dot-notation": [
84
+ 2,
85
+ {
86
+ "allowKeywords": true
87
+ }
88
+ ],
89
+ "eol-last": 2,
90
+ "eqeqeq": [
91
+ 2,
92
+ "allow-null"
93
+ ],
94
+ "func-names": 0,
95
+ "func-style": 0,
96
+ "generator-star-spacing": 0,
97
+ "guard-for-in": 2,
98
+ "handle-callback-err": [
99
+ 2,
100
+ "err"
101
+ ],
102
+ "id-length": [
103
+ 1,
104
+ {
105
+ "exceptions": [
106
+ "by",
107
+ "cb",
108
+ "fa",
109
+ "fs",
110
+ "id",
111
+ "js",
112
+ "ok",
113
+ "on",
114
+ "pp",
115
+ "pt",
116
+ "ne",
117
+ "nw",
118
+ "se",
119
+ "sw",
120
+ "to",
121
+ "e",
122
+ "i",
123
+ "j",
124
+ "k",
125
+ "l",
126
+ "m",
127
+ "n",
128
+ "x",
129
+ "y",
130
+ "z",
131
+ "FS",
132
+ "OK",
133
+ "PI",
134
+ "Q",
135
+ "L",
136
+ "W",
137
+ "$"
138
+ ],
139
+ "max": 26,
140
+ "min": 3
141
+ }
142
+ ],
143
+ "id-match": 0,
144
+ "indent": [
145
+ 2,
146
+ 4,
147
+ {
148
+ "SwitchCase": 0,
149
+ "VariableDeclarator": 1
150
+ }
151
+ ],
152
+ "init-declarations": 0,
153
+ "key-spacing": [
154
+ 1,
155
+ {
156
+ "afterColon": true,
157
+ "beforeColon": false,
158
+ "mode": "strict"
159
+ }
160
+ ],
161
+ "keyword-spacing": 2,
162
+ "linebreak-style": [
163
+ 2,
164
+ "unix"
165
+ ],
166
+ "lines-around-comment": [
167
+ 2,
168
+ {
169
+ "allowBlockStart": true,
170
+ "beforeBlockComment": true
171
+ }
172
+ ],
173
+ "max-depth": [
174
+ 2,
175
+ 4
176
+ ],
177
+ "max-len": [
178
+ 1,
179
+ 100,
180
+ 4,
181
+ {
182
+ "ignoreComments": true,
183
+ "ignoreUrls": true
184
+ }
185
+ ],
186
+ "max-nested-callbacks": [
187
+ 2,
188
+ 4
189
+ ],
190
+ "max-params": [
191
+ 1,
192
+ 4
193
+ ],
194
+ "max-statements": [
195
+ 1,
196
+ 25
197
+ ],
198
+ "new-cap": [
199
+ 2,
200
+ {
201
+ "capIsNew": true,
202
+ "newIsCap": true
203
+ }
204
+ ],
205
+ "new-parens": 2,
206
+ "newline-after-var": 0,
207
+ "no-alert": 2,
208
+ "no-array-constructor": 2,
209
+ "no-bitwise": 2,
210
+ "no-caller": 1,
211
+ "no-catch-shadow": 2,
212
+ "no-class-assign": 0,
213
+ "no-cond-assign": [
214
+ 2,
215
+ "except-parens"
216
+ ],
217
+ "no-console": 1,
218
+ "no-const-assign": 0,
219
+ "no-constant-condition": 2,
220
+ "no-continue": 1,
221
+ "no-control-regex": 2,
222
+ "no-debugger": 1,
223
+ "no-delete-var": 1,
224
+ "no-div-regex": 2,
225
+ "no-dupe-args": 2,
226
+ "no-dupe-keys": 2,
227
+ "no-duplicate-case": 1,
228
+ "no-else-return": 2,
229
+ "no-empty": 2,
230
+ "no-empty-character-class": 2,
231
+ "no-empty-label": 0,
232
+ "no-eq-null": 2,
233
+ "no-eval": 2,
234
+ "no-ex-assign": 2,
235
+ "no-extend-native": 0,
236
+ "no-extra-bind": 2,
237
+ "no-extra-boolean-cast": 2,
238
+ "no-extra-parens": [
239
+ 2,
240
+ "functions"
241
+ ],
242
+ "no-extra-semi": 2,
243
+ "no-fallthrough": 2,
244
+ "no-floating-decimal": 2,
245
+ "no-func-assign": 2,
246
+ "no-implicit-coercion": [
247
+ 1,
248
+ {
249
+ "boolean": true,
250
+ "number": true,
251
+ "string": true
252
+ }
253
+ ],
254
+ "no-implied-eval": 2,
255
+ "no-inline-comments": 2,
256
+ "no-inner-declarations": [
257
+ 2,
258
+ "both"
259
+ ],
260
+ "no-invalid-regexp": 2,
261
+ "no-irregular-whitespace": 2,
262
+ "no-iterator": 2,
263
+ "no-label-var": 2,
264
+ "no-labels": 2,
265
+ "no-lone-blocks": 2,
266
+ "no-lonely-if": 2,
267
+ "no-loop-func": 2,
268
+ "no-mixed-requires": 0,
269
+ "no-mixed-spaces-and-tabs": 2,
270
+ "no-multi-spaces": 2,
271
+ "no-multi-str": 2,
272
+ "no-multiple-empty-lines": [
273
+ 2,
274
+ {
275
+ "max": 2
276
+ }
277
+ ],
278
+ "no-native-reassign": 2,
279
+ "no-negated-in-lhs": 2,
280
+ "no-nested-ternary": 2,
281
+ "no-new": 2,
282
+ "no-new-func": 2,
283
+ "no-new-object": 2,
284
+ "no-new-require": 2,
285
+ "no-new-wrappers": 2,
286
+ "no-obj-calls": 2,
287
+ "no-octal": 2,
288
+ "no-octal-escape": 2,
289
+ "no-param-reassign": [
290
+ 1,
291
+ {
292
+ "props": true
293
+ }
294
+ ],
295
+ "no-path-concat": 2,
296
+ "no-plusplus": 0,
297
+ "no-process-env": 0,
298
+ "no-process-exit": 0,
299
+ "no-proto": 2,
300
+ "no-redeclare": [
301
+ 2,
302
+ {
303
+ "builtinGlobals": true
304
+ }
305
+ ],
306
+ "no-regex-spaces": 2,
307
+ "no-restricted-modules": 0,
308
+ "no-return-assign": [
309
+ 2,
310
+ "except-parens"
311
+ ],
312
+ "no-script-url": 1,
313
+ "no-self-compare": 2,
314
+ "no-sequences": 2,
315
+ "no-shadow": [
316
+ 2,
317
+ {
318
+ "hoist": "all"
319
+ }
320
+ ],
321
+ "no-shadow-restricted-names": 2,
322
+ "no-spaced-func": 2,
323
+ "no-sparse-arrays": 2,
324
+ "no-sync": 0,
325
+ "no-ternary": 0,
326
+ "no-this-before-super": 0,
327
+ "no-throw-literal": 2,
328
+ "no-trailing-spaces": 2,
329
+ "no-undef": 2,
330
+ "no-undef-init": 2,
331
+ "no-undefined": 2,
332
+ "no-underscore-dangle": 0,
333
+ "no-unexpected-multiline": 2,
334
+ "no-unneeded-ternary": 2,
335
+ "no-unreachable": 2,
336
+ "no-unused-expressions": 2,
337
+ "no-unused-vars": 2,
338
+ "no-use-before-define": 2,
339
+ "no-useless-call": 2,
340
+ "no-var": 0,
341
+ "no-void": 1,
342
+ "no-warning-comments": [
343
+ 1,
344
+ {
345
+ "location": "anywhere"
346
+ }
347
+ ],
348
+ "no-whitespace-before-property": 1,
349
+ "no-with": 2,
350
+ "object-curly-newline": [
351
+ 1,
352
+ {
353
+ "minProperties": 2
354
+ }
355
+ ],
356
+ "object-curly-spacing": 0,
357
+ "object-property-newline": [
358
+ 1,
359
+ {
360
+ "allowMultiplePropertiesPerLine": false
361
+ }
362
+ ],
363
+ "object-shorthand": 0,
364
+ "operator-assignment": 0,
365
+ "operator-linebreak": [
366
+ 2,
367
+ "before",
368
+ {
369
+ "overrides": {}
370
+ }
371
+ ],
372
+ "padded-blocks": 0,
373
+ "prefer-const": 1,
374
+ "prefer-reflect": 0,
375
+ "prefer-spread": 0,
376
+ "quote-props": 0,
377
+ "quotes": [
378
+ 2,
379
+ "single"
380
+ ],
381
+ "radix": 2,
382
+ "react/forbid-prop-types": [
383
+ 1,
384
+ {
385
+ "forbid": [
386
+ "any"
387
+ ]
388
+ }
389
+ ],
390
+ "react/jsx-indent": [
391
+ 2,
392
+ 4
393
+ ],
394
+ "react/jsx-indent-props": [
395
+ 2,
396
+ 4
397
+ ],
398
+ "react/jsx-max-props-per-line": [
399
+ 2,
400
+ {
401
+ "maximum": 1
402
+ }
403
+ ],
404
+ "react/jsx-no-comment-textnodes": 2,
405
+ "react/jsx-no-duplicate-props": 2,
406
+ "react/jsx-no-undef": 2,
407
+ "react/jsx-uses-vars": 2,
408
+ "react/no-deprecated": 1,
409
+ "react/prop-types": 2,
410
+ "require-yield": 0,
411
+ "semi": [
412
+ 2,
413
+ "always"
414
+ ],
415
+ "semi-spacing": 0,
416
+ "sort-vars": 0,
417
+ "space-after-keywords": 0,
418
+ "space-before-blocks": 0,
419
+ "space-before-function-paren": [
420
+ 2,
421
+ {
422
+ "anonymous": "never",
423
+ "named": "never"
424
+ }
425
+ ],
426
+ "space-in-parens": [
427
+ 2,
428
+ "never"
429
+ ],
430
+ "space-infix-ops": 2,
431
+ "space-unary-ops": 0,
432
+ "spaced-comment": [
433
+ 2,
434
+ "always",
435
+ {
436
+ "exceptions": [
437
+ "-",
438
+ "+",
439
+ "#"
440
+ ]
441
+ }
442
+ ],
443
+ "strict": [
444
+ 2,
445
+ "function"
446
+ ],
447
+ "use-isnan": 2,
448
+ "valid-jsdoc": 0,
449
+ "valid-typeof": 2,
450
+ "vars-on-top": 0,
451
+ "wrap-iife": [
452
+ 2,
453
+ "outside"
454
+ ],
455
+ "wrap-regex": 2,
456
+ "yoda": [
457
+ 2,
458
+ "never",
459
+ {}
460
+ ]
461
+ },
462
+ "settings": {
463
+ "react": {
464
+ "pragma": "React",
465
+ "version": "16.0"
466
+ }
467
+ },
468
+ "overrides": [
469
+ {
470
+ "files": [
471
+ "*.test.js",
472
+ "*.spec.js"
473
+ ],
474
+ "rules": {
475
+ "no-unused-expressions": "off"
476
+ }
477
+ }
478
+ ]
479
+ }
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ 12.10.0
@@ -0,0 +1,11 @@
1
+ module.exports = function(api) {
2
+ api.cache(true);
3
+
4
+ const presets = ['@babel/preset-env', '@babel/preset-react'];
5
+ const plugins = ['@babel/plugin-proposal-class-properties'];
6
+
7
+ return {
8
+ presets,
9
+ plugins
10
+ };
11
+ };
package/config.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "distFolder": "dist",
3
+ "distFileName": "wemap-positioning.min.js",
4
+ "githubRepoOwner": "wemap",
5
+ "githubRepoName": "wemap-positioning-js",
6
+ "releaseBranch": "master"
7
+ }
@@ -0,0 +1,15 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <title>Debug navigation</title>
7
+ <script src="/js/navigation-components.js"></script>
8
+ </head>
9
+
10
+ <body>
11
+ <div id="app"></div>
12
+ <script>createReactElement(NavigationDebugApp, document.getElementById('app'));</script>
13
+ </body>
14
+
15
+ </html>
@@ -0,0 +1,37 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+
4
+ <head>
5
+ <meta charset="utf-8">
6
+
7
+ <title>Positioning</title>
8
+
9
+ <script src="/js/navigation.js"></script>
10
+
11
+ </head>
12
+
13
+ <body>
14
+ Hello world !
15
+
16
+ <script>
17
+ const navHandler = new NavigationHandler(pose => console.log(pose));
18
+
19
+ navHandler.startIfNecessary()
20
+ .then(() => {
21
+ console.log('Navigation started');
22
+ });
23
+
24
+ setTimeout(() => {
25
+ navHandler.startIfNecessary();
26
+ }, 3000);
27
+
28
+ setTimeout(() => {
29
+ navHandler.stop()
30
+ .then(() => {
31
+ console.log('Navigation stopped');
32
+ });
33
+ }, 5000);
34
+ </script>
35
+ </body>
36
+
37
+ </html>
package/package.json ADDED
@@ -0,0 +1,82 @@
1
+ {
2
+ "author": "Wemap",
3
+ "bugs": {
4
+ "url": "https://github.com/wemap/wemap-positioning-js/issues"
5
+ },
6
+ "contributors": [
7
+ "Thibaud Michel <thibaud@getwemap.com>",
8
+ "Guillaume Pannetier <guillaume.pannetier@getwemap.com>"
9
+ ],
10
+ "dependencies": {
11
+ "@wemap/geo": "^0.1.2",
12
+ "@wemap/logger": "^0.1.4",
13
+ "@wemap/maths": "^0.1.1",
14
+ "file-saver": "^2.0.2",
15
+ "geomagnetism": "^0.1.0",
16
+ "jszip": "^3.2.2",
17
+ "lodash.isnumber": "^3.0.3",
18
+ "lodash.noop": "^3.0.1"
19
+ },
20
+ "description": "A package using different geoloc systems",
21
+ "devDependencies": {
22
+ "@babel/core": "^7.5.5",
23
+ "@babel/plugin-proposal-class-properties": "^7.5.5",
24
+ "@babel/preset-env": "^7.5.5",
25
+ "@babel/preset-react": "^7.0.0",
26
+ "@material-ui/core": "^4.4.0",
27
+ "app-module-path": "^2.2.0",
28
+ "babel-eslint": "^10.0.3",
29
+ "babel-loader": "^8.0.6",
30
+ "chai": "^4.2.0",
31
+ "chai-almost": "^1.0.1",
32
+ "chai-as-promised": "^7.1.1",
33
+ "css-loader": "^3.2.0",
34
+ "dotenv": "^8.1.0",
35
+ "eslint": "^6.2.2",
36
+ "eslint-plugin-babel": "^5.3.0",
37
+ "eslint-plugin-react": "^7.14.3",
38
+ "esm": "^3.2.25",
39
+ "jsdom": "^15.1.1",
40
+ "jsdom-global": "^3.0.2",
41
+ "mapbox-gl": "^1.3.0",
42
+ "mocha": "^6.2.0",
43
+ "npm": "^6.11.2",
44
+ "prop-types": "^15.7.2",
45
+ "react": "^16.9.0",
46
+ "react-dom": "^16.9.0",
47
+ "react-router-dom": "^5.0.1",
48
+ "request": "^2.88.0",
49
+ "request-promise": "^4.2.4",
50
+ "simple-git": "^1.124.0",
51
+ "url-parse": "^1.4.7",
52
+ "webpack": "^4.39.3",
53
+ "webpack-cli": "^3.3.7",
54
+ "webpack-dev-server": "^3.8.0",
55
+ "webpack-merge": "^4.2.1"
56
+ },
57
+ "homepage": "https://github.com/wemap/wemap-positioning-js#readme",
58
+ "keywords": [
59
+ "wemap",
60
+ "positioning",
61
+ "pdr",
62
+ "wifi",
63
+ "gnss",
64
+ "mapmatching"
65
+ ],
66
+ "license": "ISC",
67
+ "main": "src/index.js",
68
+ "name": "@wemap/positioning",
69
+ "repository": {
70
+ "type": "git",
71
+ "url": "git+https://github.com/wemap/wemap-positioning-js.git"
72
+ },
73
+ "scripts": {
74
+ "build": "webpack --display-modules --config webpack/webpack.prod.js",
75
+ "stats": "webpack --config webpack/webpack.prod.js --profile --json > stats.json",
76
+ "start": "webpack-dev-server --config webpack/webpack.dev.js --progress --inline --hot --https",
77
+ "lint": "eslint --ext .js,.jsx --quiet src",
78
+ "test": "mocha -r esm \"src/**/*.spec.js\"",
79
+ "release": "node ./scripts/release-github.js"
80
+ },
81
+ "version": "1.2.0"
82
+ }