gps-plus-slam-app-framework 1.0.6 → 1.0.7
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/LICENSE +4 -4
- package/README.md +249 -108
- package/dist/accuracy-circles-CsxE_7x1.d.ts +43 -0
- package/dist/{app-selectors-CHt7DLuq.d.ts → app-selectors-BeU0_ab8.d.ts} +8 -10
- package/dist/ar/camera-blit-capture.d.ts +1 -1
- package/dist/ar/capture-failure-tracker.d.ts +1 -1
- package/dist/ar/chromium-camera-access-workaround.d.ts +1 -1
- package/dist/ar/depth-sampler.d.ts +2 -2
- package/dist/ar/frame-loop.d.ts +2 -0
- package/dist/ar/frame-loop.js +40 -0
- package/dist/ar/image-capture.d.ts +1 -1
- package/dist/ar/image-capture.js +1 -1
- package/dist/ar/index.d.ts +12 -12
- package/dist/ar/index.js +3 -3
- package/dist/ar/replay-scene.d.ts +1 -1
- package/dist/ar/scene-node-names.d.ts +1 -1
- package/dist/ar/webxr-session.d.ts +4 -4
- package/dist/ar/webxr-session.js +150 -55
- package/dist/ar/xr-camera-texture.d.ts +1 -1
- package/dist/ar/xr-error-handler.d.ts +1 -1
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +2 -2
- package/dist/create-slam-app-store-CNsZ3rcX.d.ts +371 -0
- package/dist/{depth-sampler-BNCtnEoP.d.ts → depth-sampler-xg8vna6c.d.ts} +1 -1
- package/dist/{file-system-DD5TczSO.d.ts → file-system-DTApEv_Q.d.ts} +32 -2
- package/dist/frame-loop-QJIxLin0.d.ts +42 -0
- package/dist/frustum-visibility-BHnFrSKQ.d.ts +58 -0
- package/dist/{fused-path-DtqCSqJh.d.ts → fused-path-CB4DwWOG.d.ts} +1 -1
- package/dist/geo/h3-proximity.d.ts +1 -1
- package/dist/geo/index.d.ts +1 -1
- package/dist/{geo-types-Xx-LVcnw.d.ts → geo-types-CTuF23gG.d.ts} +16 -1
- package/dist/{gps-GKc6_Cly.d.ts → gps-DXoQb9Kf.d.ts} +1 -1
- package/dist/gps-anchor-CnWY61XK.d.ts +48 -0
- package/dist/gps-anchor-DjC_3MoT.js +257 -0
- package/dist/{gps-ar-pose-sampler-D_Zso40V.d.ts → gps-ar-pose-sampler-DsM1Kb2N.d.ts} +1 -1
- package/dist/{gps-event-coordinator-fwvmVfku.d.ts → gps-event-coordinator-DBx9I1YX.d.ts} +3 -3
- package/dist/gps-event-markers-BGr-iLvi.d.ts +103 -0
- package/dist/{image-capture-2pKjYUS6.d.ts → image-capture-DZLxHDN9.d.ts} +1 -1
- package/dist/index-gzWJMVpo.d.ts +2 -0
- package/dist/index-pOjUCKEP.d.ts +24 -0
- package/dist/index.d.ts +58 -52
- package/dist/index.js +11 -5
- package/dist/{leaflet-map-overlay-CQZcnxbc.d.ts → leaflet-map-overlay-Cew7XAoO.d.ts} +22 -11
- package/dist/{logger-B81iwxx0.d.ts → logger-C9vugiQb.d.ts} +7 -1
- package/dist/map-data-sih4g64v.d.ts +49 -0
- package/dist/map-overlay-draw-B3R1c9Xp.d.ts +42 -0
- package/dist/{null-storage-backend-C0TiwwzQ.d.ts → null-storage-backend-BKOS7JpL.d.ts} +2 -2
- package/dist/{opfs-storage-backend-Gt3rd76D.d.ts → opfs-storage-backend-Cj_7PWoq.d.ts} +2 -2
- package/dist/{permission-checker-Cu3nbH1S.d.ts → permission-checker-DPJl_RU6.d.ts} +41 -1
- package/dist/persistence-middleware-BkHIqvaA.d.ts +55 -0
- package/dist/{recording-replayer-BFhFs7Mc.d.ts → recording-replayer-CmCIIZ02.d.ts} +2 -2
- package/dist/{recording-slice-BiktUIWF.d.ts → recording-slice-d6OtCrza.d.ts} +2 -2
- package/dist/{replay-engine-B88Va62x.d.ts → replay-engine-BGBRQyXs.d.ts} +1 -1
- package/dist/{replay-scene-DtUm6bsr.d.ts → replay-scene-DpAGcAKY.d.ts} +3 -3
- package/dist/sensors/gps-error-handler.d.ts +1 -1
- package/dist/sensors/gps.d.ts +1 -1
- package/dist/sensors/gps.js +2 -2
- package/dist/sensors/index.d.ts +3 -3
- package/dist/sensors/permission-checker.d.ts +2 -2
- package/dist/sensors/permission-checker.js +79 -1
- package/dist/state/app-selectors.d.ts +2 -2
- package/dist/state/app-selectors.js +33 -3
- package/dist/state/combined-root-state.d.ts +2 -0
- package/dist/state/combined-root-state.js +1 -0
- package/dist/state/create-slam-app-store.d.ts +1 -1
- package/dist/state/create-slam-app-store.js +27 -13
- package/dist/state/gps-ar-pose-sampler.d.ts +3 -3
- package/dist/state/gps-event-coordinator.d.ts +1 -1
- package/dist/state/index.d.ts +17 -16
- package/dist/state/index.js +6 -4
- package/dist/state/persistence-middleware.d.ts +2 -2
- package/dist/state/persistence-middleware.js +35 -7
- package/dist/state/recording-options.d.ts +1 -1
- package/dist/state/recording-replayer.d.ts +2 -2
- package/dist/state/recording-slice.d.ts +1 -1
- package/dist/state/replay-engine.d.ts +1 -1
- package/dist/state/store-subscribers.d.ts +2 -2
- package/dist/state/store-subscribers.js +38 -12
- package/dist/state/subscribe-to-selector.d.ts +1 -1
- package/dist/state/tracking-quality.d.ts +2 -0
- package/dist/state/tracking-quality.js +723 -0
- package/dist/state/tracking-slice.d.ts +2 -0
- package/dist/state/tracking-slice.js +147 -0
- package/dist/storage/file-system-utils.d.ts +1 -1
- package/dist/storage/file-system.d.ts +2 -2
- package/dist/storage/file-system.js +52 -1
- package/dist/storage/index.d.ts +8 -8
- package/dist/storage/null-storage-backend.d.ts +1 -1
- package/dist/storage/opfs-storage-backend.d.ts +1 -1
- package/dist/storage/opfs-storage.d.ts +1 -1
- package/dist/storage/storage-backend.d.ts +1 -1
- package/dist/storage/zip-export.d.ts +1 -1
- package/dist/storage/zip-reader.d.ts +1 -1
- package/dist/storage/zip-reader.js +8 -4
- package/dist/{storage-backend-yVnuWGTr.d.ts → storage-backend-CT0Il_AB.d.ts} +1 -1
- package/dist/{store-subscribers-DKKHld49.d.ts → store-subscribers-Dce_CoJF.d.ts} +31 -6
- package/dist/{subscribe-to-selector-ghDKYtap.d.ts → subscribe-to-selector-DIHm3BRZ.d.ts} +1 -1
- package/dist/test-utils/browser-mocks.d.ts +1 -1
- package/dist/test-utils/zip-round-trip-helpers.d.ts +7 -1
- package/dist/test-utils/zip-round-trip-helpers.js +2 -1
- package/dist/tracking-slice-utCNND8t.d.ts +86 -0
- package/dist/types/ar-types.d.ts +1 -1
- package/dist/types/geo-types.d.ts +2 -2
- package/dist/types/index.d.ts +3 -3
- package/dist/utils/concurrency.d.ts +1 -1
- package/dist/utils/failure-tracker.d.ts +1 -1
- package/dist/utils/format-file-size.d.ts +1 -1
- package/dist/utils/fused-path.d.ts +1 -1
- package/dist/utils/index.d.ts +6 -6
- package/dist/utils/list-formatter.d.ts +1 -1
- package/dist/utils/logger.d.ts +1 -1
- package/dist/utils/logger.js +68 -8
- package/dist/visualization/accuracy-circles.d.ts +2 -0
- package/dist/visualization/accuracy-circles.js +57 -0
- package/dist/visualization/alignment-lerper.d.ts +1 -1
- package/dist/visualization/camera-follower.d.ts +1 -1
- package/dist/visualization/css3d-renderer-manager.d.ts +1 -1
- package/dist/visualization/frustum-visibility.d.ts +2 -0
- package/dist/visualization/frustum-visibility.js +139 -0
- package/dist/visualization/gps-anchor.d.ts +2 -0
- package/dist/visualization/gps-anchor.js +2 -0
- package/dist/visualization/gps-compass-cubes.d.ts +1 -1
- package/dist/visualization/gps-event-markers.d.ts +2 -2
- package/dist/visualization/gps-event-markers.js +69 -2
- package/dist/visualization/index.d.ts +17 -12
- package/dist/visualization/index.js +6 -2
- package/dist/visualization/leaflet-map-overlay.d.ts +1 -1
- package/dist/visualization/leaflet-map-overlay.js +33 -79
- package/dist/visualization/lerp-utils.d.ts +1 -1
- package/dist/visualization/map-data.d.ts +2 -0
- package/dist/visualization/map-data.js +33 -0
- package/dist/visualization/map-overlay-draw.d.ts +2 -0
- package/dist/visualization/map-overlay-draw.js +107 -0
- package/dist/visualization/map-overlay.d.ts +1 -1
- package/dist/visualization/three-dispose.d.ts +1 -1
- package/dist/visualization/vis-colors.d.ts +1 -1
- package/dist/{webxr-session-COlSrXdL.d.ts → webxr-session-DB5cIZnN.d.ts} +53 -12
- package/dist/{zip-reader-KgJEXbca.d.ts → zip-reader-D1105idz.d.ts} +5 -0
- package/package.json +16 -16
- package/dist/ar/tracking-state.d.ts +0 -2
- package/dist/ar/tracking-state.js +0 -164
- package/dist/combined-root-state-B3SvPNjU.d.ts +0 -6
- package/dist/create-slam-app-store-DBm7g2Zd.d.ts +0 -85
- package/dist/gps-anchored-mesh-manager-CovAFK4g.d.ts +0 -56
- package/dist/gps-event-markers-sVyO9utS.d.ts +0 -67
- package/dist/persistence-middleware-z-75iisb.d.ts +0 -31
- package/dist/tracking-state-B9QfuZCg.d.ts +0 -101
- package/dist/visualization/gps-anchored-mesh-manager.d.ts +0 -2
- package/dist/visualization/gps-anchored-mesh-manager.js +0 -128
- /package/dist/{alignment-lerper-D9BeDwZX.d.ts → alignment-lerper-L1RbWHQ4.d.ts} +0 -0
- /package/dist/{ar-types-B-ORgk6Z.d.ts → ar-types-Ck8LEq8k.d.ts} +0 -0
- /package/dist/{camera-blit-capture-DHuyrrxr.d.ts → camera-blit-capture-C1V9I1Z6.d.ts} +0 -0
- /package/dist/{camera-follower-BMqPddxx.d.ts → camera-follower-1k8mnw5J.d.ts} +0 -0
- /package/dist/{capture-failure-tracker-2Q6oI2uQ.d.ts → capture-failure-tracker-JKb1ST8E.d.ts} +0 -0
- /package/dist/{chromium-camera-access-workaround-CU5zSKNr.d.ts → chromium-camera-access-workaround-NvChXsi8.d.ts} +0 -0
- /package/dist/{concurrency-p6gB30fT.d.ts → concurrency-CMw8pSaG.d.ts} +0 -0
- /package/dist/{css3d-renderer-manager-rgLMVAvd.d.ts → css3d-renderer-manager-CkjCb2HW.d.ts} +0 -0
- /package/dist/{failure-tracker-1sQ_Cgyw.d.ts → failure-tracker-DnHXOIRa.d.ts} +0 -0
- /package/dist/{file-system-utils-BH8FdyIu.d.ts → file-system-utils-CtKiiw27.d.ts} +0 -0
- /package/dist/{format-file-size-onGq0k1Q.d.ts → format-file-size-BTS5H62-.d.ts} +0 -0
- /package/dist/{gps-compass-cubes-jRIJMOuh.d.ts → gps-compass-cubes-CsLtFv4B.d.ts} +0 -0
- /package/dist/{gps-error-handler-CH1S528z.d.ts → gps-error-handler-Dg3ziRVY.d.ts} +0 -0
- /package/dist/{h3-proximity-GwesPTFT.d.ts → h3-proximity-BhfgNbdW.d.ts} +0 -0
- /package/dist/{lerp-utils-CZgQlrmu.d.ts → lerp-utils-B8MM8zCR.d.ts} +0 -0
- /package/dist/{list-formatter-DKQQVLcl.d.ts → list-formatter-CNqi-E2j.d.ts} +0 -0
- /package/dist/{map-overlay-C9ifl_4-.d.ts → map-overlay-DAmreyA3.d.ts} +0 -0
- /package/dist/{opfs-storage-Dlq1I_Gb.d.ts → opfs-storage-DOPkzgeT.d.ts} +0 -0
- /package/dist/{recording-options-BYUFX8iU.d.ts → recording-options-Dq6IsKAv.d.ts} +0 -0
- /package/dist/{scene-node-names-DPsaE2z3.d.ts → scene-node-names-6LBjPmwz.d.ts} +0 -0
- /package/dist/{three-dispose-qt_r5wR1.d.ts → three-dispose-C2drkp6f.d.ts} +0 -0
- /package/dist/{vis-colors-BKkdTIKb.d.ts → vis-colors-CHQhjal3.d.ts} +0 -0
- /package/dist/{xr-camera-texture-BbukNE79.d.ts → xr-camera-texture-BU5YvKAM.d.ts} +0 -0
- /package/dist/{xr-error-handler-DTHfmvrl.d.ts → xr-error-handler-CDY5QxGb.d.ts} +0 -0
- /package/dist/{zip-export-BjrQPv0X.d.ts → zip-export-QO4iLIi7.d.ts} +0 -0
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import { registerFrameUpdate } from "./ar/frame-loop.js";
|
|
2
|
+
import { isObjectInCameraFrustum } from "./visualization/frustum-visibility.js";
|
|
3
|
+
import { calcRelativeCoordsInMeters } from "./core/index.js";
|
|
4
|
+
import * as THREE from "three";
|
|
5
|
+
//#region ../src/visualization/frame-conversions.ts
|
|
6
|
+
/**
|
|
7
|
+
* `frame-conversions` — small, pure coordinate-frame helpers for the AR scene
|
|
8
|
+
* graph. Currently a single function, `nueToArLocal`, that converts a
|
|
9
|
+
* GPS-world NUE point into the AR-odometry local frame of `arWorldGroup`.
|
|
10
|
+
*
|
|
11
|
+
* Background: the scene root is GPS-world NUE; `arWorldGroup.matrix` IS the
|
|
12
|
+
* alignment matrix, which maps **AR-odometry NUE → GPS-world NUE**. So a
|
|
13
|
+
* direct child of `arWorldGroup` whose WORLD position must equal a GPS-world
|
|
14
|
+
* point `nue` has to store `alignment⁻¹ · nue` as its LOCAL position —
|
|
15
|
+
* writing raw `nue` double-applies the alignment. Getting this wrong was the
|
|
16
|
+
* alignment-frame bug
|
|
17
|
+
* (gps-plus-slam/GpsPlusSlamJs_Docs/docs/2026-05-31-gps-anchor-alignment-frame-bug.md);
|
|
18
|
+
* this helper centralises the conversion behind one tested, well-named seam.
|
|
19
|
+
*
|
|
20
|
+
* Design (see the plan
|
|
21
|
+
* gps-plus-slam/GpsPlusSlamJs_Docs/docs/2026-05-31-nue-to-ar-local-helper-plan.md):
|
|
22
|
+
* - **Takes the explicit alignment matrix array**, NOT `Object3D.worldToLocal`.
|
|
23
|
+
* `worldToLocal` would read the live, mid-lerp `matrixWorld` and break
|
|
24
|
+
* replay determinism; the explicit target matrix keeps the result a pure
|
|
25
|
+
* function of its inputs. Full rationale in the review doc
|
|
26
|
+
* (gps-plus-slam/GpsPlusSlamJs_Docs/docs/2026-05-31-worldtolocal-frame-helper-review.md).
|
|
27
|
+
* - **Positions only.** No pose/quaternion variant exists until a caller
|
|
28
|
+
* needs one (YAGNI). No caller currently sets a GPS-world rotation.
|
|
29
|
+
*/
|
|
30
|
+
const scratchMatrix = new THREE.Matrix4();
|
|
31
|
+
/**
|
|
32
|
+
* Convert a GPS-world NUE point into the AR-local position to write into a
|
|
33
|
+
* direct child of `arWorldGroup`, given the current alignment matrix.
|
|
34
|
+
*
|
|
35
|
+
* Computes `alignment⁻¹ · nue`. When the result is later composed back by the
|
|
36
|
+
* group's matrix (the same `alignment`), the child's WORLD position equals
|
|
37
|
+
* `nue` exactly.
|
|
38
|
+
*
|
|
39
|
+
* @param alignment - The alignment matrix as a 16-element **column-major**
|
|
40
|
+
* array (AR-odometry NUE → GPS-world NUE), e.g. from `getAlignmentMatrix()`
|
|
41
|
+
* or `THREE.Matrix4.toArray()`. Not mutated.
|
|
42
|
+
* @param nue - The GPS-world NUE point `[north, up, east]` in metres. Not
|
|
43
|
+
* mutated.
|
|
44
|
+
* @param out - Optional target vector to write into and return (pass a reused
|
|
45
|
+
* scratch to avoid allocation on hot paths). Defaults to a fresh
|
|
46
|
+
* `THREE.Vector3`.
|
|
47
|
+
* @returns `out`, set to the AR-local position.
|
|
48
|
+
*/
|
|
49
|
+
function nueToArLocal(alignment, nue, out = new THREE.Vector3()) {
|
|
50
|
+
scratchMatrix.fromArray(alignment).invert();
|
|
51
|
+
return out.set(nue[0], nue[1], nue[2]).applyMatrix4(scratchMatrix);
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
//#region ../src/visualization/gps-anchor.ts
|
|
55
|
+
/**
|
|
56
|
+
* `createGpsAnchor` — GPS-anchored placement of a single `THREE.Object3D`.
|
|
57
|
+
*
|
|
58
|
+
* See the colocated sidecar (`gps-anchor.ts.md`) and the port plan at
|
|
59
|
+
* `gps-plus-slam/GpsPlusSlamJs_Docs/docs/2026-05-13-gps-anchor-port-plan.md`
|
|
60
|
+
* for the full design, state machine, and test matrix.
|
|
61
|
+
*
|
|
62
|
+
* This file implements sub-steps 2 (bootstrap phase), 3 (steady-state
|
|
63
|
+
* `'snap-every-tick'` + distance-scaled threshold gate), and 4
|
|
64
|
+
* (`'snap-when-offscreen'` mode gate + alignment-matrix large-jump
|
|
65
|
+
* bypass). Floor-Y correction is sub-step 6 and remains deferred.
|
|
66
|
+
*/
|
|
67
|
+
/**
|
|
68
|
+
* Module-level registry of objects currently owned by a `GpsAnchor`.
|
|
69
|
+
* Used to detect nested anchors (parent + child both anchored) which
|
|
70
|
+
* we explicitly forbid; mirrors the C# invariant.
|
|
71
|
+
*/
|
|
72
|
+
const anchoredObjects = /* @__PURE__ */ new WeakSet();
|
|
73
|
+
function isObjectInAnchoredChain(object) {
|
|
74
|
+
let cursor = object;
|
|
75
|
+
while (cursor) {
|
|
76
|
+
if (anchoredObjects.has(cursor)) return true;
|
|
77
|
+
cursor = cursor.parent;
|
|
78
|
+
}
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
function median(values) {
|
|
82
|
+
const sorted = [...values].sort((a, b) => a - b);
|
|
83
|
+
const mid = Math.floor(sorted.length / 2);
|
|
84
|
+
if (sorted.length % 2 === 0) return (sorted[mid - 1] + sorted[mid]) / 2;
|
|
85
|
+
return sorted[mid];
|
|
86
|
+
}
|
|
87
|
+
function medianPoint(samples) {
|
|
88
|
+
const lat = median(samples.map((s) => s.lat));
|
|
89
|
+
const lon = median(samples.map((s) => s.lon));
|
|
90
|
+
const alts = samples.map((s) => "altitude" in s ? s.altitude : void 0).filter((a) => typeof a === "number");
|
|
91
|
+
if (alts.length > 0) return {
|
|
92
|
+
lat,
|
|
93
|
+
lon,
|
|
94
|
+
altitude: median(alts)
|
|
95
|
+
};
|
|
96
|
+
return {
|
|
97
|
+
lat,
|
|
98
|
+
lon
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
function createGpsAnchor(options) {
|
|
102
|
+
if (isObjectInAnchoredChain(options.object3D)) throw new Error("createGpsAnchor: nested GpsAnchors are not supported — the supplied object3D is already inside an anchored parent chain.");
|
|
103
|
+
anchoredObjects.add(options.object3D);
|
|
104
|
+
const sampleCount = options.secondsToAccumulateGpsPose ?? 7;
|
|
105
|
+
if (sampleCount < 1) {
|
|
106
|
+
anchoredObjects.delete(options.object3D);
|
|
107
|
+
throw new Error("createGpsAnchor: secondsToAccumulateGpsPose must be >= 1 — use skipBootstrap:true to bypass the accumulation phase.");
|
|
108
|
+
}
|
|
109
|
+
const settlingSeconds = options.settlingSeconds ?? 0;
|
|
110
|
+
const distanceThreshold = options.distanceThreshold ?? 2;
|
|
111
|
+
options.angleThresholdInDegrees;
|
|
112
|
+
const mode = options.mode ?? "snap-when-offscreen";
|
|
113
|
+
const LARGE_JUMP_TRANSLATION_M = 4;
|
|
114
|
+
const LARGE_JUMP_Y_M = 20;
|
|
115
|
+
const LARGE_JUMP_ROTATION_DEG = 2;
|
|
116
|
+
const scratchTarget = new THREE.Vector3();
|
|
117
|
+
const scratchCamWorld = new THREE.Vector3();
|
|
118
|
+
const scratchObjWorld = new THREE.Vector3();
|
|
119
|
+
const scratchPrevMatrix = new THREE.Matrix4();
|
|
120
|
+
const scratchCurrMatrix = new THREE.Matrix4();
|
|
121
|
+
const scratchPrevTrans = new THREE.Vector3();
|
|
122
|
+
const scratchCurrTrans = new THREE.Vector3();
|
|
123
|
+
const scratchPrevQuat = new THREE.Quaternion();
|
|
124
|
+
const scratchCurrQuat = new THREE.Quaternion();
|
|
125
|
+
let phase = options.skipBootstrap === true ? "anchored" : "bootstrap";
|
|
126
|
+
let isFullyAnchored = phase === "anchored";
|
|
127
|
+
let gpsPoint = options.gpsPoint;
|
|
128
|
+
let phaseEnteredAtElapsed = null;
|
|
129
|
+
let lastSampleAtElapsed = null;
|
|
130
|
+
const samples = [];
|
|
131
|
+
/**
|
|
132
|
+
* Snapshot of the previous tick's alignment matrix. `null` until the
|
|
133
|
+
* first steady-state tick in which `getAlignmentMatrix()` returned a
|
|
134
|
+
* non-null value. Used by the large-jump bypass to compare against
|
|
135
|
+
* the current tick's matrix.
|
|
136
|
+
*/
|
|
137
|
+
let prevAlignmentMatrix = null;
|
|
138
|
+
/**
|
|
139
|
+
* Returns true iff the alignment matrix has jumped by more than the
|
|
140
|
+
* configured large-jump thresholds between `prev` and `curr`. A
|
|
141
|
+
* `null` `prev` (first tick) is treated as "no jump".
|
|
142
|
+
*/
|
|
143
|
+
const detectLargeAlignmentJump = (prev, curr) => {
|
|
144
|
+
if (prev === null || curr === null) return false;
|
|
145
|
+
scratchPrevMatrix.fromArray(prev);
|
|
146
|
+
scratchCurrMatrix.fromArray(curr);
|
|
147
|
+
scratchPrevTrans.setFromMatrixPosition(scratchPrevMatrix);
|
|
148
|
+
scratchCurrTrans.setFromMatrixPosition(scratchCurrMatrix);
|
|
149
|
+
const dTrans = scratchPrevTrans.distanceTo(scratchCurrTrans);
|
|
150
|
+
const dY = Math.abs(scratchCurrTrans.y - scratchPrevTrans.y);
|
|
151
|
+
scratchPrevQuat.setFromRotationMatrix(scratchPrevMatrix);
|
|
152
|
+
scratchCurrQuat.setFromRotationMatrix(scratchCurrMatrix);
|
|
153
|
+
const dRotDeg = scratchPrevQuat.angleTo(scratchCurrQuat) * 180 / Math.PI;
|
|
154
|
+
return dTrans > LARGE_JUMP_TRANSLATION_M || dY > LARGE_JUMP_Y_M || dRotDeg > LARGE_JUMP_ROTATION_DEG;
|
|
155
|
+
};
|
|
156
|
+
const enterBootstrap = () => {
|
|
157
|
+
phase = "bootstrap";
|
|
158
|
+
isFullyAnchored = false;
|
|
159
|
+
phaseEnteredAtElapsed = null;
|
|
160
|
+
lastSampleAtElapsed = null;
|
|
161
|
+
samples.length = 0;
|
|
162
|
+
prevAlignmentMatrix = null;
|
|
163
|
+
};
|
|
164
|
+
const commitMedian = () => {
|
|
165
|
+
gpsPoint = medianPoint(samples);
|
|
166
|
+
phase = "anchored";
|
|
167
|
+
isFullyAnchored = true;
|
|
168
|
+
samples.length = 0;
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* Steady-state: compute the GPS-world NUE target from the stored
|
|
172
|
+
* `gpsPoint` and the current `zeroRef`, map it into `arWorldGroup`'s
|
|
173
|
+
* AR-local frame via the inverse alignment matrix, and commit it to
|
|
174
|
+
* `object3D.position` iff the (AR-local) position delta exceeds the
|
|
175
|
+
* distance-scaled threshold AND the mode gate (with optional large-jump
|
|
176
|
+
* bypass) allows it.
|
|
177
|
+
*
|
|
178
|
+
* Frame note: `arWorldGroup.matrix` IS the alignment matrix, which maps
|
|
179
|
+
* **AR-odometry NUE → GPS-world NUE**. `object3D.position` is a *local*
|
|
180
|
+
* transform in that AR-odometry frame. To make the object's *world*
|
|
181
|
+
* position equal the GPS-world `nue`, the local target must be
|
|
182
|
+
* `alignment⁻¹ · nue` — writing raw `nue` would double-apply the
|
|
183
|
+
* alignment (world = `alignment · nue`). See
|
|
184
|
+
* `gps-plus-slam/GpsPlusSlamJs_Docs/docs/2026-05-31-gps-anchor-alignment-frame-bug.md`.
|
|
185
|
+
*
|
|
186
|
+
* Returns silently on missing inputs (no `zeroRef`, or no alignment
|
|
187
|
+
* matrix yet — an AR-local object cannot be placed without knowing the
|
|
188
|
+
* AR↔NUE transform).
|
|
189
|
+
*/
|
|
190
|
+
const maybeCommitSteadyState = () => {
|
|
191
|
+
const zero = options.getGpsZeroRef();
|
|
192
|
+
if (zero === null || zero === void 0) return;
|
|
193
|
+
const currentAlignment = options.getAlignmentMatrix();
|
|
194
|
+
const largeJump = detectLargeAlignmentJump(prevAlignmentMatrix, currentAlignment);
|
|
195
|
+
prevAlignmentMatrix = currentAlignment;
|
|
196
|
+
if (currentAlignment === null || currentAlignment === void 0) return;
|
|
197
|
+
const targetAlt = "altitude" in gpsPoint && typeof gpsPoint.altitude === "number" ? gpsPoint.altitude : 0;
|
|
198
|
+
const nue = calcRelativeCoordsInMeters(zero, gpsPoint, targetAlt, 0);
|
|
199
|
+
nueToArLocal(currentAlignment, [
|
|
200
|
+
nue[0],
|
|
201
|
+
nue[1],
|
|
202
|
+
nue[2]
|
|
203
|
+
], scratchTarget);
|
|
204
|
+
options.camera.getWorldPosition(scratchCamWorld);
|
|
205
|
+
options.object3D.getWorldPosition(scratchObjWorld);
|
|
206
|
+
const scale = 1 + 10 * scratchCamWorld.distanceTo(scratchObjWorld) / 100;
|
|
207
|
+
if (options.object3D.position.distanceTo(scratchTarget) < distanceThreshold * scale) return;
|
|
208
|
+
if (mode === "snap-when-offscreen" && !largeJump) {
|
|
209
|
+
if (isObjectInCameraFrustum(options.camera, options.object3D)) return;
|
|
210
|
+
}
|
|
211
|
+
options.object3D.position.copy(scratchTarget);
|
|
212
|
+
};
|
|
213
|
+
const tick = (_dt, elapsed) => {
|
|
214
|
+
if (phase === "anchored") {
|
|
215
|
+
maybeCommitSteadyState();
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
if (phaseEnteredAtElapsed === null) {
|
|
219
|
+
phaseEnteredAtElapsed = elapsed;
|
|
220
|
+
lastSampleAtElapsed = elapsed - 1;
|
|
221
|
+
}
|
|
222
|
+
if (elapsed - phaseEnteredAtElapsed < settlingSeconds) return;
|
|
223
|
+
if (lastSampleAtElapsed !== null && elapsed - lastSampleAtElapsed < 1) return;
|
|
224
|
+
const sample = options.getCurrentGpsPoint();
|
|
225
|
+
if (sample === null || sample === void 0) return;
|
|
226
|
+
samples.push(sample);
|
|
227
|
+
lastSampleAtElapsed = elapsed;
|
|
228
|
+
if (samples.length >= sampleCount) commitMedian();
|
|
229
|
+
};
|
|
230
|
+
const unregister = registerFrameUpdate(tick);
|
|
231
|
+
return {
|
|
232
|
+
get phase() {
|
|
233
|
+
return phase;
|
|
234
|
+
},
|
|
235
|
+
get isFullyAnchored() {
|
|
236
|
+
return isFullyAnchored;
|
|
237
|
+
},
|
|
238
|
+
get gpsPoint() {
|
|
239
|
+
return gpsPoint;
|
|
240
|
+
},
|
|
241
|
+
markMovedExternally() {
|
|
242
|
+
enterBootstrap();
|
|
243
|
+
},
|
|
244
|
+
setGpsPoint(point) {
|
|
245
|
+
gpsPoint = point;
|
|
246
|
+
},
|
|
247
|
+
dispose() {
|
|
248
|
+
unregister();
|
|
249
|
+
anchoredObjects.delete(options.object3D);
|
|
250
|
+
},
|
|
251
|
+
__tickForTests(dt, elapsed) {
|
|
252
|
+
tick(dt, elapsed);
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
//#endregion
|
|
257
|
+
export { nueToArLocal as n, createGpsAnchor as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as ARPose } from "./ar-types-
|
|
2
|
-
import { n as RawDeviceOrientation, t as GpsPosition } from "./gps-
|
|
3
|
-
import { i as SlamAppStore } from "./create-slam-app-store-
|
|
1
|
+
import { t as ARPose } from "./ar-types-Ck8LEq8k.js";
|
|
2
|
+
import { n as RawDeviceOrientation, t as GpsPosition } from "./gps-DXoQb9Kf.js";
|
|
3
|
+
import { i as SlamAppStore } from "./create-slam-app-store-CNsZ3rcX.js";
|
|
4
4
|
import { Quaternion, RawGpsPoint, RecordGpsEventPayload, Vector3, eulerToQuaternion } from "gps-plus-slam-js";
|
|
5
5
|
import { ReducersMapObject } from "@reduxjs/toolkit";
|
|
6
6
|
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { LatLong, Vector3 } from "gps-plus-slam-js";
|
|
2
|
+
|
|
3
|
+
//#region ../src/visualization/gps-event-markers.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Optional GPS-accuracy hints used by {@link GpsEventVisualizer.addGpsEvent}
|
|
6
|
+
* to render the raw-GPS marker as a non-uniform-scaled ellipsoid.
|
|
7
|
+
*
|
|
8
|
+
* Both fields are optional — missing or non-positive values fall back to the
|
|
9
|
+
* legacy fixed 8 cm sphere (same defensive policy as `preview-map.ts`).
|
|
10
|
+
*/
|
|
11
|
+
interface GpsEventAccuracy {
|
|
12
|
+
/** Horizontal 1σ accuracy in metres (applied to both X and Z axes). */
|
|
13
|
+
horizontal?: number;
|
|
14
|
+
/** Vertical 1σ accuracy in metres (applied to the Y axis). */
|
|
15
|
+
vertical?: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Manager for GPS event visualization
|
|
19
|
+
*/
|
|
20
|
+
declare class GpsEventVisualizer {
|
|
21
|
+
private rawGpsMarkers;
|
|
22
|
+
private fusedMarkers;
|
|
23
|
+
private snapshotMarkers;
|
|
24
|
+
private zeroRef;
|
|
25
|
+
private eventCounter;
|
|
26
|
+
private snapshotCounter;
|
|
27
|
+
/**
|
|
28
|
+
* Set the GPS zero reference (origin for coordinate conversion).
|
|
29
|
+
* Must be called before adding GPS events.
|
|
30
|
+
*
|
|
31
|
+
* @param zero - GPS coordinates of the origin
|
|
32
|
+
*/
|
|
33
|
+
setZeroRef(zero: LatLong): void;
|
|
34
|
+
/**
|
|
35
|
+
* Get the current zero reference
|
|
36
|
+
*/
|
|
37
|
+
getZeroRef(): LatLong | null;
|
|
38
|
+
/**
|
|
39
|
+
* Add a GPS event to the visualization.
|
|
40
|
+
* Creates both a raw GPS marker and a fused alignment marker.
|
|
41
|
+
*
|
|
42
|
+
* @param gpsCoords - GPS position as [x, y, z] meters from zero reference
|
|
43
|
+
* @param odomPosition - AR odometry position at the time of GPS reading
|
|
44
|
+
* @param accuracy - Optional 1σ GPS accuracy. When both fields are positive,
|
|
45
|
+
* the raw-GPS marker is rendered as a non-uniform-scaled ellipsoid:
|
|
46
|
+
* `mesh.scale.set(horizontal, vertical, horizontal)` over a unit sphere.
|
|
47
|
+
* When missing, zero, or negative, the marker falls back to the legacy
|
|
48
|
+
* fixed 8 cm sphere (same defensive policy as `preview-map.ts`).
|
|
49
|
+
* Cyan fused and red snapshot markers are never affected by this argument.
|
|
50
|
+
*/
|
|
51
|
+
addGpsEvent(gpsCoords: Vector3, odomPosition: Vector3, accuracy?: GpsEventAccuracy): void;
|
|
52
|
+
/**
|
|
53
|
+
* Add an alignment snapshot marker at the given NUE position.
|
|
54
|
+
* Snapshots represent the system's best GPS estimate at each alignment update.
|
|
55
|
+
* Added to scene root (GPS world space), not arWorldGroup.
|
|
56
|
+
*/
|
|
57
|
+
addAlignmentSnapshot(nuePosition: Vector3): void;
|
|
58
|
+
/**
|
|
59
|
+
* Get the NUE positions of all alignment snapshot markers.
|
|
60
|
+
* Used at session end to convert to GPS coordinates for the summary map.
|
|
61
|
+
*/
|
|
62
|
+
getAlignmentSnapshotPositions(): Vector3[];
|
|
63
|
+
/**
|
|
64
|
+
* Create a sphere marker mesh with the given color and name.
|
|
65
|
+
*/
|
|
66
|
+
private createMarkerMesh;
|
|
67
|
+
/**
|
|
68
|
+
* Clear all markers from the scene and reset state.
|
|
69
|
+
*/
|
|
70
|
+
clearAll(): void;
|
|
71
|
+
/**
|
|
72
|
+
* Get count of visible markers.
|
|
73
|
+
*/
|
|
74
|
+
getCounts(): {
|
|
75
|
+
raw: number;
|
|
76
|
+
fused: number;
|
|
77
|
+
snapshots: number;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Diagnostic accessor: returns the world-space size (`THREE.Box3.setFromObject`)
|
|
81
|
+
* of each raw-GPS marker, in insertion order.
|
|
82
|
+
*
|
|
83
|
+
* Used by the rec31 accuracy-ellipsoid Playwright spec (§3c) to verify the
|
|
84
|
+
* relative scaling of two events with different `latLongAccuracy`. This is
|
|
85
|
+
* the size of the rendered ellipsoid in scene units (= metres in replay
|
|
86
|
+
* mode), not the underlying geometry radius — so it correctly reflects the
|
|
87
|
+
* `mesh.scale.set(h, v, h)` applied for accuracy-aware markers.
|
|
88
|
+
*
|
|
89
|
+
* @returns array of `{ x, y, z }` sizes — empty array if there are no markers.
|
|
90
|
+
*/
|
|
91
|
+
getRawMarkerWorldSizes(): Array<{
|
|
92
|
+
x: number;
|
|
93
|
+
y: number;
|
|
94
|
+
z: number;
|
|
95
|
+
}>;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Singleton instance for global use.
|
|
99
|
+
* Import this to visualize GPS events.
|
|
100
|
+
*/
|
|
101
|
+
declare const gpsEventVisualizer: GpsEventVisualizer;
|
|
102
|
+
//#endregion
|
|
103
|
+
export { GpsEventVisualizer as n, gpsEventVisualizer as r, GpsEventAccuracy as t };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { ArImageCapture as ArImageCapture$1, GpsPoint as GpsPoint$1, LatLong as LatLong$1, LatLongAlt, Matrix4 as Matrix4$1, Quaternion as Quaternion$1, RootState as LibraryRootState, RootState as RootState$1, Vector3 as Vector3$1, calcGpsCoords as calcGpsCoords$1, calcRelativeCoordsInMeters, createGpsSlamStore, isIdentityMatrix4, odometryTrackingRestarted, validateLicenseKey as validateLicenseKey$1, webxrToNUE } from "gps-plus-slam-js";
|
|
2
|
+
export { LibraryRootState as a, RootState$1 as c, calcRelativeCoordsInMeters as d, createGpsSlamStore as f, webxrToNUE as g, validateLicenseKey$1 as h, LatLongAlt as i, Vector3$1 as l, odometryTrackingRestarted as m, GpsPoint$1 as n, Matrix4$1 as o, isIdentityMatrix4 as p, LatLong$1 as r, Quaternion$1 as s, ArImageCapture$1 as t, calcGpsCoords$1 as u };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
|
|
3
|
+
//#region ../src/visualization/frame-conversions.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Convert a GPS-world NUE point into the AR-local position to write into a
|
|
6
|
+
* direct child of `arWorldGroup`, given the current alignment matrix.
|
|
7
|
+
*
|
|
8
|
+
* Computes `alignment⁻¹ · nue`. When the result is later composed back by the
|
|
9
|
+
* group's matrix (the same `alignment`), the child's WORLD position equals
|
|
10
|
+
* `nue` exactly.
|
|
11
|
+
*
|
|
12
|
+
* @param alignment - The alignment matrix as a 16-element **column-major**
|
|
13
|
+
* array (AR-odometry NUE → GPS-world NUE), e.g. from `getAlignmentMatrix()`
|
|
14
|
+
* or `THREE.Matrix4.toArray()`. Not mutated.
|
|
15
|
+
* @param nue - The GPS-world NUE point `[north, up, east]` in metres. Not
|
|
16
|
+
* mutated.
|
|
17
|
+
* @param out - Optional target vector to write into and return (pass a reused
|
|
18
|
+
* scratch to avoid allocation on hot paths). Defaults to a fresh
|
|
19
|
+
* `THREE.Vector3`.
|
|
20
|
+
* @returns `out`, set to the AR-local position.
|
|
21
|
+
*/
|
|
22
|
+
declare function nueToArLocal(alignment: readonly number[], nue: readonly [number, number, number], out?: THREE.Vector3): THREE.Vector3;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { nueToArLocal as t };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,53 +1,59 @@
|
|
|
1
|
-
import { i as computeCaptureSize, n as CameraBlitCaptureConfig, r as DEFAULT_BLIT_CONFIG, t as CameraBlitCapture } from "./camera-blit-capture-
|
|
2
|
-
import { a as createCaptureFailureTracker, i as DEFAULT_CAPTURE_TRACKER_CONFIG, n as CaptureFailureTracker, r as CaptureFailureTrackerConfig, t as CAPTURE_FAILURE_WARNING } from "./capture-failure-tracker-
|
|
3
|
-
import { n as applyChromiumProjectionLayerWorkaround, t as ChromiumProjectionLayerWorkaroundResult } from "./chromium-camera-access-workaround-
|
|
4
|
-
import { a as WebXRQuaternion, i as DepthSample, n as ArPoseTuples, o as WebXRVec3, r as DepthPoint, t as ARPose } from "./ar-types-
|
|
5
|
-
import { i as DepthSamplerConfig, n as DepthSampler, r as DepthSamplerCallbacks, t as DepthInfo } from "./depth-sampler-
|
|
6
|
-
import {
|
|
7
|
-
import { n as
|
|
8
|
-
import { n as
|
|
9
|
-
import { n as
|
|
10
|
-
import {
|
|
11
|
-
import { t as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { i as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { a as
|
|
19
|
-
import { a as
|
|
20
|
-
import { a as
|
|
21
|
-
import { a as
|
|
22
|
-
import { n as
|
|
23
|
-
import { n as
|
|
24
|
-
import { n as
|
|
25
|
-
import { t as
|
|
26
|
-
import { t as
|
|
27
|
-
import { t as
|
|
28
|
-
import {
|
|
29
|
-
import { a as
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import { a as
|
|
33
|
-
import { a as
|
|
34
|
-
import { n as
|
|
35
|
-
import {
|
|
36
|
-
import { t as
|
|
37
|
-
import { n as
|
|
38
|
-
import {
|
|
39
|
-
import { t as
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import { n as
|
|
46
|
-
import {
|
|
47
|
-
import { n as
|
|
48
|
-
import {
|
|
49
|
-
import { n as
|
|
50
|
-
import { n as
|
|
51
|
-
import {
|
|
1
|
+
import { i as computeCaptureSize, n as CameraBlitCaptureConfig, r as DEFAULT_BLIT_CONFIG, t as CameraBlitCapture } from "./camera-blit-capture-C1V9I1Z6.js";
|
|
2
|
+
import { a as createCaptureFailureTracker, i as DEFAULT_CAPTURE_TRACKER_CONFIG, n as CaptureFailureTracker, r as CaptureFailureTrackerConfig, t as CAPTURE_FAILURE_WARNING } from "./capture-failure-tracker-JKb1ST8E.js";
|
|
3
|
+
import { n as applyChromiumProjectionLayerWorkaround, t as ChromiumProjectionLayerWorkaroundResult } from "./chromium-camera-access-workaround-NvChXsi8.js";
|
|
4
|
+
import { a as WebXRQuaternion, i as DepthSample, n as ArPoseTuples, o as WebXRVec3, r as DepthPoint, t as ARPose } from "./ar-types-Ck8LEq8k.js";
|
|
5
|
+
import { i as DepthSamplerConfig, n as DepthSampler, r as DepthSamplerCallbacks, t as DepthInfo } from "./depth-sampler-xg8vna6c.js";
|
|
6
|
+
import { r as registerFrameUpdate, t as FrameUpdate } from "./frame-loop-QJIxLin0.js";
|
|
7
|
+
import { a as ImageCaptureManager, i as ImageCaptureConfig, n as DEFAULT_CAPTURE_CONFIG, o as MIN_VALID_IMAGE_BYTES, r as ImageCaptureCallbacks, t as CapturedImage } from "./image-capture-DZLxHDN9.js";
|
|
8
|
+
import { n as createCameraFollower, t as CameraFollower } from "./camera-follower-1k8mnw5J.js";
|
|
9
|
+
import { n as createAlignmentLerper, t as AlignmentLerper } from "./alignment-lerper-L1RbWHQ4.js";
|
|
10
|
+
import { n as createCss3dRendererManager, t as Css3dRendererManager } from "./css3d-renderer-manager-CkjCb2HW.js";
|
|
11
|
+
import { a as getCameraFollower, c as getReplayState, d as updateOrbitTarget, i as getAlignmentLerper, l as initReplayScene, n as ReplaySceneState, o as getCameraMode, r as disposeReplayScene, t as CameraMode, u as toggleCameraMode } from "./replay-scene-DpAGcAKY.js";
|
|
12
|
+
import { t as SCENE_NODE } from "./scene-node-names-6LBjPmwz.js";
|
|
13
|
+
import { a as TrackingSliceState, c as poseLost, d as selectLastRestartedPayload, f as selectLastSensorOrientation, g as trackingReducer, h as selectTrackingPhase, i as TrackingPhase, l as poseReceived, m as selectLostFrameCount, n as PoseReceivedPayload, o as clearLastRestartedPayload, p as selectLastValidPose, s as originReset, u as resetTracking } from "./tracking-slice-utCNND8t.js";
|
|
14
|
+
import { _ as validateRecordingOptions, a as IMAGE_CONSTRAINTS, c as RecordingOptionsInput, d as loadRecordingOptions, f as resetRecordingOptions, g as validateImageOptions, h as validateDepthOptions, i as DepthCaptureOptions, l as STORAGE_KEY, n as DEFAULT_RECORDING_OPTIONS, o as ImageCaptureOptions, p as saveRecordingOptions, r as DEPTH_CONSTRAINTS, u as cloneRecordingOptions } from "./recording-options-Dq6IsKAv.js";
|
|
15
|
+
import { i as acquireCameraTexture, n as RendererLike, r as XRCameraLike, t as CameraTextureResult } from "./xr-camera-texture-BU5YvKAM.js";
|
|
16
|
+
import { A as setTrackingCallbacks, D as setFrameCallback, E as setDepthCaptureCallback, F as startDepthCapture, I as startImageCapture, L as stopDepthCapture, N as setTrackingStore, O as setImageCaptureCallback, R as stopImageCapture, _ as initAR, a as endARSession, f as getDepthSampleCount, j as setTrackingLostCallback, m as getLiveCss3dManager, p as getImageCaptureFrameCount } from "./webxr-session-DB5cIZnN.js";
|
|
17
|
+
import { n as XR_ERROR_MESSAGE_UNKNOWN, r as getXrErrorMessage, t as XR_ERROR_MESSAGES } from "./xr-error-handler-CDY5QxGb.js";
|
|
18
|
+
import { a as gpsToH3, i as findNearbyGeoAnchor, n as KnownGeoAnchor, o as h3CellsMatch, r as approxDistanceMetres, s as isH3Index, t as H3_RESOLUTION } from "./h3-proximity-BhfgNbdW.js";
|
|
19
|
+
import { a as startOrientationWatch, i as startGpsWatch, n as RawDeviceOrientation, o as stopGpsWatch, r as requestOrientationPermission, s as stopOrientationWatch, t as GpsPosition } from "./gps-DXoQb9Kf.js";
|
|
20
|
+
import { a as getGpsErrorMessage, i as createGpsErrorHandler, n as GPS_ERROR_MESSAGES, r as GPS_ERROR_MESSAGE_UNKNOWN, t as GPS_ERROR_CODES } from "./gps-error-handler-Dg3ziRVY.js";
|
|
21
|
+
import { a as checkCameraPermission, c as checkOrientationPermission, d as requestCameraPermission, f as requestGeolocationPermission, g as setFileSystemState, h as resetFileSystemState, i as checkAllPermissions, l as checkWebXRSupport, m as requestWebXRWithDepthPermission, n as PermissionStatus, o as checkFileSystemPermission, p as requestOrientationPermission$1, s as checkGeolocationPermission, t as PermissionCheckResult, u as requestAllPermissions } from "./permission-checker-DPJl_RU6.js";
|
|
22
|
+
import { a as createLogger, c as setGlobalLogLevel, i as clearLogBuffer, l as subscribeToLogs, n as LogLevel, o as getGlobalLogLevel, r as Logger, s as getLogBuffer, t as LogEntry } from "./logger-C9vugiQb.js";
|
|
23
|
+
import { n as RawGpsSample, r as RefPointMarker, t as GpsCoord } from "./geo-types-CTuF23gG.js";
|
|
24
|
+
import { n as computeFusedPath, r as fusedGpsFromOdom, t as FusedPathInput } from "./fused-path-CB4DwWOG.js";
|
|
25
|
+
import { n as FailureTrackerConfig, r as createFailureTracker, t as FailureTracker } from "./failure-tracker-DnHXOIRa.js";
|
|
26
|
+
import { t as mapWithConcurrencyLimit } from "./concurrency-CMw8pSaG.js";
|
|
27
|
+
import { t as formatFileSize } from "./format-file-size-BTS5H62-.js";
|
|
28
|
+
import { t as listFormatter } from "./list-formatter-CNqi-E2j.js";
|
|
29
|
+
import { a as recordWriteFailure, i as recordDepthSample, o as recordingReducer, r as endSession, s as startSession, t as RecordingState } from "./recording-slice-d6OtCrza.js";
|
|
30
|
+
import { a as getAppRootHandle, c as initOpfsStorage, d as resetSessionHandles, i as createSession, l as listSessions, o as getSessionHandle, r as checkStorageQuota, s as getSessionsRootHandle, u as resetOpfsStorage } from "./opfs-storage-DOPkzgeT.js";
|
|
31
|
+
import { n as StorageBackend, t as CreateSessionResult } from "./storage-backend-CT0Il_AB.js";
|
|
32
|
+
import { A as resetTrackingQuality, C as computeResidualConsensus, D as firstAgreementReached, F as snapshotsTrimmed, I as trackingQualityReducer, M as selectRecentAlignments, N as selectTrackingQuality, O as matrixDelta, P as snapshotPushed, S as computeGpsVsFusedDivergence, T as createTrackingQualityListenerMiddleware, _ as TrackingQualityState, a as SlamAppStoreOptions, b as computeCoverage, d as DEFAULT_TRACKING_QUALITY_OPTIONS, g as TrackingQualitySliceState, h as TrackingQualityReport, i as SlamAppStore, j as selectFirstAgreementObservationIndex, k as reportUpdated, m as TrackingQualityOptions, n as SlamAppMiddleware, o as createSlamAppStore, r as SlamAppRootState, s as AlignmentSnapshot, t as SlamAppCombinedState, v as computeCompassAgreement, w as computeTrackingQualityReport, x as computeGpsAccuracy, y as computeConvergence } from "./create-slam-app-store-CNsZ3rcX.js";
|
|
33
|
+
import { a as eulerToQuaternion, c as getLastDeviceOrientation, i as createGpsPositionHandler, l as resetCoordinatorState, n as buildRawGpsPoint, o as extractOdomPosition, r as buildRecordGpsEventPayload, s as extractOdomRotation, t as RecordingCoordinatorConfig, u as updateDeviceOrientation } from "./gps-event-coordinator-DBx9I1YX.js";
|
|
34
|
+
import { a as ZipActionEntry, d as loadSessionMetadataFromBlob, f as readZipEntries, i as RecordedAction, l as loadGpsPathFromBlob, n as GpsPathCoord, r as MAX_ACTION_FILE_SIZE, s as loadActionsFromZip } from "./zip-reader-D1105idz.js";
|
|
35
|
+
import { n as replayRecording } from "./recording-replayer-CmCIIZ02.js";
|
|
36
|
+
import { a as ReplayAction, c as computeInterActionDelay, i as ProgressCallback, l as extractActionTimestamp, n as DEFAULT_MAX_DELAY_MS, o as ReplayEngine, r as ErrorCallback, s as ReplayState, t as CompleteCallback } from "./replay-engine-BGBRQyXs.js";
|
|
37
|
+
import { n as MapDataInput, r as buildMapData, t as MapData } from "./map-data-sih4g64v.js";
|
|
38
|
+
import { t as SubscribableStore } from "./subscribe-to-selector-DIHm3BRZ.js";
|
|
39
|
+
import { n as wireStoreSubscribers, t as StoreSubscriberDeps } from "./store-subscribers-Dce_CoJF.js";
|
|
40
|
+
import { add2dImage, calcRelativeCoordsInMeters, recordGpsEvent, setZeroPos } from "./state/index.js";
|
|
41
|
+
import { t as NullStorageBackend } from "./null-storage-backend-BKOS7JpL.js";
|
|
42
|
+
import { t as OpfsStorageBackend } from "./opfs-storage-backend-Cj_7PWoq.js";
|
|
43
|
+
import { c as resetForNewSession, d as startSession$1, f as verifyWriteAccess, l as resetStorageState, m as writeFrame, n as WriteAccessResult, o as initStorage, p as writeAction } from "./file-system-DTApEv_Q.js";
|
|
44
|
+
import { n as formatFrameFilename, r as formatTimestamp, t as formatActionFilename } from "./file-system-utils-CtKiiw27.js";
|
|
45
|
+
import { a as downloadZip, c as syncToExternalZip, i as ZipExportResult, n as ZipContributorAddFile, o as exportAndDownloadSession, r as ZipExportContributor, s as exportSessionAsZip, t as ExportSessionAsZipOptions } from "./zip-export-QO4iLIi7.js";
|
|
46
|
+
import { i as createGpsCompassCubes, n as COMPASS_CUBE_SIZE, r as GpsCompassCubes, t as COMPASS_CUBE_DISTANCE } from "./gps-compass-cubes-CsLtFv4B.js";
|
|
47
|
+
import { i as isSphereInCameraFrustum, n as isObjectInCameraFrustum, r as isPointInCameraFrustum, t as buildCameraFrustum } from "./frustum-visibility-BHnFrSKQ.js";
|
|
48
|
+
import { t as nueToArLocal } from "./index-pOjUCKEP.js";
|
|
49
|
+
import { a as GpsAnchorSamplePoint, i as GpsAnchorPhase, n as GpsAnchorMode, o as createGpsAnchor, r as GpsAnchorOptions, t as GpsAnchor } from "./gps-anchor-CnWY61XK.js";
|
|
50
|
+
import { n as GpsEventVisualizer, r as gpsEventVisualizer } from "./gps-event-markers-BGr-iLvi.js";
|
|
51
|
+
import { a as DEFAULT_Z_OFFSET, n as DEFAULT_LEAFLET_MAP_SIZE_PX, o as LeafletMapOverlay, r as DEFAULT_WORLD_SIZE, s as LeafletMapOverlayOptions } from "./leaflet-map-overlay-Cew7XAoO.js";
|
|
52
|
+
import { n as clampedAlpha, t as DEFAULT_LERP_RATE } from "./lerp-utils-B8MM8zCR.js";
|
|
53
|
+
import { a as addAccuracyCircles, i as AccuracyCircleSample, n as ACCURACY_CIRCLE_STROKE_OPACITY, r as ACCURACY_CIRCLE_WEIGHT, t as ACCURACY_CIRCLE_FILL_OPACITY } from "./accuracy-circles-CsxE_7x1.js";
|
|
54
|
+
import { a as MAP_PATH_POLYLINE_OPACITY, c as USER_POSITION_COLOR, i as FUSED_PATH_COLOR, l as drawMapData, n as DrawMapDataOptions, o as MAP_PATH_POLYLINE_WEIGHT, r as DrawnMapData, s as RAW_GPS_COLOR, t as ALIGNMENT_SNAPSHOT_COLOR } from "./map-overlay-draw-B3R1c9Xp.js";
|
|
55
|
+
import { a as MapOverlayOptions, c as tileXYToLatLon, i as MapOverlay, n as DEFAULT_MAP_SIZE, o as TextureLoaderInterface, r as DEFAULT_ZOOM, s as latLonToTileXY, t as DEFAULT_HEIGHT_OFFSET } from "./map-overlay-DAmreyA3.js";
|
|
56
|
+
import { n as disposeMeshArray, r as disposeObject3D, t as DisposeOptions } from "./three-dispose-C2drkp6f.js";
|
|
57
|
+
import { t as VIS_COLORS } from "./vis-colors-CHQhjal3.js";
|
|
52
58
|
import { COMMUNITY_LICENSE_KEY } from "./licensing/index.js";
|
|
53
|
-
export { ARPose, AlignmentLerper, ArPoseTuples, CAPTURE_FAILURE_WARNING, COMMUNITY_LICENSE_KEY, COMPASS_CUBE_DISTANCE, COMPASS_CUBE_SIZE, CameraBlitCapture, CameraBlitCaptureConfig, CameraFollower, CameraMode, CameraTextureResult, CaptureFailureTracker, CaptureFailureTrackerConfig, CapturedImage, ChromiumProjectionLayerWorkaroundResult, type CompleteCallback, type CreateSessionResult, Css3dRendererManager, DEFAULT_BLIT_CONFIG, DEFAULT_CAPTURE_CONFIG, DEFAULT_CAPTURE_TRACKER_CONFIG, DEFAULT_HEIGHT_OFFSET, DEFAULT_LEAFLET_MAP_SIZE_PX, DEFAULT_LERP_RATE, DEFAULT_MAP_SIZE, DEFAULT_MAX_DELAY_MS, DEFAULT_RECORDING_OPTIONS, DEFAULT_WORLD_SIZE, DEFAULT_ZOOM, DEFAULT_Z_OFFSET, DEPTH_CONSTRAINTS, type DepthCaptureOptions, DepthInfo, DepthPoint, DepthSample, DepthSampler, DepthSamplerCallbacks, DepthSamplerConfig,
|
|
59
|
+
export { ACCURACY_CIRCLE_FILL_OPACITY, ACCURACY_CIRCLE_STROKE_OPACITY, ACCURACY_CIRCLE_WEIGHT, ALIGNMENT_SNAPSHOT_COLOR, ARPose, AccuracyCircleSample, AlignmentLerper, type AlignmentSnapshot, ArPoseTuples, CAPTURE_FAILURE_WARNING, COMMUNITY_LICENSE_KEY, COMPASS_CUBE_DISTANCE, COMPASS_CUBE_SIZE, CameraBlitCapture, CameraBlitCaptureConfig, CameraFollower, CameraMode, CameraTextureResult, CaptureFailureTracker, CaptureFailureTrackerConfig, CapturedImage, ChromiumProjectionLayerWorkaroundResult, type CompleteCallback, type CreateSessionResult, Css3dRendererManager, DEFAULT_BLIT_CONFIG, DEFAULT_CAPTURE_CONFIG, DEFAULT_CAPTURE_TRACKER_CONFIG, DEFAULT_HEIGHT_OFFSET, DEFAULT_LEAFLET_MAP_SIZE_PX, DEFAULT_LERP_RATE, DEFAULT_MAP_SIZE, DEFAULT_MAX_DELAY_MS, DEFAULT_RECORDING_OPTIONS, DEFAULT_TRACKING_QUALITY_OPTIONS, DEFAULT_WORLD_SIZE, DEFAULT_ZOOM, DEFAULT_Z_OFFSET, DEPTH_CONSTRAINTS, type DepthCaptureOptions, DepthInfo, DepthPoint, DepthSample, DepthSampler, DepthSamplerCallbacks, DepthSamplerConfig, DisposeOptions, DrawMapDataOptions, DrawnMapData, type ErrorCallback, type ExportSessionAsZipOptions, FUSED_PATH_COLOR, FailureTracker, FailureTrackerConfig, FrameUpdate, FusedPathInput, GPS_ERROR_CODES, GPS_ERROR_MESSAGES, GPS_ERROR_MESSAGE_UNKNOWN, GpsAnchor, GpsAnchorMode, GpsAnchorOptions, GpsAnchorPhase, GpsAnchorSamplePoint, GpsCompassCubes, GpsCoord, GpsEventVisualizer, type GpsPathCoord, GpsPosition, H3_RESOLUTION, IMAGE_CONSTRAINTS, ImageCaptureCallbacks, ImageCaptureConfig, ImageCaptureManager, type ImageCaptureOptions, KnownGeoAnchor, LeafletMapOverlay, LeafletMapOverlayOptions, LogEntry, LogLevel, Logger, MAP_PATH_POLYLINE_OPACITY, MAP_PATH_POLYLINE_WEIGHT, MAX_ACTION_FILE_SIZE, MIN_VALID_IMAGE_BYTES, MapData, MapDataInput, MapOverlay, MapOverlayOptions, NullStorageBackend, OpfsStorageBackend, PermissionCheckResult, PermissionStatus, type PoseReceivedPayload, type ProgressCallback, RAW_GPS_COLOR, RawDeviceOrientation, RawGpsSample, type RecordedAction, type RecordingCoordinatorConfig, type RecordingOptionsInput, type RecordingState, RefPointMarker, RendererLike, type ReplayAction, ReplayEngine, ReplaySceneState, type ReplayState, SCENE_NODE, STORAGE_KEY, type SlamAppCombinedState, type SlamAppMiddleware, type SlamAppRootState, type SlamAppStore, type SlamAppStoreOptions, type StorageBackend, type StoreSubscriberDeps, type SubscribableStore, TextureLoaderInterface, type TrackingPhase, type TrackingQualityOptions, type TrackingQualityReport, type TrackingQualitySliceState, type TrackingQualityState, type TrackingSliceState, USER_POSITION_COLOR, VIS_COLORS, WebXRQuaternion, WebXRVec3, type WriteAccessResult, XRCameraLike, XR_ERROR_MESSAGES, XR_ERROR_MESSAGE_UNKNOWN, type ZipActionEntry, type ZipContributorAddFile, type ZipExportContributor, type ZipExportResult, acquireCameraTexture, add2dImage, addAccuracyCircles, applyChromiumProjectionLayerWorkaround, approxDistanceMetres, buildCameraFrustum, buildMapData, buildRawGpsPoint, buildRecordGpsEventPayload, calcRelativeCoordsInMeters, checkAllPermissions, checkCameraPermission, checkFileSystemPermission, checkGeolocationPermission, checkOrientationPermission, checkStorageQuota, checkWebXRSupport, clampedAlpha, clearLastRestartedPayload, clearLogBuffer, cloneRecordingOptions, computeCaptureSize, computeCompassAgreement, computeConvergence, computeCoverage, computeFusedPath, computeGpsAccuracy, computeGpsVsFusedDivergence, computeInterActionDelay, computeResidualConsensus, computeTrackingQualityReport, createAlignmentLerper, createCameraFollower, createCaptureFailureTracker, createCss3dRendererManager, createFailureTracker, createGpsAnchor, createGpsCompassCubes, createGpsErrorHandler, createGpsPositionHandler, createLogger, createSession, createSlamAppStore, createTrackingQualityListenerMiddleware, disposeMeshArray, disposeObject3D, disposeReplayScene, downloadZip, drawMapData, endARSession, endSession, eulerToQuaternion, exportAndDownloadSession, exportSessionAsZip, extractActionTimestamp, extractOdomPosition, extractOdomRotation, findNearbyGeoAnchor, firstAgreementReached, formatActionFilename, formatFileSize, formatFrameFilename, formatTimestamp, fusedGpsFromOdom, getAlignmentLerper, getAppRootHandle, getCameraFollower, getCameraMode, getDepthSampleCount, getGlobalLogLevel, getGpsErrorMessage, getImageCaptureFrameCount, getLastDeviceOrientation, getLiveCss3dManager, getLogBuffer, getReplayState, getSessionHandle, getSessionsRootHandle, getXrErrorMessage, gpsEventVisualizer, gpsToH3, h3CellsMatch, initAR, initOpfsStorage, initReplayScene, initStorage, isH3Index, isObjectInCameraFrustum, isPointInCameraFrustum, isSphereInCameraFrustum, latLonToTileXY, listFormatter, listSessions, loadActionsFromZip, loadGpsPathFromBlob, loadRecordingOptions, loadSessionMetadataFromBlob, mapWithConcurrencyLimit, matrixDelta, nueToArLocal, originReset, poseLost, poseReceived, readZipEntries, recordDepthSample, recordGpsEvent, recordWriteFailure, recordingReducer, registerFrameUpdate, replayRecording, reportUpdated, requestAllPermissions, requestCameraPermission, requestOrientationPermission as requestDeviceOrientationPermission, requestGeolocationPermission, requestOrientationPermission$1 as requestOrientationPermission, requestWebXRWithDepthPermission, resetCoordinatorState, resetFileSystemState, resetForNewSession, resetOpfsStorage, resetRecordingOptions, resetSessionHandles, resetStorageState, resetTracking, resetTrackingQuality, saveRecordingOptions, selectFirstAgreementObservationIndex, selectLastRestartedPayload, selectLastSensorOrientation, selectLastValidPose, selectLostFrameCount, selectRecentAlignments, selectTrackingPhase, selectTrackingQuality, setDepthCaptureCallback, setFileSystemState, setFrameCallback, setGlobalLogLevel, setImageCaptureCallback, setTrackingCallbacks, setTrackingLostCallback, setTrackingStore, setZeroPos, snapshotPushed, snapshotsTrimmed, startDepthCapture, startGpsWatch, startImageCapture, startOrientationWatch, startSession, startSession$1 as startStorageSession, stopDepthCapture, stopGpsWatch, stopImageCapture, stopOrientationWatch, subscribeToLogs, syncToExternalZip, tileXYToLatLon, toggleCameraMode, trackingQualityReducer, trackingReducer, updateDeviceOrientation, updateOrbitTarget, validateDepthOptions, validateImageOptions, validateRecordingOptions, verifyWriteAccess, wireStoreSubscribers, writeAction, writeFrame };
|