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.
Files changed (174) hide show
  1. package/LICENSE +4 -4
  2. package/README.md +249 -108
  3. package/dist/accuracy-circles-CsxE_7x1.d.ts +43 -0
  4. package/dist/{app-selectors-CHt7DLuq.d.ts → app-selectors-BeU0_ab8.d.ts} +8 -10
  5. package/dist/ar/camera-blit-capture.d.ts +1 -1
  6. package/dist/ar/capture-failure-tracker.d.ts +1 -1
  7. package/dist/ar/chromium-camera-access-workaround.d.ts +1 -1
  8. package/dist/ar/depth-sampler.d.ts +2 -2
  9. package/dist/ar/frame-loop.d.ts +2 -0
  10. package/dist/ar/frame-loop.js +40 -0
  11. package/dist/ar/image-capture.d.ts +1 -1
  12. package/dist/ar/image-capture.js +1 -1
  13. package/dist/ar/index.d.ts +12 -12
  14. package/dist/ar/index.js +3 -3
  15. package/dist/ar/replay-scene.d.ts +1 -1
  16. package/dist/ar/scene-node-names.d.ts +1 -1
  17. package/dist/ar/webxr-session.d.ts +4 -4
  18. package/dist/ar/webxr-session.js +150 -55
  19. package/dist/ar/xr-camera-texture.d.ts +1 -1
  20. package/dist/ar/xr-error-handler.d.ts +1 -1
  21. package/dist/core/index.d.ts +2 -2
  22. package/dist/core/index.js +2 -2
  23. package/dist/create-slam-app-store-CNsZ3rcX.d.ts +371 -0
  24. package/dist/{depth-sampler-BNCtnEoP.d.ts → depth-sampler-xg8vna6c.d.ts} +1 -1
  25. package/dist/{file-system-DD5TczSO.d.ts → file-system-DTApEv_Q.d.ts} +32 -2
  26. package/dist/frame-loop-QJIxLin0.d.ts +42 -0
  27. package/dist/frustum-visibility-BHnFrSKQ.d.ts +58 -0
  28. package/dist/{fused-path-DtqCSqJh.d.ts → fused-path-CB4DwWOG.d.ts} +1 -1
  29. package/dist/geo/h3-proximity.d.ts +1 -1
  30. package/dist/geo/index.d.ts +1 -1
  31. package/dist/{geo-types-Xx-LVcnw.d.ts → geo-types-CTuF23gG.d.ts} +16 -1
  32. package/dist/{gps-GKc6_Cly.d.ts → gps-DXoQb9Kf.d.ts} +1 -1
  33. package/dist/gps-anchor-CnWY61XK.d.ts +48 -0
  34. package/dist/gps-anchor-DjC_3MoT.js +257 -0
  35. package/dist/{gps-ar-pose-sampler-D_Zso40V.d.ts → gps-ar-pose-sampler-DsM1Kb2N.d.ts} +1 -1
  36. package/dist/{gps-event-coordinator-fwvmVfku.d.ts → gps-event-coordinator-DBx9I1YX.d.ts} +3 -3
  37. package/dist/gps-event-markers-BGr-iLvi.d.ts +103 -0
  38. package/dist/{image-capture-2pKjYUS6.d.ts → image-capture-DZLxHDN9.d.ts} +1 -1
  39. package/dist/index-gzWJMVpo.d.ts +2 -0
  40. package/dist/index-pOjUCKEP.d.ts +24 -0
  41. package/dist/index.d.ts +58 -52
  42. package/dist/index.js +11 -5
  43. package/dist/{leaflet-map-overlay-CQZcnxbc.d.ts → leaflet-map-overlay-Cew7XAoO.d.ts} +22 -11
  44. package/dist/{logger-B81iwxx0.d.ts → logger-C9vugiQb.d.ts} +7 -1
  45. package/dist/map-data-sih4g64v.d.ts +49 -0
  46. package/dist/map-overlay-draw-B3R1c9Xp.d.ts +42 -0
  47. package/dist/{null-storage-backend-C0TiwwzQ.d.ts → null-storage-backend-BKOS7JpL.d.ts} +2 -2
  48. package/dist/{opfs-storage-backend-Gt3rd76D.d.ts → opfs-storage-backend-Cj_7PWoq.d.ts} +2 -2
  49. package/dist/{permission-checker-Cu3nbH1S.d.ts → permission-checker-DPJl_RU6.d.ts} +41 -1
  50. package/dist/persistence-middleware-BkHIqvaA.d.ts +55 -0
  51. package/dist/{recording-replayer-BFhFs7Mc.d.ts → recording-replayer-CmCIIZ02.d.ts} +2 -2
  52. package/dist/{recording-slice-BiktUIWF.d.ts → recording-slice-d6OtCrza.d.ts} +2 -2
  53. package/dist/{replay-engine-B88Va62x.d.ts → replay-engine-BGBRQyXs.d.ts} +1 -1
  54. package/dist/{replay-scene-DtUm6bsr.d.ts → replay-scene-DpAGcAKY.d.ts} +3 -3
  55. package/dist/sensors/gps-error-handler.d.ts +1 -1
  56. package/dist/sensors/gps.d.ts +1 -1
  57. package/dist/sensors/gps.js +2 -2
  58. package/dist/sensors/index.d.ts +3 -3
  59. package/dist/sensors/permission-checker.d.ts +2 -2
  60. package/dist/sensors/permission-checker.js +79 -1
  61. package/dist/state/app-selectors.d.ts +2 -2
  62. package/dist/state/app-selectors.js +33 -3
  63. package/dist/state/combined-root-state.d.ts +2 -0
  64. package/dist/state/combined-root-state.js +1 -0
  65. package/dist/state/create-slam-app-store.d.ts +1 -1
  66. package/dist/state/create-slam-app-store.js +27 -13
  67. package/dist/state/gps-ar-pose-sampler.d.ts +3 -3
  68. package/dist/state/gps-event-coordinator.d.ts +1 -1
  69. package/dist/state/index.d.ts +17 -16
  70. package/dist/state/index.js +6 -4
  71. package/dist/state/persistence-middleware.d.ts +2 -2
  72. package/dist/state/persistence-middleware.js +35 -7
  73. package/dist/state/recording-options.d.ts +1 -1
  74. package/dist/state/recording-replayer.d.ts +2 -2
  75. package/dist/state/recording-slice.d.ts +1 -1
  76. package/dist/state/replay-engine.d.ts +1 -1
  77. package/dist/state/store-subscribers.d.ts +2 -2
  78. package/dist/state/store-subscribers.js +38 -12
  79. package/dist/state/subscribe-to-selector.d.ts +1 -1
  80. package/dist/state/tracking-quality.d.ts +2 -0
  81. package/dist/state/tracking-quality.js +723 -0
  82. package/dist/state/tracking-slice.d.ts +2 -0
  83. package/dist/state/tracking-slice.js +147 -0
  84. package/dist/storage/file-system-utils.d.ts +1 -1
  85. package/dist/storage/file-system.d.ts +2 -2
  86. package/dist/storage/file-system.js +52 -1
  87. package/dist/storage/index.d.ts +8 -8
  88. package/dist/storage/null-storage-backend.d.ts +1 -1
  89. package/dist/storage/opfs-storage-backend.d.ts +1 -1
  90. package/dist/storage/opfs-storage.d.ts +1 -1
  91. package/dist/storage/storage-backend.d.ts +1 -1
  92. package/dist/storage/zip-export.d.ts +1 -1
  93. package/dist/storage/zip-reader.d.ts +1 -1
  94. package/dist/storage/zip-reader.js +8 -4
  95. package/dist/{storage-backend-yVnuWGTr.d.ts → storage-backend-CT0Il_AB.d.ts} +1 -1
  96. package/dist/{store-subscribers-DKKHld49.d.ts → store-subscribers-Dce_CoJF.d.ts} +31 -6
  97. package/dist/{subscribe-to-selector-ghDKYtap.d.ts → subscribe-to-selector-DIHm3BRZ.d.ts} +1 -1
  98. package/dist/test-utils/browser-mocks.d.ts +1 -1
  99. package/dist/test-utils/zip-round-trip-helpers.d.ts +7 -1
  100. package/dist/test-utils/zip-round-trip-helpers.js +2 -1
  101. package/dist/tracking-slice-utCNND8t.d.ts +86 -0
  102. package/dist/types/ar-types.d.ts +1 -1
  103. package/dist/types/geo-types.d.ts +2 -2
  104. package/dist/types/index.d.ts +3 -3
  105. package/dist/utils/concurrency.d.ts +1 -1
  106. package/dist/utils/failure-tracker.d.ts +1 -1
  107. package/dist/utils/format-file-size.d.ts +1 -1
  108. package/dist/utils/fused-path.d.ts +1 -1
  109. package/dist/utils/index.d.ts +6 -6
  110. package/dist/utils/list-formatter.d.ts +1 -1
  111. package/dist/utils/logger.d.ts +1 -1
  112. package/dist/utils/logger.js +68 -8
  113. package/dist/visualization/accuracy-circles.d.ts +2 -0
  114. package/dist/visualization/accuracy-circles.js +57 -0
  115. package/dist/visualization/alignment-lerper.d.ts +1 -1
  116. package/dist/visualization/camera-follower.d.ts +1 -1
  117. package/dist/visualization/css3d-renderer-manager.d.ts +1 -1
  118. package/dist/visualization/frustum-visibility.d.ts +2 -0
  119. package/dist/visualization/frustum-visibility.js +139 -0
  120. package/dist/visualization/gps-anchor.d.ts +2 -0
  121. package/dist/visualization/gps-anchor.js +2 -0
  122. package/dist/visualization/gps-compass-cubes.d.ts +1 -1
  123. package/dist/visualization/gps-event-markers.d.ts +2 -2
  124. package/dist/visualization/gps-event-markers.js +69 -2
  125. package/dist/visualization/index.d.ts +17 -12
  126. package/dist/visualization/index.js +6 -2
  127. package/dist/visualization/leaflet-map-overlay.d.ts +1 -1
  128. package/dist/visualization/leaflet-map-overlay.js +33 -79
  129. package/dist/visualization/lerp-utils.d.ts +1 -1
  130. package/dist/visualization/map-data.d.ts +2 -0
  131. package/dist/visualization/map-data.js +33 -0
  132. package/dist/visualization/map-overlay-draw.d.ts +2 -0
  133. package/dist/visualization/map-overlay-draw.js +107 -0
  134. package/dist/visualization/map-overlay.d.ts +1 -1
  135. package/dist/visualization/three-dispose.d.ts +1 -1
  136. package/dist/visualization/vis-colors.d.ts +1 -1
  137. package/dist/{webxr-session-COlSrXdL.d.ts → webxr-session-DB5cIZnN.d.ts} +53 -12
  138. package/dist/{zip-reader-KgJEXbca.d.ts → zip-reader-D1105idz.d.ts} +5 -0
  139. package/package.json +16 -16
  140. package/dist/ar/tracking-state.d.ts +0 -2
  141. package/dist/ar/tracking-state.js +0 -164
  142. package/dist/combined-root-state-B3SvPNjU.d.ts +0 -6
  143. package/dist/create-slam-app-store-DBm7g2Zd.d.ts +0 -85
  144. package/dist/gps-anchored-mesh-manager-CovAFK4g.d.ts +0 -56
  145. package/dist/gps-event-markers-sVyO9utS.d.ts +0 -67
  146. package/dist/persistence-middleware-z-75iisb.d.ts +0 -31
  147. package/dist/tracking-state-B9QfuZCg.d.ts +0 -101
  148. package/dist/visualization/gps-anchored-mesh-manager.d.ts +0 -2
  149. package/dist/visualization/gps-anchored-mesh-manager.js +0 -128
  150. /package/dist/{alignment-lerper-D9BeDwZX.d.ts → alignment-lerper-L1RbWHQ4.d.ts} +0 -0
  151. /package/dist/{ar-types-B-ORgk6Z.d.ts → ar-types-Ck8LEq8k.d.ts} +0 -0
  152. /package/dist/{camera-blit-capture-DHuyrrxr.d.ts → camera-blit-capture-C1V9I1Z6.d.ts} +0 -0
  153. /package/dist/{camera-follower-BMqPddxx.d.ts → camera-follower-1k8mnw5J.d.ts} +0 -0
  154. /package/dist/{capture-failure-tracker-2Q6oI2uQ.d.ts → capture-failure-tracker-JKb1ST8E.d.ts} +0 -0
  155. /package/dist/{chromium-camera-access-workaround-CU5zSKNr.d.ts → chromium-camera-access-workaround-NvChXsi8.d.ts} +0 -0
  156. /package/dist/{concurrency-p6gB30fT.d.ts → concurrency-CMw8pSaG.d.ts} +0 -0
  157. /package/dist/{css3d-renderer-manager-rgLMVAvd.d.ts → css3d-renderer-manager-CkjCb2HW.d.ts} +0 -0
  158. /package/dist/{failure-tracker-1sQ_Cgyw.d.ts → failure-tracker-DnHXOIRa.d.ts} +0 -0
  159. /package/dist/{file-system-utils-BH8FdyIu.d.ts → file-system-utils-CtKiiw27.d.ts} +0 -0
  160. /package/dist/{format-file-size-onGq0k1Q.d.ts → format-file-size-BTS5H62-.d.ts} +0 -0
  161. /package/dist/{gps-compass-cubes-jRIJMOuh.d.ts → gps-compass-cubes-CsLtFv4B.d.ts} +0 -0
  162. /package/dist/{gps-error-handler-CH1S528z.d.ts → gps-error-handler-Dg3ziRVY.d.ts} +0 -0
  163. /package/dist/{h3-proximity-GwesPTFT.d.ts → h3-proximity-BhfgNbdW.d.ts} +0 -0
  164. /package/dist/{lerp-utils-CZgQlrmu.d.ts → lerp-utils-B8MM8zCR.d.ts} +0 -0
  165. /package/dist/{list-formatter-DKQQVLcl.d.ts → list-formatter-CNqi-E2j.d.ts} +0 -0
  166. /package/dist/{map-overlay-C9ifl_4-.d.ts → map-overlay-DAmreyA3.d.ts} +0 -0
  167. /package/dist/{opfs-storage-Dlq1I_Gb.d.ts → opfs-storage-DOPkzgeT.d.ts} +0 -0
  168. /package/dist/{recording-options-BYUFX8iU.d.ts → recording-options-Dq6IsKAv.d.ts} +0 -0
  169. /package/dist/{scene-node-names-DPsaE2z3.d.ts → scene-node-names-6LBjPmwz.d.ts} +0 -0
  170. /package/dist/{three-dispose-qt_r5wR1.d.ts → three-dispose-C2drkp6f.d.ts} +0 -0
  171. /package/dist/{vis-colors-BKkdTIKb.d.ts → vis-colors-CHQhjal3.d.ts} +0 -0
  172. /package/dist/{xr-camera-texture-BbukNE79.d.ts → xr-camera-texture-BU5YvKAM.d.ts} +0 -0
  173. /package/dist/{xr-error-handler-DTHfmvrl.d.ts → xr-error-handler-CDY5QxGb.d.ts} +0 -0
  174. /package/dist/{zip-export-BjrQPv0X.d.ts → zip-export-QO4iLIi7.d.ts} +0 -0
