gps-plus-slam-app-framework 1.4.0 → 1.8.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.
- package/dist/absolute-orientation-BAxc15J6.d.ts +54 -0
- package/dist/{accuracy-circles-Pi2YeCrM.d.ts → accuracy-circles-DkWBkF5g.d.ts} +16 -6
- package/dist/{app-selectors-CrOucL00.d.ts → app-selectors-JqydaUMN.d.ts} +1 -1
- package/dist/ar/bresenham3d.d.ts +1 -1
- package/dist/ar/camera-blit-capture.d.ts +1 -1
- package/dist/ar/capability-checker.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-grid-lookup.d.ts +1 -1
- package/dist/ar/depth-occluder.d.ts +127 -0
- package/dist/ar/depth-occluder.js +299 -0
- package/dist/ar/depth-sampler.d.ts +2 -2
- package/dist/ar/depth-sampler.js +24 -4
- package/dist/ar/depth-unprojection.d.ts +1 -1
- package/dist/ar/depth-unprojection.js +52 -21
- package/dist/ar/enable-gps-ar.d.ts +1 -1
- package/dist/ar/enable-gps-ar.js +1 -1
- package/dist/ar/frame-loop.d.ts +1 -1
- package/dist/ar/frame-loop.js +12 -2
- package/dist/ar/image-capture.d.ts +2 -2
- package/dist/ar/image-capture.js +1 -154
- package/dist/ar/image-quality.d.ts +2 -0
- package/dist/ar/image-quality.js +169 -0
- package/dist/ar/index.d.ts +32 -30
- package/dist/ar/index.js +7 -5
- package/dist/ar/occlusion-mesh-worker.d.ts +58 -0
- package/dist/ar/occlusion-mesh-worker.js +129 -0
- package/dist/ar/occupancy-grid.d.ts +2 -2
- package/dist/ar/occupancy-grid.js +287 -31
- package/dist/ar/occupancy-mesher.d.ts +2 -0
- package/dist/ar/occupancy-mesher.js +638 -0
- package/dist/ar/planar-pnp.d.ts +1 -1
- package/dist/ar/qr-debug-view.d.ts +1 -1
- package/dist/ar/qr-derived-pose.d.ts +1 -1
- package/dist/ar/qr-detection-controller.d.ts +1 -1
- package/dist/ar/qr-frontend.d.ts +1 -1
- package/dist/ar/qr-pose.d.ts +1 -1
- package/dist/ar/qr-size-depth-context.d.ts +2 -2
- package/dist/ar/qr-size-measurer.d.ts +1 -1
- package/dist/ar/replay-scene.d.ts +1 -1
- package/dist/ar/replay-scene.js +1 -1
- package/dist/ar/scene-node-names.d.ts +1 -1
- package/dist/ar/webxr-nue-basis.d.ts +1 -1
- package/dist/ar/webxr-session.d.ts +4 -4
- package/dist/ar/webxr-session.js +2 -2
- package/dist/ar/xr-camera-texture.d.ts +1 -1
- package/dist/ar/xr-error-handler.d.ts +1 -1
- package/dist/ar/xr-frame-loop.d.ts +1 -1
- package/dist/ar/xr-frame-loop.js +12 -2
- package/dist/{ar-Dc72Ksiu.js → ar-BqCudtqE.js} +4 -3
- package/dist/{ar-world-group-alignment-DDLkgNf_.d.ts → ar-world-group-alignment-BlvGcIAk.d.ts} +1 -1
- package/dist/capture-motion-gate-BGoAMkmf.d.ts +24 -0
- package/dist/capture-motion-gate-_NdTSwKi.js +106 -0
- package/dist/cell-key-DIB4rOTV.js +51 -0
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +2 -2
- package/dist/{create-slam-app-store-Ce2FMKCp.d.ts → create-slam-app-store-D3nzh9Wb.d.ts} +50 -40
- package/dist/create-slam-app-store-DXiAnJwR.js +156 -0
- package/dist/{depth-grid-lookup-vMDrGTk_.d.ts → depth-grid-lookup-D5atpNZ3.d.ts} +1 -1
- package/dist/{depth-sampler-DwfPYzS7.d.ts → depth-sampler-CwObAwEA.d.ts} +33 -1
- package/dist/{depth-unprojection-CK3b9htH.d.ts → depth-unprojection-DRdBU90S.d.ts} +1 -1
- package/dist/{enable-gps-ar-CjZ1nEdu.d.ts → enable-gps-ar-DvGzBOrp.d.ts} +4 -4
- package/dist/{frame-conversions-D_Af8Dt3.d.ts → frame-conversions-C4bnNOEY.d.ts} +1 -1
- package/dist/{fused-path-C0FHe67t.d.ts → fused-path-C5pp0PJU.d.ts} +1 -1
- package/dist/geo/h3-proximity.d.ts +1 -1
- package/dist/geo/index.d.ts +1 -1
- package/dist/geodesic-angle-BTldfFgs.js +39 -0
- package/dist/{gps-anchor-C6I9NDHA.d.ts → gps-anchor-BjECcYnD.d.ts} +1 -1
- package/dist/{gps-ar-pose-sampler-DaHg2aPZ.d.ts → gps-ar-pose-sampler-DEGNk2CI.d.ts} +1 -1
- package/dist/{gps-event-coordinator-C7hwHyLA.d.ts → gps-event-coordinator-CHtIkhb7.d.ts} +21 -11
- package/dist/{image-capture-C2Feywet.d.ts → image-capture-Bp6Pd4Md.d.ts} +103 -3
- package/dist/image-capture-DVcuqMtX.js +374 -0
- package/dist/image-quality-BMx2ko9-.d.ts +158 -0
- package/dist/index-D4vrgV4b.d.ts +2 -0
- package/dist/index-D74JTX4I.d.ts +22 -0
- package/dist/{index-m_LneUSi.d.ts → index-DlsOo2IB.d.ts} +1 -1
- package/dist/{index-BvLo2poy.d.ts → index-cCQWuYqy.d.ts} +3 -3
- package/dist/index.d.ts +82 -77
- package/dist/index.js +15 -10
- package/dist/{leaflet-map-overlay-bnb2U1NQ.d.ts → leaflet-map-overlay-BOZFW5kT.d.ts} +64 -10
- package/dist/leaflet-map-overlay-CBWPvaX9.js +452 -0
- package/dist/lerp-utils-Qs8OhumS.d.ts +42 -0
- package/dist/map-data-D7rpMC6f.js +120 -0
- package/dist/{map-data-DdjPiSav.d.ts → map-data-PNfGKGWx.d.ts} +22 -2
- package/dist/{map-overlay-draw-CPVdAsFq.d.ts → map-overlay-draw-DiroaJed.d.ts} +1 -1
- package/dist/{null-storage-backend-CuSdYFsM.d.ts → null-storage-backend-B1-jlpin.d.ts} +2 -2
- package/dist/occlusion-mesh-b28lRJ6S.d.ts +194 -0
- package/dist/occupancy-grid-BV7RhB7I.d.ts +194 -0
- package/dist/occupancy-mesher-C2ecWhNp.d.ts +100 -0
- package/dist/{opfs-storage-DMtlt57S.d.ts → opfs-storage-CTkxvxN4.d.ts} +5 -0
- package/dist/{opfs-storage-backend-CeQAb0SD.d.ts → opfs-storage-backend-D6Z03fML.d.ts} +2 -2
- package/dist/{persistence-middleware-5eearhSV.d.ts → persistence-middleware-CG-t08X4.d.ts} +1 -1
- package/dist/{planar-pnp-cjthe7Be.d.ts → planar-pnp-D7bc_rLX.d.ts} +1 -1
- package/dist/{qr-debug-view-B8gTzjMm.d.ts → qr-debug-view-BJooqbiP.d.ts} +1 -1
- package/dist/{qr-derived-pose-DinKE600.d.ts → qr-derived-pose-BwNWn8oV.d.ts} +2 -2
- package/dist/{qr-detected-slice-Cpv-dg82.d.ts → qr-detected-slice-TzVb8bij.d.ts} +4 -4
- package/dist/{qr-detection-controller-Cd2Ih4cC.d.ts → qr-detection-controller-Bo4XfQTP.d.ts} +3 -3
- package/dist/{qr-frontend-DufZp2xS.d.ts → qr-frontend-BPURlh3S.d.ts} +1 -1
- package/dist/{qr-pose-aggregation-CFlmLm6w.d.ts → qr-pose-aggregation-CypnmjA-.d.ts} +1 -1
- package/dist/{qr-pose-aggregation-DXR9STHs.js → qr-pose-aggregation-DBiaLW0O.js} +1 -10
- package/dist/{qr-size-depth-context-onu36E9s.d.ts → qr-size-depth-context-apAOmbrZ.d.ts} +2 -2
- package/dist/{qr-size-measurer-D7739ZpB.d.ts → qr-size-measurer-DxiMqRUw.d.ts} +3 -3
- package/dist/recording-options-vASCFzc5.d.ts +667 -0
- package/dist/{recording-replayer-CUEK82tM.d.ts → recording-replayer-D0V9WkmY.d.ts} +2 -2
- package/dist/{recording-slice-B-uCgGoh.d.ts → recording-slice-DTUtSVgd.d.ts} +2 -2
- package/dist/{replay-engine-BSVd7Zzb.d.ts → replay-engine-xdrUgWJi.d.ts} +1 -1
- package/dist/{replay-scene-CPt56pps.d.ts → replay-scene-zJ8SFDjE.d.ts} +3 -3
- package/dist/sensors/absolute-orientation.d.ts +2 -0
- package/dist/sensors/absolute-orientation.js +162 -0
- package/dist/sensors/gps-error-handler.d.ts +1 -1
- package/dist/sensors/gps.d.ts +1 -1
- package/dist/sensors/index.d.ts +5 -4
- package/dist/sensors/index.js +2 -1
- package/dist/sensors/permission-checker.d.ts +1 -1
- package/dist/state/app-selectors.d.ts +1 -1
- package/dist/state/combined-root-state.d.ts +1 -1
- package/dist/state/create-slam-app-store.d.ts +1 -1
- package/dist/state/create-slam-app-store.js +1 -74
- package/dist/state/gps-ar-pose-sampler.d.ts +3 -3
- package/dist/state/gps-event-coordinator.d.ts +2 -2
- package/dist/state/gps-event-coordinator.js +27 -17
- package/dist/state/index.d.ts +20 -20
- package/dist/state/index.js +4 -4
- package/dist/state/persistence-middleware.d.ts +1 -1
- package/dist/state/persistence-middleware.js +30 -19
- package/dist/state/qr-detected-slice.d.ts +3 -3
- package/dist/state/qr-detected-slice.js +1 -1
- package/dist/state/recording-options.d.ts +2 -2
- package/dist/state/recording-options.js +286 -25
- package/dist/state/recording-replayer.d.ts +2 -2
- package/dist/state/recording-replayer.js +1 -1
- 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 +2 -1
- package/dist/state/subscribe-to-selector.d.ts +1 -1
- package/dist/state/tracking-quality.d.ts +2 -2
- package/dist/state/tracking-quality.js +49 -128
- package/dist/state/tracking-slice.d.ts +1 -1
- package/dist/{state-IEw0ZsBu.js → state-BeKvn4B-.js} +1 -1
- package/dist/storage/file-system-utils.d.ts +1 -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/opfs-storage.js +25 -1
- package/dist/storage/storage-backend.d.ts +1 -1
- package/dist/storage/zip-coverage-embed.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-backend-CTJHNdMp.d.ts → storage-backend-sEtmM4yW.d.ts} +1 -1
- package/dist/{store-subscribers-BZP81hjh.d.ts → store-subscribers-DScA7tdT.d.ts} +2 -2
- package/dist/{subscribe-to-selector-Bp3sLx8L.d.ts → subscribe-to-selector-B9ylM5Oh.d.ts} +1 -1
- package/dist/test-utils/browser-mocks.d.ts +1 -1
- package/dist/test-utils/zip-round-trip-helpers.d.ts +1 -1
- package/dist/{tracking-slice-DJZ9qeGg.d.ts → tracking-slice-DMkHlbny.d.ts} +1 -1
- package/dist/types/ar-types.d.ts +1 -1
- package/dist/types/geo-types.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- 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 +8 -7
- package/dist/utils/index.js +2 -1
- package/dist/utils/list-formatter.d.ts +1 -1
- package/dist/utils/logger.d.ts +1 -1
- package/dist/visualization/accuracy-circles.d.ts +1 -1
- package/dist/visualization/accuracy-circles.js +17 -8
- package/dist/visualization/alignment-lerper.d.ts +1 -1
- package/dist/visualization/ar-world-group-alignment.d.ts +1 -1
- package/dist/visualization/ar-world-group-alignment.js +1 -1
- package/dist/visualization/camera-follower.d.ts +1 -1
- package/dist/visualization/css3d-renderer-manager.d.ts +1 -1
- package/dist/visualization/frame-conversions.d.ts +1 -1
- package/dist/visualization/frustum-visibility.d.ts +1 -1
- package/dist/visualization/gps-anchor.d.ts +1 -1
- package/dist/visualization/gps-compass-cubes.d.ts +1 -1
- package/dist/visualization/gps-event-markers.d.ts +1 -1
- package/dist/visualization/gps-event-markers.js +1 -1
- package/dist/visualization/hit-test-reticle.d.ts +1 -1
- package/dist/visualization/index.d.ts +20 -19
- package/dist/visualization/index.js +4 -3
- package/dist/visualization/leaflet-map-overlay.d.ts +1 -1
- package/dist/visualization/leaflet-map-overlay.js +1 -282
- package/dist/visualization/lerp-utils.d.ts +2 -2
- package/dist/visualization/lerp-utils.js +27 -3
- package/dist/visualization/map-data.d.ts +1 -1
- package/dist/visualization/map-data.js +1 -32
- package/dist/visualization/map-overlay-draw.d.ts +1 -1
- package/dist/visualization/map-overlay-draw.js +24 -2
- package/dist/visualization/map-overlay.d.ts +1 -1
- package/dist/visualization/occluder-mesh-driver.d.ts +130 -0
- package/dist/visualization/occluder-mesh-driver.js +219 -0
- package/dist/visualization/occlusion-mesh.d.ts +2 -0
- package/dist/visualization/occlusion-mesh.js +437 -0
- package/dist/visualization/three-dispose.d.ts +1 -1
- package/dist/visualization/vis-colors.d.ts +1 -1
- package/dist/{webxr-session-CJF9Nijp.js → webxr-session-BCP2XK7k.js} +110 -14
- package/dist/{webxr-session-COsOjJwn.d.ts → webxr-session-cRG2SYAQ.d.ts} +83 -10
- package/package.json +4 -4
- package/dist/index-eaI1Z1KR.d.ts +0 -2
- package/dist/lerp-utils-kLxMJ2Xj.d.ts +0 -20
- package/dist/occupancy-grid-Bvi2Gw1U.d.ts +0 -82
- package/dist/recording-options-D93kksJU.d.ts +0 -369
- /package/dist/{alignment-lerper-BUTsQ2yu.d.ts → alignment-lerper-gD70k7Fq.d.ts} +0 -0
- /package/dist/{ar-types-BckI1E-O.d.ts → ar-types-Cc5yvBwn.d.ts} +0 -0
- /package/dist/{bresenham3d-ByjcmEgM.d.ts → bresenham3d-DGc4nIb-.d.ts} +0 -0
- /package/dist/{camera-blit-capture-CqWe1G7s.d.ts → camera-blit-capture-BimSdyih.d.ts} +0 -0
- /package/dist/{camera-follower-BTb2Yp12.d.ts → camera-follower-DfBm2J5i.d.ts} +0 -0
- /package/dist/{capability-checker-CXqoJYtb.d.ts → capability-checker-BTTpygvZ.d.ts} +0 -0
- /package/dist/{capture-failure-tracker-BL5SoG2a.d.ts → capture-failure-tracker-_BVfhpxv.d.ts} +0 -0
- /package/dist/{chromium-camera-access-workaround-BNK189P0.d.ts → chromium-camera-access-workaround-C6yJLXz9.d.ts} +0 -0
- /package/dist/{concurrency-DqAlKX4j.d.ts → concurrency-DPeGBH0X.d.ts} +0 -0
- /package/dist/{css3d-renderer-manager-m-ab19vp.d.ts → css3d-renderer-manager-CPpVtvgs.d.ts} +0 -0
- /package/dist/{failure-tracker-Cnc_xWUw.d.ts → failure-tracker-CeKf5HIc.d.ts} +0 -0
- /package/dist/{file-system-utils-Bs7lpeVP.d.ts → file-system-utils-DueXHxo9.d.ts} +0 -0
- /package/dist/{format-file-size-BFUWvir1.d.ts → format-file-size-DxN-EBLc.d.ts} +0 -0
- /package/dist/{frame-loop-BEO9_q3k.d.ts → frame-loop-7GBMBu68.d.ts} +0 -0
- /package/dist/{frustum-visibility-D_RGmH98.d.ts → frustum-visibility-CokkgS_i.d.ts} +0 -0
- /package/dist/{geo-types-DqiBzPO9.d.ts → geo-types-DrGVu8nS.d.ts} +0 -0
- /package/dist/{gps-C5inWeNV.d.ts → gps-CDKDQokE.d.ts} +0 -0
- /package/dist/{gps-compass-cubes-BExxrWJ-.d.ts → gps-compass-cubes-1mooS3BS.d.ts} +0 -0
- /package/dist/{gps-error-handler-C2bS69oJ.d.ts → gps-error-handler-C34GQuTu.d.ts} +0 -0
- /package/dist/{gps-event-markers-Dd0G2bD0.d.ts → gps-event-markers-Di2nBzx-.d.ts} +0 -0
- /package/dist/{h3-proximity-B57C6rYL.d.ts → h3-proximity-D0GTHQmr.d.ts} +0 -0
- /package/dist/{hit-test-reticle-Dqak9hiR.d.ts → hit-test-reticle-CaQbrhbk.d.ts} +0 -0
- /package/dist/{list-formatter-ct8txwvR.d.ts → list-formatter-DLFDnS70.d.ts} +0 -0
- /package/dist/{logger-CzQrCe6C.d.ts → logger-CqTd5Kpk.d.ts} +0 -0
- /package/dist/{map-overlay-Dci4yvm3.d.ts → map-overlay-BCQgvIgU.d.ts} +0 -0
- /package/dist/{permission-checker-CtPtPQRq.d.ts → permission-checker-B-VtjnBA.d.ts} +0 -0
- /package/dist/{qr-pose-Bt2reSw7.d.ts → qr-pose-y3vaEd6x.d.ts} +0 -0
- /package/dist/{scene-node-names-CdNeQjOE.d.ts → scene-node-names-CGb-ylBd.d.ts} +0 -0
- /package/dist/{session-disposers-D8wnO-uW.js → session-disposers-BPrMplIC.js} +0 -0
- /package/dist/{three-dispose-BCZkSJp2.d.ts → three-dispose-BMOAmPhb.d.ts} +0 -0
- /package/dist/{vis-colors-BZsSLI4i.d.ts → vis-colors-C7HI0u9_.d.ts} +0 -0
- /package/dist/{webxr-nue-basis-CW1wsbm6.d.ts → webxr-nue-basis-CaCnYxuq.d.ts} +0 -0
- /package/dist/{xr-camera-texture-BmrP7iNZ.d.ts → xr-camera-texture-q0eIDSRg.d.ts} +0 -0
- /package/dist/{xr-error-handler-BEjRgZjt.d.ts → xr-error-handler-uVGDu9IX.d.ts} +0 -0
- /package/dist/{xr-frame-loop-K8ebdjLw.d.ts → xr-frame-loop-DX3JPpAU.d.ts} +0 -0
- /package/dist/{zip-coverage-embed-tFohI2J4.d.ts → zip-coverage-embed-ncVbaZAz.d.ts} +0 -0
- /package/dist/{zip-export-DDWXInTR.d.ts → zip-export-CtiUnAlJ.d.ts} +0 -0
- /package/dist/{zip-reader-Q2ue6zlC.d.ts → zip-reader-CvruaGvD.d.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as Css3dRendererManager } from "./css3d-renderer-manager-
|
|
2
|
-
import { t as CameraFollower } from "./camera-follower-
|
|
3
|
-
import { t as AlignmentLerper } from "./alignment-lerper-
|
|
1
|
+
import { t as Css3dRendererManager } from "./css3d-renderer-manager-CPpVtvgs.js";
|
|
2
|
+
import { t as CameraFollower } from "./camera-follower-DfBm2J5i.js";
|
|
3
|
+
import { t as AlignmentLerper } from "./alignment-lerper-gD70k7Fq.js";
|
|
4
4
|
import * as THREE from "three";
|
|
5
5
|
import { OrbitControls } from "three/addons/controls/OrbitControls.js";
|
|
6
6
|
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as startAbsoluteOrientationWatch, i as isAbsoluteOrientationAvailable, n as AbsoluteOrientationStatus, o as stopAbsoluteOrientationWatch, r as getLatestAbsoluteOrientation, t as AbsoluteOrientationReading } from "../absolute-orientation-BAxc15J6.js";
|
|
2
|
+
export { AbsoluteOrientationReading, AbsoluteOrientationStatus, getLatestAbsoluteOrientation, isAbsoluteOrientationAvailable, startAbsoluteOrientationWatch, stopAbsoluteOrientationWatch };
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { createLogger } from "../utils/logger.js";
|
|
2
|
+
//#region ../src/sensors/absolute-orientation.ts
|
|
3
|
+
/**
|
|
4
|
+
* AbsoluteOrientationSensor capture (Generic Sensor API).
|
|
5
|
+
*
|
|
6
|
+
* Phase 1 of the AbsoluteOrientationSensor plan
|
|
7
|
+
* (GpsPlusSlamJs_Docs/docs/2026-06-25-absolute-orientation-sensor-plan.md §5.1):
|
|
8
|
+
* passive instrumentation that fuses accelerometer + gyroscope + magnetometer
|
|
9
|
+
* into an Earth-referenced (ENU) quaternion, captured per GPS event as an
|
|
10
|
+
* independent north reference. No production behaviour change.
|
|
11
|
+
*
|
|
12
|
+
* Platform: Chrome Android only. Safari / Firefox / desktop / iOS lack the
|
|
13
|
+
* sensor → this module degrades to a clean, reported no-op.
|
|
14
|
+
*
|
|
15
|
+
* The raw `'device'` reference frame is recorded together with the screen angle
|
|
16
|
+
* so either the device- or screen-compensated form can be reconstructed offline
|
|
17
|
+
* (plan §8 Q1).
|
|
18
|
+
*/
|
|
19
|
+
const log = createLogger("AbsCompass");
|
|
20
|
+
/** Sensor frequency (Hz). We only snapshot at GPS rate, so low is fine (plan §8 Q4). */
|
|
21
|
+
const SENSOR_FREQUENCY_HZ = 20;
|
|
22
|
+
let sensor = null;
|
|
23
|
+
let latest = null;
|
|
24
|
+
let watchGeneration = 0;
|
|
25
|
+
function getSensorCtor() {
|
|
26
|
+
if (typeof window === "undefined") return null;
|
|
27
|
+
const ctor = window.AbsoluteOrientationSensor;
|
|
28
|
+
return typeof ctor === "function" ? ctor : null;
|
|
29
|
+
}
|
|
30
|
+
/** True when the sensor can plausibly run here (secure context + API present). */
|
|
31
|
+
function isAbsoluteOrientationAvailable() {
|
|
32
|
+
return typeof window !== "undefined" && window.isSecureContext === true && getSensorCtor() !== null;
|
|
33
|
+
}
|
|
34
|
+
function currentScreenAngleDeg() {
|
|
35
|
+
if (typeof screen === "undefined") return 0;
|
|
36
|
+
const angle = screen.orientation?.angle;
|
|
37
|
+
return typeof angle === "number" ? angle : 0;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Whether all three underlying sensors are granted-or-promptable (plan §5.1).
|
|
41
|
+
* Returns `true` when the Permissions API is absent (best-effort — let the
|
|
42
|
+
* sensor constructor surface any real denial), and treats a failed individual
|
|
43
|
+
* query as `'granted'` for the same reason.
|
|
44
|
+
*/
|
|
45
|
+
async function sensorPermissionsUsable() {
|
|
46
|
+
const permissions = navigator.permissions;
|
|
47
|
+
if (!permissions || typeof permissions.query !== "function") return true;
|
|
48
|
+
const queryState = async (name) => {
|
|
49
|
+
try {
|
|
50
|
+
return (await permissions.query({ name })).state;
|
|
51
|
+
} catch {
|
|
52
|
+
return "granted";
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
return (await Promise.all([
|
|
56
|
+
"accelerometer",
|
|
57
|
+
"gyroscope",
|
|
58
|
+
"magnetometer"
|
|
59
|
+
].map(queryState))).every((s) => s === "granted" || s === "prompt");
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Start capturing absolute orientation. Idempotent (stops any prior watch first).
|
|
63
|
+
*
|
|
64
|
+
* On platforms without the sensor — or when permissions are denied — it reports
|
|
65
|
+
* `unavailable`/`error` via `onStatus` and stays a no-op; the recorder keeps
|
|
66
|
+
* working unchanged. Never throws.
|
|
67
|
+
*/
|
|
68
|
+
async function startAbsoluteOrientationWatch(onStatus = () => {}) {
|
|
69
|
+
stopAbsoluteOrientationWatch();
|
|
70
|
+
const myGeneration = watchGeneration;
|
|
71
|
+
const reportStatus = (status) => {
|
|
72
|
+
try {
|
|
73
|
+
onStatus(status);
|
|
74
|
+
} catch (err) {
|
|
75
|
+
log.error("onStatus callback threw; continuing", err);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
const Ctor = getSensorCtor();
|
|
79
|
+
if (!isAbsoluteOrientationAvailable() || Ctor === null) {
|
|
80
|
+
reportStatus({
|
|
81
|
+
state: "unavailable",
|
|
82
|
+
reason: "no AbsoluteOrientationSensor / insecure context"
|
|
83
|
+
});
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
try {
|
|
87
|
+
if (!await sensorPermissionsUsable()) {
|
|
88
|
+
reportStatus({
|
|
89
|
+
state: "unavailable",
|
|
90
|
+
reason: "sensor permission denied"
|
|
91
|
+
});
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if (myGeneration !== watchGeneration) return;
|
|
95
|
+
const created = new Ctor({
|
|
96
|
+
frequency: SENSOR_FREQUENCY_HZ,
|
|
97
|
+
referenceFrame: "device"
|
|
98
|
+
});
|
|
99
|
+
sensor = created;
|
|
100
|
+
created.addEventListener("reading", () => {
|
|
101
|
+
if (created !== sensor) return;
|
|
102
|
+
const q = created.quaternion;
|
|
103
|
+
if (!q || q.length < 4) return;
|
|
104
|
+
const x = q[0];
|
|
105
|
+
const y = q[1];
|
|
106
|
+
const z = q[2];
|
|
107
|
+
const w = q[3];
|
|
108
|
+
if (x === void 0 || y === void 0 || z === void 0 || w === void 0) return;
|
|
109
|
+
latest = {
|
|
110
|
+
quaternion: [
|
|
111
|
+
x,
|
|
112
|
+
y,
|
|
113
|
+
z,
|
|
114
|
+
w
|
|
115
|
+
],
|
|
116
|
+
referenceFrame: "device",
|
|
117
|
+
screenAngleDeg: currentScreenAngleDeg(),
|
|
118
|
+
timestamp: Date.now()
|
|
119
|
+
};
|
|
120
|
+
});
|
|
121
|
+
created.addEventListener("activate", () => {
|
|
122
|
+
if (created !== sensor) return;
|
|
123
|
+
log.info("active");
|
|
124
|
+
reportStatus({ state: "active" });
|
|
125
|
+
});
|
|
126
|
+
created.addEventListener("error", (event) => {
|
|
127
|
+
if (created !== sensor) return;
|
|
128
|
+
latest = null;
|
|
129
|
+
const reason = event?.error?.name ?? "SensorError";
|
|
130
|
+
log.error("sensor error:", reason);
|
|
131
|
+
reportStatus({
|
|
132
|
+
state: "error",
|
|
133
|
+
reason
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
created.start();
|
|
137
|
+
} catch (err) {
|
|
138
|
+
sensor = null;
|
|
139
|
+
latest = null;
|
|
140
|
+
reportStatus({
|
|
141
|
+
state: "error",
|
|
142
|
+
reason: err?.name ?? String(err)
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
/** Latest reading, or null when unavailable/not-yet-warmed-up. Mirrors getLastDeviceOrientation. */
|
|
147
|
+
function getLatestAbsoluteOrientation() {
|
|
148
|
+
return latest;
|
|
149
|
+
}
|
|
150
|
+
/** Stop the watch and clear cached state. Idempotent. */
|
|
151
|
+
function stopAbsoluteOrientationWatch() {
|
|
152
|
+
watchGeneration++;
|
|
153
|
+
if (sensor) {
|
|
154
|
+
try {
|
|
155
|
+
sensor.stop();
|
|
156
|
+
} catch {}
|
|
157
|
+
sensor = null;
|
|
158
|
+
}
|
|
159
|
+
latest = null;
|
|
160
|
+
}
|
|
161
|
+
//#endregion
|
|
162
|
+
export { getLatestAbsoluteOrientation, isAbsoluteOrientationAvailable, startAbsoluteOrientationWatch, stopAbsoluteOrientationWatch };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
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-
|
|
1
|
+
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-C34GQuTu.js";
|
|
2
2
|
export { GPS_ERROR_CODES, GPS_ERROR_MESSAGES, GPS_ERROR_MESSAGE_UNKNOWN, createGpsErrorHandler, getGpsErrorMessage };
|
package/dist/sensors/gps.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as startOrientationWatch, i as startGpsWatch, n as RawDeviceOrientation, o as stopGpsWatch, r as requestOrientationPermission, s as stopOrientationWatch, t as GpsPosition } from "../gps-
|
|
1
|
+
import { a as startOrientationWatch, i as startGpsWatch, n as RawDeviceOrientation, o as stopGpsWatch, r as requestOrientationPermission, s as stopOrientationWatch, t as GpsPosition } from "../gps-CDKDQokE.js";
|
|
2
2
|
export { GpsPosition, RawDeviceOrientation, requestOrientationPermission, startGpsWatch, startOrientationWatch, stopGpsWatch, stopOrientationWatch };
|
package/dist/sensors/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { a as startOrientationWatch, i as startGpsWatch, n as RawDeviceOrientation, o as stopGpsWatch, r as requestOrientationPermission, s as stopOrientationWatch, t as GpsPosition } from "../gps-
|
|
2
|
-
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-
|
|
3
|
-
import { a as
|
|
4
|
-
|
|
1
|
+
import { a as startOrientationWatch, i as startGpsWatch, n as RawDeviceOrientation, o as stopGpsWatch, r as requestOrientationPermission, s as stopOrientationWatch, t as GpsPosition } from "../gps-CDKDQokE.js";
|
|
2
|
+
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-B-VtjnBA.js";
|
|
3
|
+
import { a as startAbsoluteOrientationWatch, i as isAbsoluteOrientationAvailable, n as AbsoluteOrientationStatus, o as stopAbsoluteOrientationWatch, r as getLatestAbsoluteOrientation, t as AbsoluteOrientationReading } from "../absolute-orientation-BAxc15J6.js";
|
|
4
|
+
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-C34GQuTu.js";
|
|
5
|
+
export { type AbsoluteOrientationReading, type AbsoluteOrientationStatus, GPS_ERROR_CODES, GPS_ERROR_MESSAGES, GPS_ERROR_MESSAGE_UNKNOWN, type GpsPosition, type PermissionCheckResult, type PermissionStatus, type RawDeviceOrientation, checkAllPermissions, checkCameraPermission, checkFileSystemPermission, checkGeolocationPermission, checkOrientationPermission, checkWebXRSupport, createGpsErrorHandler, getGpsErrorMessage, getLatestAbsoluteOrientation, isAbsoluteOrientationAvailable, requestAllPermissions, requestCameraPermission, requestOrientationPermission as requestDeviceOrientationPermission, requestGeolocationPermission, requestOrientationPermission$1 as requestOrientationPermission, requestWebXRWithDepthPermission, resetFileSystemState, setFileSystemState, startAbsoluteOrientationWatch, startGpsWatch, startOrientationWatch, stopAbsoluteOrientationWatch, stopGpsWatch, stopOrientationWatch };
|
package/dist/sensors/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import { getLatestAbsoluteOrientation, isAbsoluteOrientationAvailable, startAbsoluteOrientationWatch, stopAbsoluteOrientationWatch } from "./absolute-orientation.js";
|
|
1
2
|
import { checkAllPermissions, checkCameraPermission, checkFileSystemPermission, checkGeolocationPermission, checkOrientationPermission, checkWebXRSupport, requestAllPermissions, requestCameraPermission, requestGeolocationPermission, requestOrientationPermission as requestOrientationPermission$1, requestWebXRWithDepthPermission, resetFileSystemState, setFileSystemState } from "./permission-checker.js";
|
|
2
3
|
import { requestOrientationPermission, startGpsWatch, startOrientationWatch, stopGpsWatch, stopOrientationWatch } from "./gps.js";
|
|
3
4
|
import { GPS_ERROR_CODES, GPS_ERROR_MESSAGES, GPS_ERROR_MESSAGE_UNKNOWN, createGpsErrorHandler, getGpsErrorMessage } from "./gps-error-handler.js";
|
|
4
|
-
export { GPS_ERROR_CODES, GPS_ERROR_MESSAGES, GPS_ERROR_MESSAGE_UNKNOWN, checkAllPermissions, checkCameraPermission, checkFileSystemPermission, checkGeolocationPermission, checkOrientationPermission, checkWebXRSupport, createGpsErrorHandler, getGpsErrorMessage, requestAllPermissions, requestCameraPermission, requestOrientationPermission as requestDeviceOrientationPermission, requestGeolocationPermission, requestOrientationPermission$1 as requestOrientationPermission, requestWebXRWithDepthPermission, resetFileSystemState, setFileSystemState, startGpsWatch, startOrientationWatch, stopGpsWatch, stopOrientationWatch };
|
|
5
|
+
export { GPS_ERROR_CODES, GPS_ERROR_MESSAGES, GPS_ERROR_MESSAGE_UNKNOWN, checkAllPermissions, checkCameraPermission, checkFileSystemPermission, checkGeolocationPermission, checkOrientationPermission, checkWebXRSupport, createGpsErrorHandler, getGpsErrorMessage, getLatestAbsoluteOrientation, isAbsoluteOrientationAvailable, requestAllPermissions, requestCameraPermission, requestOrientationPermission as requestDeviceOrientationPermission, requestGeolocationPermission, requestOrientationPermission$1 as requestOrientationPermission, requestWebXRWithDepthPermission, resetFileSystemState, setFileSystemState, startAbsoluteOrientationWatch, startGpsWatch, startOrientationWatch, stopAbsoluteOrientationWatch, stopGpsWatch, stopOrientationWatch };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as subscribePermissionChanges, 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, r as PermissionSubscription, s as checkGeolocationPermission, t as PermissionCheckResult, u as requestAllPermissions } from "../permission-checker-
|
|
1
|
+
import { _ as subscribePermissionChanges, 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, r as PermissionSubscription, s as checkGeolocationPermission, t as PermissionCheckResult, u as requestAllPermissions } from "../permission-checker-B-VtjnBA.js";
|
|
2
2
|
export { PermissionCheckResult, PermissionStatus, PermissionSubscription, checkAllPermissions, checkCameraPermission, checkFileSystemPermission, checkGeolocationPermission, checkOrientationPermission, checkWebXRSupport, requestAllPermissions, requestCameraPermission, requestGeolocationPermission, requestOrientationPermission, requestWebXRWithDepthPermission, resetFileSystemState, setFileSystemState, subscribePermissionChanges };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as selectOdometryRotations, i as selectOdometryPositions, n as selectFrameTilesInWebXR, o as selectZeroReference, r as selectGpsPositions, t as selectAlignmentMatrix } from "../app-selectors-
|
|
1
|
+
import { a as selectOdometryRotations, i as selectOdometryPositions, n as selectFrameTilesInWebXR, o as selectZeroReference, r as selectGpsPositions, t as selectAlignmentMatrix } from "../app-selectors-JqydaUMN.js";
|
|
2
2
|
export { selectAlignmentMatrix, selectFrameTilesInWebXR, selectGpsPositions, selectOdometryPositions, selectOdometryRotations, selectZeroReference };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { N as CombinedRootState } from "../create-slam-app-store-D3nzh9Wb.js";
|
|
2
2
|
export { CombinedRootState };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as SlamAppStoreOptions, i as SlamAppStore, n as SlamAppMiddleware, o as createSlamAppStore, r as SlamAppRootState, t as SlamAppCombinedState } from "../create-slam-app-store-
|
|
1
|
+
import { a as SlamAppStoreOptions, i as SlamAppStore, n as SlamAppMiddleware, o as createSlamAppStore, r as SlamAppRootState, t as SlamAppCombinedState } from "../create-slam-app-store-D3nzh9Wb.js";
|
|
2
2
|
export { SlamAppCombinedState, SlamAppMiddleware, SlamAppRootState, SlamAppStore, SlamAppStoreOptions, createSlamAppStore };
|
|
@@ -1,75 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { recordWriteFailure, recordingReducer } from "./recording-slice.js";
|
|
3
|
-
import { createTrackingQualityListenerMiddleware, trackingQualityReducer } from "./tracking-quality.js";
|
|
4
|
-
import { createPersistenceMiddleware, slicePrefixOf } from "./persistence-middleware.js";
|
|
5
|
-
import { arElementsReducer, gpsDataReducer, gpsElementsReducer, sanitizeForDevTools, setZeroPos, validateLicenseKey } from "gps-plus-slam-js";
|
|
6
|
-
import { configureStore } from "@reduxjs/toolkit";
|
|
7
|
-
import { COMMUNITY_LICENSE_KEY } from "gps-plus-slam-js/community-license-key";
|
|
8
|
-
//#region ../src/state/create-slam-app-store.ts
|
|
9
|
-
/**
|
|
10
|
-
* `createSlamAppStore` — composable Redux store factory for AR+GPS apps.
|
|
11
|
-
*
|
|
12
|
-
* Introduced in Iter 1 of the AppFramework/RecorderApp boundary migration.
|
|
13
|
-
* Wires the three library reducers (`gpsData`, `gpsElements`, `arElements`),
|
|
14
|
-
* the framework's recording lifecycle slice, and the persistence middleware.
|
|
15
|
-
*
|
|
16
|
-
* Recorder-only state (routing screen, ref-points, scenario) is plugged in
|
|
17
|
-
* by the consumer via `extraReducers` / `extraMiddleware`. The factory itself
|
|
18
|
-
* never references those concepts so apps that don't need them (POI viewers,
|
|
19
|
-
* navigation arrows, …) compose freely.
|
|
20
|
-
*
|
|
21
|
-
* The legacy `createRecorderStore` from `store.ts` is built on top of this
|
|
22
|
-
* factory and will move out of the framework in Iter 1D.
|
|
23
|
-
*
|
|
24
|
-
* @see docs/2026-05-03-appframework-vs-recorderapp-boundary-analysis.md — Iter 1
|
|
25
|
-
*/
|
|
26
|
-
/**
|
|
27
|
-
* Slice prefixes the framework always persists, derived from the actual
|
|
28
|
-
* library / framework action creators (never hand-typed). A rename of the
|
|
29
|
-
* `gpsData` or `recording` slice therefore propagates here automatically
|
|
30
|
-
* instead of silently dropping that slice's actions from recordings.
|
|
31
|
-
*/
|
|
32
|
-
const BUILTIN_PERSISTED_PREFIXES = [slicePrefixOf(setZeroPos.type), slicePrefixOf(recordWriteFailure.type)];
|
|
33
|
-
/**
|
|
34
|
-
* Build a Redux store wired with library + recording slices, persistence
|
|
35
|
-
* middleware, and any caller-supplied extras. See module docstring for the
|
|
36
|
-
* design rationale.
|
|
37
|
-
*/
|
|
38
|
-
function createSlamAppStore(options) {
|
|
39
|
-
const { storageBackend, extraReducers, extraMiddleware, persistedExtraPrefixes, onWriteFailure, enableDevChecks = true, licenseKey = COMMUNITY_LICENSE_KEY, trackingQualityOptions } = options;
|
|
40
|
-
validateLicenseKey(licenseKey);
|
|
41
|
-
const reducer = {
|
|
42
|
-
gpsData: gpsDataReducer,
|
|
43
|
-
gpsElements: gpsElementsReducer,
|
|
44
|
-
arElements: arElementsReducer,
|
|
45
|
-
recording: recordingReducer,
|
|
46
|
-
tracking: trackingReducer,
|
|
47
|
-
trackingQuality: trackingQualityReducer,
|
|
48
|
-
...extraReducers ?? {}
|
|
49
|
-
};
|
|
50
|
-
const trackingQualityMiddleware = createTrackingQualityListenerMiddleware(trackingQualityOptions);
|
|
51
|
-
const store = configureStore({
|
|
52
|
-
reducer,
|
|
53
|
-
middleware: (getDefaultMiddleware) => getDefaultMiddleware({
|
|
54
|
-
serializableCheck: enableDevChecks,
|
|
55
|
-
immutableCheck: enableDevChecks
|
|
56
|
-
}).prepend(trackingQualityMiddleware).concat(createPersistenceMiddleware({
|
|
57
|
-
storageBackend,
|
|
58
|
-
onWriteFailure,
|
|
59
|
-
persistedPrefixes: [...BUILTIN_PERSISTED_PREFIXES, ...persistedExtraPrefixes ?? []]
|
|
60
|
-
}), ...extraMiddleware ?? []),
|
|
61
|
-
devTools: {
|
|
62
|
-
actionSanitizer: sanitizeForDevTools,
|
|
63
|
-
stateSanitizer: sanitizeForDevTools
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
return {
|
|
67
|
-
getState: () => store.getState(),
|
|
68
|
-
dispatch: store.dispatch,
|
|
69
|
-
subscribe: (listener) => store.subscribe(listener),
|
|
70
|
-
writeFrame: (blob, index) => storageBackend.writeFrame(blob, index),
|
|
71
|
-
writeSessionMetadata: (metadata) => storageBackend.writeSessionMetadata(metadata)
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
//#endregion
|
|
1
|
+
import { t as createSlamAppStore } from "../create-slam-app-store-DXiAnJwR.js";
|
|
75
2
|
export { createSlamAppStore };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as ARPose } from "../ar-types-
|
|
2
|
-
import { o as extractOdomPosition, s as extractOdomRotation } from "../gps-event-coordinator-
|
|
3
|
-
import { i as captureGpsAnchorSample, n as GpsAnchorSample, r as GpsAnchorSampleGpsPoint, t as CaptureGpsAnchorSampleOptions } from "../gps-ar-pose-sampler-
|
|
1
|
+
import { t as ARPose } from "../ar-types-Cc5yvBwn.js";
|
|
2
|
+
import { o as extractOdomPosition, s as extractOdomRotation } from "../gps-event-coordinator-CHtIkhb7.js";
|
|
3
|
+
import { i as captureGpsAnchorSample, n as GpsAnchorSample, r as GpsAnchorSampleGpsPoint, t as CaptureGpsAnchorSampleOptions } from "../gps-ar-pose-sampler-DEGNk2CI.js";
|
|
4
4
|
export { ARPose, CaptureGpsAnchorSampleOptions, GpsAnchorSample, GpsAnchorSampleGpsPoint, captureGpsAnchorSample, extractOdomPosition, extractOdomRotation };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
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
|
|
2
|
-
export { RecordingCoordinatorConfig, buildRawGpsPoint, buildRecordGpsEventPayload, createGpsPositionHandler, eulerToQuaternion, extractOdomPosition, extractOdomRotation, getLastDeviceOrientation, resetCoordinatorState, updateDeviceOrientation };
|
|
1
|
+
import { a as eulerToQuaternion, c as getLastDeviceOrientation, d as updateDeviceOrientation, i as createGpsPositionHandler, l as resetCoordinatorState, n as buildRawGpsPoint, o as extractOdomPosition, r as buildRecordGpsEventPayload, s as extractOdomRotation, t as RecordingCoordinatorConfig, u as toRawAbsoluteOrientation } from "../gps-event-coordinator-CHtIkhb7.js";
|
|
2
|
+
export { RecordingCoordinatorConfig, buildRawGpsPoint, buildRecordGpsEventPayload, createGpsPositionHandler, eulerToQuaternion, extractOdomPosition, extractOdomRotation, getLastDeviceOrientation, resetCoordinatorState, toRawAbsoluteOrientation, updateDeviceOrientation };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger.js";
|
|
2
|
+
import { getLatestAbsoluteOrientation } from "../sensors/absolute-orientation.js";
|
|
2
3
|
import { eulerToQuaternion, getOdometryPositions, getZeroReference, recordGpsEvent, setZeroPos } from "gps-plus-slam-js";
|
|
3
4
|
//#region ../src/state/gps-event-coordinator.ts
|
|
4
5
|
const log = createLogger("RecordingCoordinator");
|
|
@@ -58,15 +59,15 @@ function extractOdomRotation(arPose) {
|
|
|
58
59
|
/**
|
|
59
60
|
* Build a RawGpsPoint from GPS position data.
|
|
60
61
|
* Returns only raw sensor fields — no derived fields (coordinates, weight,
|
|
61
|
-
* zeroRef
|
|
62
|
-
*
|
|
62
|
+
* zeroRef). Derived fields are computed by the library reducer when the
|
|
63
|
+
* action is dispatched (raw-storage pattern).
|
|
63
64
|
*
|
|
64
65
|
* @param gpsPosition - GPS position from Geolocation API
|
|
65
|
-
* @param deviceOrientation -
|
|
66
|
+
* @param deviceOrientation - Accepted for signature stability; no longer
|
|
67
|
+
* read (the legacy `compassAbsolute` field it fed is no longer recorded)
|
|
66
68
|
* @returns RawGpsPoint ready for the action payload
|
|
67
69
|
*/
|
|
68
70
|
function buildRawGpsPoint(gpsPosition, deviceOrientation) {
|
|
69
|
-
const compassAbsolute = deviceOrientation ? deviceOrientation.absolute : void 0;
|
|
70
71
|
return {
|
|
71
72
|
id: `gps-${++gpsEventCounter}`,
|
|
72
73
|
latitude: gpsPosition.lat,
|
|
@@ -76,35 +77,44 @@ function buildRawGpsPoint(gpsPosition, deviceOrientation) {
|
|
|
76
77
|
altitudeAccuracy: gpsPosition.altitudeAccuracy ?? void 0,
|
|
77
78
|
heading: gpsPosition.heading ?? void 0,
|
|
78
79
|
speed: gpsPosition.speed ?? void 0,
|
|
79
|
-
compassAbsolute,
|
|
80
80
|
timestamp: gpsPosition.timestamp
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
|
+
* Map a capture-module {@link AbsoluteOrientationReading} to the library's
|
|
85
|
+
* {@link RawAbsoluteOrientation} payload shape (the only difference is the
|
|
86
|
+
* timestamp field name: capture `timestamp` → payload `sampleTimestamp`).
|
|
87
|
+
* Returns `undefined` when the sensor produced no reading (most non-Chrome).
|
|
88
|
+
*/
|
|
89
|
+
function toRawAbsoluteOrientation(reading) {
|
|
90
|
+
if (!reading) return void 0;
|
|
91
|
+
return {
|
|
92
|
+
quaternion: reading.quaternion,
|
|
93
|
+
referenceFrame: reading.referenceFrame,
|
|
94
|
+
screenAngleDeg: reading.screenAngleDeg,
|
|
95
|
+
sampleTimestamp: reading.timestamp
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
84
99
|
* Build a RecordGpsEventPayload from GPS position and AR pose.
|
|
85
100
|
* This is a pure function for testability.
|
|
86
101
|
*
|
|
87
102
|
* Stores only raw sensor data in the payload. The library reducer
|
|
88
|
-
* computes derived fields (coordinates, weight
|
|
89
|
-
*
|
|
103
|
+
* computes derived fields (coordinates, weight) when the action is
|
|
104
|
+
* processed (raw-storage pattern).
|
|
90
105
|
*
|
|
91
106
|
* @param gpsPosition - GPS position from Geolocation API
|
|
92
107
|
* @param arPose - AR pose from WebXR
|
|
93
108
|
* @param deviceOrientation - Optional device orientation from sensors
|
|
109
|
+
* @param absoluteOrientation - Optional AbsoluteOrientationSensor reading
|
|
94
110
|
* @returns RecordGpsEventPayload ready for dispatch
|
|
95
111
|
*/
|
|
96
|
-
function buildRecordGpsEventPayload(gpsPosition, arPose, deviceOrientation) {
|
|
97
|
-
const rawDeviceOrientation = deviceOrientation?.alpha != null && deviceOrientation?.beta != null && deviceOrientation?.gamma != null ? {
|
|
98
|
-
alpha: deviceOrientation.alpha,
|
|
99
|
-
beta: deviceOrientation.beta,
|
|
100
|
-
gamma: deviceOrientation.gamma,
|
|
101
|
-
absolute: deviceOrientation.absolute
|
|
102
|
-
} : void 0;
|
|
112
|
+
function buildRecordGpsEventPayload(gpsPosition, arPose, deviceOrientation, absoluteOrientation = null) {
|
|
103
113
|
return {
|
|
104
114
|
odomPosition: extractOdomPosition(arPose),
|
|
105
115
|
odomRotation: extractOdomRotation(arPose),
|
|
106
116
|
rawGpsPoint: buildRawGpsPoint(gpsPosition, deviceOrientation),
|
|
107
|
-
|
|
117
|
+
rawAbsoluteOrientation: toRawAbsoluteOrientation(absoluteOrientation)
|
|
108
118
|
};
|
|
109
119
|
}
|
|
110
120
|
/**
|
|
@@ -139,11 +149,11 @@ function createGpsPositionHandler(config) {
|
|
|
139
149
|
log.error("Failed to get zero reference");
|
|
140
150
|
return;
|
|
141
151
|
}
|
|
142
|
-
const payload = buildRecordGpsEventPayload(position, arPose, lastDeviceOrientation);
|
|
152
|
+
const payload = buildRecordGpsEventPayload(position, arPose, lastDeviceOrientation, getLatestAbsoluteOrientation());
|
|
143
153
|
store.dispatch(recordGpsEvent(payload));
|
|
144
154
|
const eventCount = getOdometryPositions(store.getState()).length;
|
|
145
155
|
log.info(`Recorded GPS event #${eventCount}`);
|
|
146
156
|
};
|
|
147
157
|
}
|
|
148
158
|
//#endregion
|
|
149
|
-
export { buildRawGpsPoint, buildRecordGpsEventPayload, createGpsPositionHandler, eulerToQuaternion, extractOdomPosition, extractOdomRotation, getLastDeviceOrientation, resetCoordinatorState, updateDeviceOrientation };
|
|
159
|
+
export { buildRawGpsPoint, buildRecordGpsEventPayload, createGpsPositionHandler, eulerToQuaternion, extractOdomPosition, extractOdomRotation, getLastDeviceOrientation, resetCoordinatorState, toRawAbsoluteOrientation, updateDeviceOrientation };
|
package/dist/state/index.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { i as DepthSample, r as DepthPoint } from "../ar-types-
|
|
2
|
-
import {
|
|
3
|
-
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, r as ResetTransformData, s as originReset, t as DeviceOrientation, u as resetTracking } from "../tracking-slice-
|
|
4
|
-
import { d as QrSizeStatus, l as QrSizeEstimate } from "../qr-size-measurer-
|
|
5
|
-
import { a as QrPoseStability, o as QrPoseStabilityOptions, s as QrPoseStabilityStatus } from "../qr-pose-aggregation-
|
|
6
|
-
import { a as recordWriteFailure, i as recordDepthSample, n as SessionMetadata$1, o as recordingReducer, r as endSession, s as startSession, t as RecordingState } from "../recording-slice-
|
|
7
|
-
import { C as setQrMaxHistory, S as selectStableQrPose, _ as selectQrPoseStability, a as RootWithQrDetected, b as selectResolvedQrSizeM, c as medianQrPosition, d as recordQrDetection, f as recordQrSizeEstimate, g as selectQrMarkers, h as selectQrMarker, i as QrMarkerState, l as pruneQrDetections, m as selectLatestQrDetection, n as QrDetectedState, o as clearAllQrMarkers, p as selectDerivedQrPlacement, r as QrDetectionEntry, s as clearQrMarker, t as DEFAULT_QR_MAX_HISTORY, u as qrDetectedReducer, v as selectQrRawObservations, x as selectSolvedQrPose, y as selectQrSize } from "../qr-detected-slice-
|
|
8
|
-
import { n as SessionMetadata } from "../opfs-storage-
|
|
9
|
-
import { n as StorageBackend } from "../storage-backend-
|
|
10
|
-
import { A as
|
|
11
|
-
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
|
|
12
|
-
import { i as captureGpsAnchorSample, n as GpsAnchorSample, r as GpsAnchorSampleGpsPoint, t as CaptureGpsAnchorSampleOptions } from "../gps-ar-pose-sampler-
|
|
13
|
-
import { n as replayRecording, t as ReplayRecordingOptions } from "../recording-replayer-
|
|
14
|
-
import { n as createPersistenceMiddleware, r as slicePrefixOf, t as PersistenceMiddlewareOptions } from "../persistence-middleware-
|
|
15
|
-
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-
|
|
16
|
-
import { n as subscribeToSelector, t as SubscribableStore } from "../subscribe-to-selector-
|
|
17
|
-
import { n as wireStoreSubscribers, t as StoreSubscriberDeps } from "../store-subscribers-
|
|
18
|
-
import { a as selectOdometryRotations, i as selectOdometryPositions, n as selectFrameTilesInWebXR, o as selectZeroReference, r as selectGpsPositions, t as selectAlignmentMatrix } from "../app-selectors-
|
|
19
|
-
import { a as RawGpsPoint, c as calcRelativeCoordsInMeters, d as OnboardingGuidance, f as OnboardingPhase, i as RawDeviceOrientation, l as recordGpsEvent, m as selectOnboardingGuidance, n as GpsPoint, o as RecordGpsEventPayload, p as computeOnboardingGuidance, r as LatLong, s as add2dImage, t as Add2dImagePayload, u as setZeroPos } from "../index-
|
|
20
|
-
export { Add2dImagePayload, AlignmentSnapshot, CaptureGpsAnchorSampleOptions, CompleteCallback, DEFAULT_MAX_DELAY_MS, DEFAULT_QR_MAX_HISTORY, DEFAULT_RECORDING_OPTIONS, DEFAULT_TRACKING_QUALITY_OPTIONS, DEPTH_CONSTRAINTS, DepthCaptureOptions, DepthPoint, DepthSample, DeviceOrientation, ErrorCallback, GpsAnchorSample, GpsAnchorSampleGpsPoint, GpsPoint, IMAGE_CONSTRAINTS, ImageCaptureOptions, LatLong, OnboardingGuidance, OnboardingPhase, SessionMetadata as OpfsSessionMetadata, PersistenceMiddlewareOptions, PoseReceivedPayload, ProgressCallback, QrDetectedState, QrDetectionEntry, QrMarkerState, QrPoseStability, QrPoseStabilityOptions, QrPoseStabilityStatus, QrSizeEstimate, QrSizeStatus, RawDeviceOrientation, RawGpsPoint, RecordGpsEventPayload, RecordingCoordinatorConfig, RecordingOptionsInput, RecordingState, ReplayAction, ReplayEngine, ReplayRecordingOptions, ReplayState, ResetTransformData, RootWithQrDetected, STORAGE_KEY, SessionMetadata$1 as SessionMetadata, SlamAppCombinedState, SlamAppMiddleware, SlamAppRootState, SlamAppStore, SlamAppStoreOptions, StorageBackend, StoreSubscriberDeps, SubscribableStore, TrackingPhase, TrackingQualityOptions, TrackingQualityReport, TrackingQualitySliceState, TrackingQualityState, TrackingSliceState, add2dImage, buildRawGpsPoint, buildRecordGpsEventPayload, calcRelativeCoordsInMeters, captureGpsAnchorSample, clearAllQrMarkers, clearLastRestartedPayload, clearQrMarker, cloneRecordingOptions,
|
|
1
|
+
import { i as DepthSample, r as DepthPoint } from "../ar-types-Cc5yvBwn.js";
|
|
2
|
+
import { A as validateImageOptions, C as loadRecordingOptions, F as validateRecordingOptions, O as validateDepthOptions, S as cloneRecordingOptions, T as saveRecordingOptions, a as DepthCaptureOptions, b as STORAGE_KEY, c as IMAGE_CONSTRAINTS, i as DEPTH_CONSTRAINTS, l as ImageCaptureOptions, r as DEFAULT_RECORDING_OPTIONS, w as resetRecordingOptions, y as RecordingOptionsInput } from "../recording-options-vASCFzc5.js";
|
|
3
|
+
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, r as ResetTransformData, s as originReset, t as DeviceOrientation, u as resetTracking } from "../tracking-slice-DMkHlbny.js";
|
|
4
|
+
import { d as QrSizeStatus, l as QrSizeEstimate } from "../qr-size-measurer-DxiMqRUw.js";
|
|
5
|
+
import { a as QrPoseStability, o as QrPoseStabilityOptions, s as QrPoseStabilityStatus } from "../qr-pose-aggregation-CypnmjA-.js";
|
|
6
|
+
import { a as recordWriteFailure, i as recordDepthSample, n as SessionMetadata$1, o as recordingReducer, r as endSession, s as startSession, t as RecordingState } from "../recording-slice-DTUtSVgd.js";
|
|
7
|
+
import { C as setQrMaxHistory, S as selectStableQrPose, _ as selectQrPoseStability, a as RootWithQrDetected, b as selectResolvedQrSizeM, c as medianQrPosition, d as recordQrDetection, f as recordQrSizeEstimate, g as selectQrMarkers, h as selectQrMarker, i as QrMarkerState, l as pruneQrDetections, m as selectLatestQrDetection, n as QrDetectedState, o as clearAllQrMarkers, p as selectDerivedQrPlacement, r as QrDetectionEntry, s as clearQrMarker, t as DEFAULT_QR_MAX_HISTORY, u as qrDetectedReducer, v as selectQrRawObservations, x as selectSolvedQrPose, y as selectQrSize } from "../qr-detected-slice-TzVb8bij.js";
|
|
8
|
+
import { n as SessionMetadata } from "../opfs-storage-CTkxvxN4.js";
|
|
9
|
+
import { n as StorageBackend } from "../storage-backend-sEtmM4yW.js";
|
|
10
|
+
import { A as snapshotPushed, C as createTrackingQualityListenerMiddleware, D as resetTrackingQuality, E as reportUpdated, M as trackingQualityReducer, O as selectRecentAlignments, S as computeTrackingQualityReport, T as matrixDelta, _ as computeConvergence, a as SlamAppStoreOptions, b as computeGpsVsFusedDivergence, g as TrackingQualityState, h as TrackingQualitySliceState, i as SlamAppStore, j as snapshotsTrimmed, k as selectTrackingQuality, m as TrackingQualityReport, n as SlamAppMiddleware, o as createSlamAppStore, p as TrackingQualityOptions, r as SlamAppRootState, s as AlignmentSnapshot, t as SlamAppCombinedState, u as DEFAULT_TRACKING_QUALITY_OPTIONS, v as computeCoverage, w as degradedCountUpdated, x as computeResidualConsensus, y as computeGpsAccuracy } from "../create-slam-app-store-D3nzh9Wb.js";
|
|
11
|
+
import { a as eulerToQuaternion, c as getLastDeviceOrientation, d as updateDeviceOrientation, i as createGpsPositionHandler, l as resetCoordinatorState, n as buildRawGpsPoint, o as extractOdomPosition, r as buildRecordGpsEventPayload, s as extractOdomRotation, t as RecordingCoordinatorConfig } from "../gps-event-coordinator-CHtIkhb7.js";
|
|
12
|
+
import { i as captureGpsAnchorSample, n as GpsAnchorSample, r as GpsAnchorSampleGpsPoint, t as CaptureGpsAnchorSampleOptions } from "../gps-ar-pose-sampler-DEGNk2CI.js";
|
|
13
|
+
import { n as replayRecording, t as ReplayRecordingOptions } from "../recording-replayer-D0V9WkmY.js";
|
|
14
|
+
import { n as createPersistenceMiddleware, r as slicePrefixOf, t as PersistenceMiddlewareOptions } from "../persistence-middleware-CG-t08X4.js";
|
|
15
|
+
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-xdrUgWJi.js";
|
|
16
|
+
import { n as subscribeToSelector, t as SubscribableStore } from "../subscribe-to-selector-B9ylM5Oh.js";
|
|
17
|
+
import { n as wireStoreSubscribers, t as StoreSubscriberDeps } from "../store-subscribers-DScA7tdT.js";
|
|
18
|
+
import { a as selectOdometryRotations, i as selectOdometryPositions, n as selectFrameTilesInWebXR, o as selectZeroReference, r as selectGpsPositions, t as selectAlignmentMatrix } from "../app-selectors-JqydaUMN.js";
|
|
19
|
+
import { a as RawGpsPoint, c as calcRelativeCoordsInMeters, d as OnboardingGuidance, f as OnboardingPhase, i as RawDeviceOrientation, l as recordGpsEvent, m as selectOnboardingGuidance, n as GpsPoint, o as RecordGpsEventPayload, p as computeOnboardingGuidance, r as LatLong, s as add2dImage, t as Add2dImagePayload, u as setZeroPos } from "../index-DlsOo2IB.js";
|
|
20
|
+
export { Add2dImagePayload, AlignmentSnapshot, CaptureGpsAnchorSampleOptions, CompleteCallback, DEFAULT_MAX_DELAY_MS, DEFAULT_QR_MAX_HISTORY, DEFAULT_RECORDING_OPTIONS, DEFAULT_TRACKING_QUALITY_OPTIONS, DEPTH_CONSTRAINTS, DepthCaptureOptions, DepthPoint, DepthSample, DeviceOrientation, ErrorCallback, GpsAnchorSample, GpsAnchorSampleGpsPoint, GpsPoint, IMAGE_CONSTRAINTS, ImageCaptureOptions, LatLong, OnboardingGuidance, OnboardingPhase, SessionMetadata as OpfsSessionMetadata, PersistenceMiddlewareOptions, PoseReceivedPayload, ProgressCallback, QrDetectedState, QrDetectionEntry, QrMarkerState, QrPoseStability, QrPoseStabilityOptions, QrPoseStabilityStatus, QrSizeEstimate, QrSizeStatus, RawDeviceOrientation, RawGpsPoint, RecordGpsEventPayload, RecordingCoordinatorConfig, RecordingOptionsInput, RecordingState, ReplayAction, ReplayEngine, ReplayRecordingOptions, ReplayState, ResetTransformData, RootWithQrDetected, STORAGE_KEY, SessionMetadata$1 as SessionMetadata, SlamAppCombinedState, SlamAppMiddleware, SlamAppRootState, SlamAppStore, SlamAppStoreOptions, StorageBackend, StoreSubscriberDeps, SubscribableStore, TrackingPhase, TrackingQualityOptions, TrackingQualityReport, TrackingQualitySliceState, TrackingQualityState, TrackingSliceState, add2dImage, buildRawGpsPoint, buildRecordGpsEventPayload, calcRelativeCoordsInMeters, captureGpsAnchorSample, clearAllQrMarkers, clearLastRestartedPayload, clearQrMarker, cloneRecordingOptions, computeConvergence, computeCoverage, computeGpsAccuracy, computeGpsVsFusedDivergence, computeInterActionDelay, computeOnboardingGuidance, computeResidualConsensus, computeTrackingQualityReport, createGpsPositionHandler, createPersistenceMiddleware, createSlamAppStore, createTrackingQualityListenerMiddleware, degradedCountUpdated, endSession, eulerToQuaternion, extractActionTimestamp, extractOdomPosition, extractOdomRotation, getLastDeviceOrientation, loadRecordingOptions, matrixDelta, medianQrPosition, originReset, poseLost, poseReceived, pruneQrDetections, qrDetectedReducer, recordDepthSample, recordGpsEvent, recordQrDetection, recordQrSizeEstimate, recordWriteFailure, recordingReducer, replayRecording, reportUpdated, resetCoordinatorState, resetRecordingOptions, resetTracking, resetTrackingQuality, saveRecordingOptions, selectAlignmentMatrix, selectDerivedQrPlacement, selectFrameTilesInWebXR, selectGpsPositions, selectLastRestartedPayload, selectLastSensorOrientation, selectLastValidPose, selectLatestQrDetection, selectLostFrameCount, selectOdometryPositions, selectOdometryRotations, selectOnboardingGuidance, selectQrMarker, selectQrMarkers, selectQrPoseStability, selectQrRawObservations, selectQrSize, selectRecentAlignments, selectResolvedQrSizeM, selectSolvedQrPose, selectStableQrPose, selectTrackingPhase, selectTrackingQuality, selectZeroReference, setQrMaxHistory, setZeroPos, slicePrefixOf, snapshotPushed, snapshotsTrimmed, startSession, subscribeToSelector, trackingQualityReducer, trackingReducer, updateDeviceOrientation, validateDepthOptions, validateImageOptions, validateRecordingOptions, wireStoreSubscribers };
|
package/dist/state/index.js
CHANGED
|
@@ -5,12 +5,12 @@ import { endSession, recordDepthSample, recordWriteFailure, recordingReducer, st
|
|
|
5
5
|
import { DEFAULT_QR_MAX_HISTORY, clearAllQrMarkers, clearQrMarker, medianQrPosition, pruneQrDetections, qrDetectedReducer, recordQrDetection, recordQrSizeEstimate, selectDerivedQrPlacement, selectLatestQrDetection, selectQrMarker, selectQrMarkers, selectQrPoseStability, selectQrRawObservations, selectQrSize, selectResolvedQrSizeM, selectSolvedQrPose, selectStableQrPose, setQrMaxHistory } from "./qr-detected-slice.js";
|
|
6
6
|
import { captureGpsAnchorSample } from "./gps-ar-pose-sampler.js";
|
|
7
7
|
import { selectAlignmentMatrix, selectFrameTilesInWebXR, selectGpsPositions, selectOdometryPositions, selectOdometryRotations, selectZeroReference } from "./app-selectors.js";
|
|
8
|
-
import { DEFAULT_TRACKING_QUALITY_OPTIONS,
|
|
8
|
+
import { DEFAULT_TRACKING_QUALITY_OPTIONS, computeConvergence, computeCoverage, computeGpsAccuracy, computeGpsVsFusedDivergence, computeResidualConsensus, computeTrackingQualityReport, createTrackingQualityListenerMiddleware, degradedCountUpdated, matrixDelta, reportUpdated, resetTrackingQuality, selectRecentAlignments, selectTrackingQuality, snapshotPushed, snapshotsTrimmed, trackingQualityReducer } from "./tracking-quality.js";
|
|
9
9
|
import { createPersistenceMiddleware, slicePrefixOf } from "./persistence-middleware.js";
|
|
10
|
-
import { createSlamAppStore } from "
|
|
10
|
+
import { t as createSlamAppStore } from "../create-slam-app-store-DXiAnJwR.js";
|
|
11
11
|
import { replayRecording } from "./recording-replayer.js";
|
|
12
12
|
import { DEFAULT_MAX_DELAY_MS, ReplayEngine, computeInterActionDelay, extractActionTimestamp } from "./replay-engine.js";
|
|
13
13
|
import { subscribeToSelector } from "./subscribe-to-selector.js";
|
|
14
14
|
import { wireStoreSubscribers } from "./store-subscribers.js";
|
|
15
|
-
import { a as computeOnboardingGuidance, i as setZeroPos, n as calcRelativeCoordsInMeters, o as selectOnboardingGuidance, r as recordGpsEvent, t as add2dImage } from "../state-
|
|
16
|
-
export { DEFAULT_MAX_DELAY_MS, DEFAULT_QR_MAX_HISTORY, DEFAULT_RECORDING_OPTIONS, DEFAULT_TRACKING_QUALITY_OPTIONS, DEPTH_CONSTRAINTS, IMAGE_CONSTRAINTS, ReplayEngine, STORAGE_KEY, add2dImage, buildRawGpsPoint, buildRecordGpsEventPayload, calcRelativeCoordsInMeters, captureGpsAnchorSample, clearAllQrMarkers, clearLastRestartedPayload, clearQrMarker, cloneRecordingOptions,
|
|
15
|
+
import { a as computeOnboardingGuidance, i as setZeroPos, n as calcRelativeCoordsInMeters, o as selectOnboardingGuidance, r as recordGpsEvent, t as add2dImage } from "../state-BeKvn4B-.js";
|
|
16
|
+
export { DEFAULT_MAX_DELAY_MS, DEFAULT_QR_MAX_HISTORY, DEFAULT_RECORDING_OPTIONS, DEFAULT_TRACKING_QUALITY_OPTIONS, DEPTH_CONSTRAINTS, IMAGE_CONSTRAINTS, ReplayEngine, STORAGE_KEY, add2dImage, buildRawGpsPoint, buildRecordGpsEventPayload, calcRelativeCoordsInMeters, captureGpsAnchorSample, clearAllQrMarkers, clearLastRestartedPayload, clearQrMarker, cloneRecordingOptions, computeConvergence, computeCoverage, computeGpsAccuracy, computeGpsVsFusedDivergence, computeInterActionDelay, computeOnboardingGuidance, computeResidualConsensus, computeTrackingQualityReport, createGpsPositionHandler, createPersistenceMiddleware, createSlamAppStore, createTrackingQualityListenerMiddleware, degradedCountUpdated, endSession, eulerToQuaternion, extractActionTimestamp, extractOdomPosition, extractOdomRotation, getLastDeviceOrientation, loadRecordingOptions, matrixDelta, medianQrPosition, originReset, poseLost, poseReceived, pruneQrDetections, qrDetectedReducer, recordDepthSample, recordGpsEvent, recordQrDetection, recordQrSizeEstimate, recordWriteFailure, recordingReducer, replayRecording, reportUpdated, resetCoordinatorState, resetRecordingOptions, resetTracking, resetTrackingQuality, saveRecordingOptions, selectAlignmentMatrix, selectDerivedQrPlacement, selectFrameTilesInWebXR, selectGpsPositions, selectLastRestartedPayload, selectLastSensorOrientation, selectLastValidPose, selectLatestQrDetection, selectLostFrameCount, selectOdometryPositions, selectOdometryRotations, selectOnboardingGuidance, selectQrMarker, selectQrMarkers, selectQrPoseStability, selectQrRawObservations, selectQrSize, selectRecentAlignments, selectResolvedQrSizeM, selectSolvedQrPose, selectStableQrPose, selectTrackingPhase, selectTrackingQuality, selectZeroReference, setQrMaxHistory, setZeroPos, slicePrefixOf, snapshotPushed, snapshotsTrimmed, startSession, subscribeToSelector, trackingQualityReducer, trackingReducer, updateDeviceOrientation, validateDepthOptions, validateImageOptions, validateRecordingOptions, wireStoreSubscribers };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as createPersistenceMiddleware, r as slicePrefixOf, t as PersistenceMiddlewareOptions } from "../persistence-middleware-
|
|
1
|
+
import { n as createPersistenceMiddleware, r as slicePrefixOf, t as PersistenceMiddlewareOptions } from "../persistence-middleware-CG-t08X4.js";
|
|
2
2
|
export { PersistenceMiddlewareOptions, createPersistenceMiddleware, slicePrefixOf };
|
|
@@ -77,27 +77,38 @@ function createPersistenceMiddleware(options) {
|
|
|
77
77
|
const excludedActionType = recordWriteFailure.type;
|
|
78
78
|
let actionIndex = 0;
|
|
79
79
|
const writeQueue = new WriteQueue();
|
|
80
|
+
let dispatchDepth = 0;
|
|
81
|
+
let hasWarnedReentrant = false;
|
|
80
82
|
const middleware = (store) => (next) => (action) => {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
log.error("Failed to persist action:", normalized);
|
|
96
|
-
store.dispatch(recordWriteFailure(normalized.message));
|
|
97
|
-
if (onWriteFailure) onWriteFailure(normalized);
|
|
83
|
+
dispatchDepth += 1;
|
|
84
|
+
try {
|
|
85
|
+
const typedAction = action;
|
|
86
|
+
const actionType = typeof typedAction.type === "string" ? typedAction.type : null;
|
|
87
|
+
const wasRecording = readIsRecording(store.getState());
|
|
88
|
+
const result = next(action);
|
|
89
|
+
if (!actionType) return result;
|
|
90
|
+
if (actionType === startSession.type) actionIndex = 0;
|
|
91
|
+
if (!isInPersistableSession(wasRecording, readIsRecording(store.getState()), actionType)) return result;
|
|
92
|
+
if (!(actionType !== excludedActionType && normalizedPrefixes.some((prefix) => actionType.startsWith(prefix)))) return result;
|
|
93
|
+
const index = ++actionIndex;
|
|
94
|
+
if (dispatchDepth > 1 && !hasWarnedReentrant) {
|
|
95
|
+
hasWarnedReentrant = true;
|
|
96
|
+
log.warn(`Persisted action "${actionType}" was dispatched re-entrantly (inside another dispatch's next()). Its recorded order can invert on replay — react to actions via a prepended listener middleware, not a synchronous store.subscribe dispatch. See 2026-06-28-subscriber-dispatch-persistence-ordering-review.md.`);
|
|
98
97
|
}
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
writeQueue.enqueue(async () => {
|
|
99
|
+
try {
|
|
100
|
+
await storageBackend.writeAction(typedAction, index);
|
|
101
|
+
} catch (err) {
|
|
102
|
+
const normalized = err instanceof Error ? err : new Error(String(err));
|
|
103
|
+
log.error("Failed to persist action:", normalized);
|
|
104
|
+
store.dispatch(recordWriteFailure(normalized.message));
|
|
105
|
+
if (onWriteFailure) onWriteFailure(normalized);
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
return result;
|
|
109
|
+
} finally {
|
|
110
|
+
dispatchDepth -= 1;
|
|
111
|
+
}
|
|
101
112
|
};
|
|
102
113
|
return middleware;
|
|
103
114
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as QrSizeStatus, l as QrSizeEstimate } from "../qr-size-measurer-
|
|
2
|
-
import { a as QrPoseStability, o as QrPoseStabilityOptions, s as QrPoseStabilityStatus } from "../qr-pose-aggregation-
|
|
3
|
-
import { C as setQrMaxHistory, S as selectStableQrPose, _ as selectQrPoseStability, a as RootWithQrDetected, b as selectResolvedQrSizeM, c as medianQrPosition, d as recordQrDetection, f as recordQrSizeEstimate, g as selectQrMarkers, h as selectQrMarker, i as QrMarkerState, l as pruneQrDetections, m as selectLatestQrDetection, n as QrDetectedState, o as clearAllQrMarkers, p as selectDerivedQrPlacement, r as QrDetectionEntry, s as clearQrMarker, t as DEFAULT_QR_MAX_HISTORY, u as qrDetectedReducer, v as selectQrRawObservations, x as selectSolvedQrPose, y as selectQrSize } from "../qr-detected-slice-
|
|
1
|
+
import { d as QrSizeStatus, l as QrSizeEstimate } from "../qr-size-measurer-DxiMqRUw.js";
|
|
2
|
+
import { a as QrPoseStability, o as QrPoseStabilityOptions, s as QrPoseStabilityStatus } from "../qr-pose-aggregation-CypnmjA-.js";
|
|
3
|
+
import { C as setQrMaxHistory, S as selectStableQrPose, _ as selectQrPoseStability, a as RootWithQrDetected, b as selectResolvedQrSizeM, c as medianQrPosition, d as recordQrDetection, f as recordQrSizeEstimate, g as selectQrMarkers, h as selectQrMarker, i as QrMarkerState, l as pruneQrDetections, m as selectLatestQrDetection, n as QrDetectedState, o as clearAllQrMarkers, p as selectDerivedQrPlacement, r as QrDetectionEntry, s as clearQrMarker, t as DEFAULT_QR_MAX_HISTORY, u as qrDetectedReducer, v as selectQrRawObservations, x as selectSolvedQrPose, y as selectQrSize } from "../qr-detected-slice-TzVb8bij.js";
|
|
4
4
|
export { DEFAULT_QR_MAX_HISTORY, QrDetectedState, QrDetectionEntry, QrMarkerState, QrPoseStability, QrPoseStabilityOptions, QrPoseStabilityStatus, QrSizeEstimate, QrSizeStatus, RootWithQrDetected, clearAllQrMarkers, clearQrMarker, medianQrPosition, pruneQrDetections, qrDetectedReducer, recordQrDetection, recordQrSizeEstimate, selectDerivedQrPlacement, selectLatestQrDetection, selectQrMarker, selectQrMarkers, selectQrPoseStability, selectQrRawObservations, selectQrSize, selectResolvedQrSizeM, selectSolvedQrPose, selectStableQrPose, setQrMaxHistory };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { deriveQrPlacement, deriveSolvedQrPose } from "../ar/qr-derived-pose.js";
|
|
2
|
-
import { i as evaluateQrPoseStability } from "../qr-pose-aggregation-
|
|
2
|
+
import { i as evaluateQrPoseStability } from "../qr-pose-aggregation-DBiaLW0O.js";
|
|
3
3
|
import { createSlice } from "@reduxjs/toolkit";
|
|
4
4
|
//#region ../src/state/qr-detected-slice.ts
|
|
5
5
|
/**
|