@@ -1,164 +0,0 @@
1
- import { createLogger } from "../utils/logger.js";
2
- import { extractOdomPosition } from "../state/gps-event-coordinator.js";
3
- //#region ../src/ar/tracking-state.ts
4
- /**
5
- * Tracking State Manager
6
- *
7
- * Detects AR tracking loss and restart events, maintaining state
8
- * about the last valid odometry pose for alignment correction.
9
- *
10
- * ARCHITECTURE NOTE: See docs/architecture-ar-gps-pose-separation.md
11
- *
12
- * When WebXR tracking is lost and restarted, the odometry frame resets
13
- * to a new origin. To maintain GPS+AR alignment, we need to:
14
- * 1. Store the last valid pose before tracking was lost
15
- * 2. Detect when tracking resumes with a new pose
16
- * 3. Dispatch odometryTrackingRestarted with both poses for offset calculation
17
- */
18
- const log = createLogger("TrackingState");
19
- /**
20
- * Possible tracking states
21
- */
22
- let TrackingState = /* @__PURE__ */ function(TrackingState) {
23
- /** AR session started but no pose received yet */
24
- TrackingState["INITIALIZING"] = "initializing";
25
- /** Actively receiving valid poses */
26
- TrackingState["TRACKING"] = "tracking";
27
- /** Pose became unavailable (tracking lost) */
28
- TrackingState["LOST"] = "lost";
29
- return TrackingState;
30
- }({});
31
- /**
32
- * Manages AR tracking state and detects loss/restart events.
33
- */
34
- var TrackingStateManager = class {
35
- state = "initializing";
36
- lastValidPose = null;
37
- lastSensorOrientation = null;
38
- lostFrameCount = 0;
39
- originResetDuringLoss = false;
40
- resetTransform = void 0;
41
- callbacks;
42
- constructor(callbacks) {
43
- this.callbacks = callbacks;
44
- }
45
- /**
46
- * Get current tracking state.
47
- */
48
- getState() {
49
- return this.state;
50
- }
51
- /**
52
- * Get the last valid AR pose (before tracking was lost).
53
- */
54
- getLastValidPose() {
55
- return this.lastValidPose;
56
- }
57
- /**
58
- * Get count of consecutive frames without pose (during LOST state).
59
- */
60
- getLostFrameCount() {
61
- return this.lostFrameCount;
62
- }
63
- /**
64
- * Flag that an XRReferenceSpace reset event occurred during tracking loss.
65
- * Only meaningful while in LOST state — ignored otherwise.
66
- *
67
- * @param transform — Serialized XRReferenceSpaceEvent.transform (post-reset
68
- * origin in pre-reset coordinates). Pass `null` when the event's
69
- * transform property is null (runtime can't determine delta).
70
- * Omit entirely for backwards-compat with callers that don't have it.
71
- */
72
- markOriginReset(transform) {
73
- if (this.state === "lost") {
74
- this.originResetDuringLoss = true;
75
- this.resetTransform = transform;
76
- }
77
- }
78
- /**
79
- * Called when a valid pose is received from WebXR.
80
- */
81
- onPoseReceived(pose) {
82
- if (this.state === "lost") this.handleTrackingRestarted(pose);
83
- this.state = "tracking";
84
- this.lastValidPose = pose;
85
- this.lastSensorOrientation = this.callbacks.getDeviceOrientation();
86
- this.lostFrameCount = 0;
87
- }
88
- /**
89
- * Called when pose is null/unavailable from WebXR.
90
- */
91
- onPoseLost() {
92
- this.lostFrameCount++;
93
- if (this.state === "tracking") {
94
- this.state = "lost";
95
- this.callbacks.onTrackingLost();
96
- log.warn("AR tracking lost");
97
- }
98
- }
99
- /**
100
- * Reset the manager to initial state.
101
- * Call this when starting a new session.
102
- */
103
- reset() {
104
- this.state = "initializing";
105
- this.lastValidPose = null;
106
- this.lastSensorOrientation = null;
107
- this.lostFrameCount = 0;
108
- this.originResetDuringLoss = false;
109
- this.resetTransform = void 0;
110
- }
111
- /**
112
- * Handle the transition from LOST to TRACKING (restart detected).
113
- */
114
- handleTrackingRestarted(newPose) {
115
- const hadReset = this.originResetDuringLoss;
116
- const savedResetTransform = this.resetTransform;
117
- this.originResetDuringLoss = false;
118
- this.resetTransform = void 0;
119
- if (!hadReset) {
120
- log.info("AR tracking recovered (same coordinate frame)");
121
- this.callbacks.onTrackingRecovered?.();
122
- return;
123
- }
124
- if (!this.lastValidPose) {
125
- log.warn("Tracking restarted but no previous pose available");
126
- return;
127
- }
128
- const currentSensorOrientation = this.callbacks.getDeviceOrientation();
129
- const lastOrientation = this.lastSensorOrientation ?? currentSensorOrientation;
130
- const payload = {
131
- lastValidOdomPos: extractOdomPosition(this.lastValidPose),
132
- lastValidOdomRot: [
133
- this.lastValidPose.orientation.x,
134
- this.lastValidPose.orientation.y,
135
- this.lastValidPose.orientation.z,
136
- this.lastValidPose.orientation.w
137
- ],
138
- lastSensorOrientation: {
139
- alpha: lastOrientation.alpha,
140
- beta: lastOrientation.beta,
141
- gamma: lastOrientation.gamma,
142
- absolute: lastOrientation.absolute
143
- },
144
- newOdomRot: [
145
- newPose.orientation.x,
146
- newPose.orientation.y,
147
- newPose.orientation.z,
148
- newPose.orientation.w
149
- ],
150
- newSensorOrientation: {
151
- alpha: currentSensorOrientation.alpha,
152
- beta: currentSensorOrientation.beta,
153
- gamma: currentSensorOrientation.gamma,
154
- absolute: currentSensorOrientation.absolute
155
- },
156
- newOdomPos: extractOdomPosition(newPose),
157
- resetTransform: savedResetTransform
158
- };
159
- log.info("AR tracking restarted (origin reset), dispatching alignment correction");
160
- this.callbacks.onTrackingRestarted(payload);
161
- }
162
- };
163
- //#endregion
164
- export { TrackingState, TrackingStateManager };
@@ -1,6 +0,0 @@
1
- import { t as SlamAppCombinedState } from "./create-slam-app-store-DBm7g2Zd.js";
2
-
3
- //#region ../src/state/combined-root-state.d.ts
4
- type CombinedRootState = SlamAppCombinedState;
5
- //#endregion
6
- export { CombinedRootState as t };
@@ -1,85 +0,0 @@
1
- import { t as RecordingState } from "./recording-slice-BiktUIWF.js";
2
- import { n as SessionMetadata } from "./opfs-storage-Dlq1I_Gb.js";
3
- import { n as StorageBackend } from "./storage-backend-yVnuWGTr.js";
4
- import { RootState } from "gps-plus-slam-js";
5
- import { Middleware, Reducer, ReducersMapObject, configureStore } from "@reduxjs/toolkit";
6
-
7
- //#region ../src/state/create-slam-app-store.d.ts
8
- /**
9
- * Base shape produced by `createSlamAppStore` with no `extraReducers`.
10
- *
11
- * Library state (`gpsData` / `gpsElements` / `arElements`) plus the
12
- * framework recording slice (`recording`).
13
- */
14
- interface SlamAppRootState extends RootState {
15
- recording: RecordingState;
16
- }
17
- /** A bare-minimum middleware signature compatible with RTK's middleware list. */
18
- type SlamAppMiddleware = Middleware<any, any, any>;
19
- /**
20
- * Options for {@link createSlamAppStore}.
21
- */
22
- interface SlamAppStoreOptions<ExtraReducers extends ReducersMapObject = Record<string, never>> {
23
- /**
24
- * Persistence backend used to bridge Redux actions to durable storage.
25
- * Tests / replay paths should pass `NullStorageBackend`.
26
- */
27
- storageBackend: StorageBackend;
28
- /**
29
- * Caller-supplied reducers added alongside the framework's built-ins.
30
- * Use this seam to plug recorder slices (routing, refPoints, scenario)
31
- * or any app-specific state without forking the factory.
32
- */
33
- extraReducers?: ExtraReducers;
34
- /**
35
- * Caller-supplied middlewares appended after RTK defaults and the
36
- * persistence middleware.
37
- */
38
- extraMiddleware?: ReadonlyArray<SlamAppMiddleware>;
39
- /**
40
- * Invoked when the persistence middleware fails to durably write an action.
41
- */
42
- onWriteFailure?: (error: Error) => void;
43
- /**
44
- * Disables RTK's expensive dev-only middleware (Serializable / Immutable
45
- * checks). Default `true`; set `false` for high-throughput replay scenarios.
46
- */
47
- enableDevChecks?: boolean;
48
- /**
49
- * License key for the core library. Defaults to the bundled community key.
50
- * Apps with a paid license override here. Validation always runs and throws
51
- * on invalid / expired / empty keys.
52
- *
53
- * @see EULA.md §3 — License Key
54
- */
55
- licenseKey?: string;
56
- }
57
- /**
58
- * Combined root state: the framework's base state plus any caller-supplied
59
- * extras. Generic so consumers get exact typing for the slices they add.
60
- */
61
- type SlamAppCombinedState<ExtraReducers extends ReducersMapObject = Record<never, never>> = SlamAppRootState & { [K in keyof ExtraReducers]: ExtraReducers[K] extends Reducer<infer S> ? S : never };
62
- /**
63
- * The store object returned by {@link createSlamAppStore}.
64
- *
65
- * Wraps RTK's store and adds storage-delegation helpers so consumers can
66
- * issue frame / metadata writes without holding a separate handle to the
67
- * `StorageBackend`.
68
- */
69
- interface SlamAppStore<ExtraReducers extends ReducersMapObject = Record<string, never>> {
70
- getState: () => SlamAppCombinedState<ExtraReducers>;
71
- dispatch: ReturnType<typeof configureStore>['dispatch'];
72
- subscribe: (listener: () => void) => () => void;
73
- /** Persist a captured camera frame via the configured backend. */
74
- writeFrame: (blob: Blob, index: number) => Promise<void>;
75
- /** Persist session metadata (`session.json`) via the configured backend. */
76
- writeSessionMetadata: (metadata: SessionMetadata) => Promise<void>;
77
- }
78
- /**
79
- * Build a Redux store wired with library + recording slices, persistence
80
- * middleware, and any caller-supplied extras. See module docstring for the
81
- * design rationale.
82
- */
83
- declare function createSlamAppStore<ExtraReducers extends ReducersMapObject = Record<string, never>>(options: SlamAppStoreOptions<ExtraReducers>): SlamAppStore<ExtraReducers>;
84
- //#endregion
85
- export { SlamAppStoreOptions as a, SlamAppStore as i, SlamAppMiddleware as n, createSlamAppStore as o, SlamAppRootState as r, SlamAppCombinedState as t };
@@ -1,56 +0,0 @@
1
- import { LatLong } from "gps-plus-slam-js";
2
-
3
- //#region ../src/visualization/gps-anchored-mesh-manager.d.ts
4
- /**
5
- * Plain GPS-anchored item consumed by the manager. Callers project their
6
- * domain types (ref points, POIs, anchors, …) onto this shape.
7
- */
8
- interface GpsAnchoredItem {
9
- readonly id: string;
10
- readonly lat: number;
11
- readonly lon: number;
12
- readonly altitude?: number;
13
- }
14
- interface GpsAnchoredMeshManagerOptions {
15
- /** Hex color for the shared material (e.g. `0x00ff00`). */
16
- readonly color: number;
17
- /** Sphere radius in meters. Defaults to `0.1` (10 cm). */
18
- readonly radius?: number;
19
- /** Mesh `name` prefix. Mesh names become `${namePrefix}-${item.id}`. */
20
- readonly namePrefix: string;
21
- /** Logger label. Defaults to `'GpsAnchoredMeshManager'`. */
22
- readonly loggerLabel?: string;
23
- }
24
- /**
25
- * Manages a single colored mesh group anchored to GPS coordinates.
26
- * One instance == one color/group.
27
- */
28
- declare class GpsAnchoredMeshManager {
29
- private readonly color;
30
- private readonly radius;
31
- private readonly namePrefix;
32
- private readonly log;
33
- private meshes;
34
- private zeroRef;
35
- private geometry;
36
- private material;
37
- constructor(options: GpsAnchoredMeshManagerOptions);
38
- /** Set the GPS origin used to project items into local meters. */
39
- setZeroRef(zero: LatLong): void;
40
- getZeroRef(): LatLong | null;
41
- /**
42
- * Replace the entire mesh group with one mesh per provided item.
43
- * Items without GPS or before `setZeroRef` are skipped.
44
- */
45
- setItems(items: readonly GpsAnchoredItem[]): void;
46
- /** Append a single item to the existing mesh group. */
47
- addItem(item: GpsAnchoredItem): void;
48
- /** Remove all meshes and dispose the shared geometry/material. */
49
- clear(): void;
50
- /** Number of meshes currently rendered. */
51
- getCount(): number;
52
- /** Convenience: clear and forget the zero reference. */
53
- dispose(): void;
54
- }
55
- //#endregion
56
- export { GpsAnchoredMeshManager as n, GpsAnchoredMeshManagerOptions as r, GpsAnchoredItem as t };
@@ -1,67 +0,0 @@
1
- import { LatLong, Vector3 } from "gps-plus-slam-js";
2
-
3
- //#region ../src/visualization/gps-event-markers.d.ts
4
- /**
5
- * Manager for GPS event visualization
6
- */
7
- declare class GpsEventVisualizer {
8
- private rawGpsMarkers;
9
- private fusedMarkers;
10
- private snapshotMarkers;
11
- private zeroRef;
12
- private eventCounter;
13
- private snapshotCounter;
14
- /**
15
- * Set the GPS zero reference (origin for coordinate conversion).
16
- * Must be called before adding GPS events.
17
- *
18
- * @param zero - GPS coordinates of the origin
19
- */
20
- setZeroRef(zero: LatLong): void;
21
- /**
22
- * Get the current zero reference
23
- */
24
- getZeroRef(): LatLong | null;
25
- /**
26
- * Add a GPS event to the visualization.
27
- * Creates both a raw GPS marker and a fused alignment marker.
28
- *
29
- * @param gpsCoords - GPS position as [x, y, z] meters from zero reference
30
- * @param odomPosition - AR odometry position at the time of GPS reading
31
- */
32
- addGpsEvent(gpsCoords: Vector3, odomPosition: Vector3): void;
33
- /**
34
- * Add an alignment snapshot marker at the given NUE position.
35
- * Snapshots represent the system's best GPS estimate at each alignment update.
36
- * Added to scene root (GPS world space), not arWorldGroup.
37
- */
38
- addAlignmentSnapshot(nuePosition: Vector3): void;
39
- /**
40
- * Get the NUE positions of all alignment snapshot markers.
41
- * Used at session end to convert to GPS coordinates for the summary map.
42
- */
43
- getAlignmentSnapshotPositions(): Vector3[];
44
- /**
45
- * Create a sphere marker mesh with the given color and name.
46
- */
47
- private createMarkerMesh;
48
- /**
49
- * Clear all markers from the scene and reset state.
50
- */
51
- clearAll(): void;
52
- /**
53
- * Get count of visible markers.
54
- */
55
- getCounts(): {
56
- raw: number;
57
- fused: number;
58
- snapshots: number;
59
- };
60
- }
61
- /**
62
- * Singleton instance for global use.
63
- * Import this to visualize GPS events.
64
- */
65
- declare const gpsEventVisualizer: GpsEventVisualizer;
66
- //#endregion
67
- export { gpsEventVisualizer as n, GpsEventVisualizer as t };
@@ -1,31 +0,0 @@
1
- import { n as StorageBackend } from "./storage-backend-yVnuWGTr.js";
2
- import { Middleware } from "@reduxjs/toolkit";
3
-
4
- //#region ../src/state/persistence-middleware.d.ts
5
- interface PersistenceMiddlewareOptions {
6
- /**
7
- * StorageBackend to use for action persistence.
8
- */
9
- storageBackend: StorageBackend;
10
- /**
11
- * Callback invoked when a write operation fails during persistence.
12
- * User Feedback Issue #1 Part B: Used to show toast notifications.
13
- */
14
- onWriteFailure?: (error: Error) => void;
15
- }
16
- /**
17
- * Create a Redux middleware that persists qualifying actions to storage
18
- * during active recording sessions.
19
- *
20
- * Persistence rules:
21
- * - Only persists when `state.recording.isRecording` is true (checked AFTER
22
- * the action is reduced, so `startSession` itself is included).
23
- * - Persists `gpsData/*` and `recording/*` actions.
24
- * - Excludes `recording/recordWriteFailure` to prevent recursive persistence.
25
- * - Excludes `routing/*`, `refPoints/*`, and any other non-recording actions.
26
- * - Uses 1-based indexing for action files (000001.json, 000002.json, …).
27
- * - Each middleware instance maintains its own action index (Bug 10 fix).
28
- */
29
- declare function createPersistenceMiddleware(options: PersistenceMiddlewareOptions): Middleware;
30
- //#endregion
31
- export { createPersistenceMiddleware as n, PersistenceMiddlewareOptions as t };
@@ -1,101 +0,0 @@
1
- import { t as ARPose } from "./ar-types-B-ORgk6Z.js";
2
- import { OdometryTrackingRestartedPayload, Quaternion, Vector3 } from "gps-plus-slam-js";
3
-
4
- //#region ../src/ar/tracking-state.d.ts
5
- /**
6
- * Possible tracking states
7
- */
8
- declare enum TrackingState {
9
- /** AR session started but no pose received yet */
10
- INITIALIZING = "initializing",
11
- /** Actively receiving valid poses */
12
- TRACKING = "tracking",
13
- /** Pose became unavailable (tracking lost) */
14
- LOST = "lost"
15
- }
16
- /**
17
- * Device orientation from sensors (for sensor rotation in restart payload)
18
- */
19
- interface DeviceOrientation {
20
- alpha: number;
21
- beta: number;
22
- gamma: number;
23
- absolute: boolean;
24
- }
25
- /**
26
- * Serialized representation of the XRReferenceSpaceEvent.transform.
27
- * The position and orientation of the new native origin expressed in
28
- * the pre-reset coordinate system. `null` when the runtime cannot
29
- * determine the delta.
30
- */
31
- interface ResetTransformData {
32
- position: Vector3;
33
- orientation: Quaternion;
34
- }
35
- /**
36
- * Callbacks for tracking state changes
37
- */
38
- interface TrackingStateCallbacks {
39
- /** Called when tracking is lost (pose became null) */
40
- onTrackingLost: () => void;
41
- /** Called when tracking resumes after a coordinate-frame reset (Case 2: relocalization) */
42
- onTrackingRestarted: (payload: OdometryTrackingRestartedPayload) => void;
43
- /** Called when tracking resumes seamlessly without origin reset (Case 1) */
44
- onTrackingRecovered?: () => void;
45
- /** Get current device orientation for sensor rotation */
46
- getDeviceOrientation: () => DeviceOrientation;
47
- }
48
- /**
49
- * Manages AR tracking state and detects loss/restart events.
50
- */
51
- declare class TrackingStateManager {
52
- private state;
53
- private lastValidPose;
54
- private lastSensorOrientation;
55
- private lostFrameCount;
56
- private originResetDuringLoss;
57
- private resetTransform;
58
- private callbacks;
59
- constructor(callbacks: TrackingStateCallbacks);
60
- /**
61
- * Get current tracking state.
62
- */
63
- getState(): TrackingState;
64
- /**
65
- * Get the last valid AR pose (before tracking was lost).
66
- */
67
- getLastValidPose(): ARPose | null;
68
- /**
69
- * Get count of consecutive frames without pose (during LOST state).
70
- */
71
- getLostFrameCount(): number;
72
- /**
73
- * Flag that an XRReferenceSpace reset event occurred during tracking loss.
74
- * Only meaningful while in LOST state — ignored otherwise.
75
- *
76
- * @param transform — Serialized XRReferenceSpaceEvent.transform (post-reset
77
- * origin in pre-reset coordinates). Pass `null` when the event's
78
- * transform property is null (runtime can't determine delta).
79
- * Omit entirely for backwards-compat with callers that don't have it.
80
- */
81
- markOriginReset(transform?: ResetTransformData | null): void;
82
- /**
83
- * Called when a valid pose is received from WebXR.
84
- */
85
- onPoseReceived(pose: ARPose): void;
86
- /**
87
- * Called when pose is null/unavailable from WebXR.
88
- */
89
- onPoseLost(): void;
90
- /**
91
- * Reset the manager to initial state.
92
- * Call this when starting a new session.
93
- */
94
- reset(): void;
95
- /**
96
- * Handle the transition from LOST to TRACKING (restart detected).
97
- */
98
- private handleTrackingRestarted;
99
- }
100
- //#endregion
101
- export { TrackingStateManager as a, TrackingStateCallbacks as i, ResetTransformData as n, TrackingState as r, DeviceOrientation as t };
@@ -1,2 +0,0 @@
1
- import { n as GpsAnchoredMeshManager, r as GpsAnchoredMeshManagerOptions, t as GpsAnchoredItem } from "../gps-anchored-mesh-manager-CovAFK4g.js";
2
- export { GpsAnchoredItem, GpsAnchoredMeshManager, GpsAnchoredMeshManagerOptions };
@@ -1,128 +0,0 @@
1
- import { createLogger } from "../utils/logger.js";
2
- import { disposeMeshArray } from "./three-dispose.js";
3
- import { getScene } from "../ar/webxr-session.js";
4
- import * as THREE from "three";
5
- import { calcRelativeCoordsInMeters } from "gps-plus-slam-js";
6
- //#region ../src/visualization/gps-anchored-mesh-manager.ts
7
- /**
8
- * GPS-Anchored Mesh Manager
9
- *
10
- * Generic mechanism for placing Three.js meshes at GPS coordinates relative
11
- * to a configured GPS zero reference. This is the recorder-agnostic core
12
- * that was extracted in Iter 4 from the recorder-flavoured
13
- * `RefPointVisualizer` (which now lives in the RecorderApp and composes two
14
- * instances of this manager — prior=green, current=red).
15
- *
16
- * The manager is intentionally narrow: it knows how to convert
17
- * `{ lat, lon, altitude? }` into local meters via the framework's GPS zero
18
- * reference, allocate a single shared geometry + material per instance, and
19
- * keep the resulting mesh group in sync with caller-provided items. It does
20
- * not know anything about ref points, sessions, or recorder semantics.
21
- */
22
- const DEFAULT_RADIUS = .1;
23
- /**
24
- * Manages a single colored mesh group anchored to GPS coordinates.
25
- * One instance == one color/group.
26
- */
27
- var GpsAnchoredMeshManager = class {
28
- color;
29
- radius;
30
- namePrefix;
31
- log;
32
- meshes = [];
33
- zeroRef = null;
34
- geometry = null;
35
- material = null;
36
- constructor(options) {
37
- this.color = options.color;
38
- this.radius = options.radius ?? DEFAULT_RADIUS;
39
- this.namePrefix = options.namePrefix;
40
- this.log = createLogger(options.loggerLabel ?? "GpsAnchoredMeshManager");
41
- }
42
- /** Set the GPS origin used to project items into local meters. */
43
- setZeroRef(zero) {
44
- this.zeroRef = zero;
45
- }
46
- getZeroRef() {
47
- return this.zeroRef;
48
- }
49
- /**
50
- * Replace the entire mesh group with one mesh per provided item.
51
- * Items without GPS or before `setZeroRef` are skipped.
52
- */
53
- setItems(items) {
54
- if (!this.zeroRef) {
55
- this.log.warn("No zero reference set");
56
- return;
57
- }
58
- const scene = getScene();
59
- if (!scene) {
60
- this.log.warn("Scene not available");
61
- return;
62
- }
63
- this.clear();
64
- const geometry = this.geometry ??= new THREE.SphereGeometry(this.radius, 16, 16);
65
- const material = this.material ??= new THREE.MeshBasicMaterial({ color: this.color });
66
- let visibleCount = 0;
67
- for (const item of items) {
68
- const coords = calcRelativeCoordsInMeters(this.zeroRef, {
69
- lat: item.lat,
70
- lon: item.lon
71
- }, item.altitude ?? 0, 0);
72
- const mesh = new THREE.Mesh(geometry, material);
73
- mesh.position.set(coords[0], coords[1], coords[2]);
74
- mesh.name = `${this.namePrefix}-${item.id}`;
75
- scene.add(mesh);
76
- this.meshes.push(mesh);
77
- visibleCount++;
78
- }
79
- this.log.info(`Displayed ${visibleCount}/${items.length} anchored meshes`);
80
- }
81
- /** Append a single item to the existing mesh group. */
82
- addItem(item) {
83
- if (!this.zeroRef) {
84
- this.log.warn("Cannot add item — no zero reference");
85
- return;
86
- }
87
- const scene = getScene();
88
- if (!scene) {
89
- this.log.warn("Scene not available");
90
- return;
91
- }
92
- const geometry = this.geometry ??= new THREE.SphereGeometry(this.radius, 16, 16);
93
- const material = this.material ??= new THREE.MeshBasicMaterial({ color: this.color });
94
- const coords = calcRelativeCoordsInMeters(this.zeroRef, {
95
- lat: item.lat,
96
- lon: item.lon
97
- }, item.altitude ?? 0, 0);
98
- const mesh = new THREE.Mesh(geometry, material);
99
- mesh.position.set(coords[0], coords[1], coords[2]);
100
- mesh.name = `${this.namePrefix}-${item.id}`;
101
- scene.add(mesh);
102
- this.meshes.push(mesh);
103
- this.log.info(`Added anchored mesh: ${item.id}`);
104
- }
105
- /** Remove all meshes and dispose the shared geometry/material. */
106
- clear() {
107
- const scene = getScene();
108
- disposeMeshArray(this.meshes, scene, {
109
- skipGeometry: true,
110
- skipMaterial: true
111
- });
112
- this.geometry?.dispose();
113
- this.geometry = null;
114
- this.material?.dispose();
115
- this.material = null;
116
- }
117
- /** Number of meshes currently rendered. */
118
- getCount() {
119
- return this.meshes.length;
120
- }
121
- /** Convenience: clear and forget the zero reference. */
122
- dispose() {
123
- this.clear();
124
- this.zeroRef = null;
125
- }
126
- };
127
- //#endregion
128
- export { GpsAnchoredMeshManager };