gps-plus-slam-app-framework 1.0.0 → 1.0.6
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/{app-selectors-DyMzxCEC.d.ts → app-selectors-CHt7DLuq.d.ts} +9 -8
- package/dist/ar/depth-sampler.js +1 -1
- package/dist/ar/tracking-state.js +1 -1
- package/dist/ar/webxr-session.js +1 -1
- package/dist/combined-root-state-B3SvPNjU.d.ts +6 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +2 -0
- package/dist/create-slam-app-store-DBm7g2Zd.d.ts +85 -0
- package/dist/file-system-DD5TczSO.d.ts +84 -0
- package/dist/geo/h3-proximity.d.ts +2 -0
- package/dist/{ref-points/h3-ref-point.js → geo/h3-proximity.js} +16 -12
- package/dist/geo/index.d.ts +2 -0
- package/dist/geo/index.js +2 -0
- package/dist/gps-anchored-mesh-manager-CovAFK4g.d.ts +56 -0
- package/dist/gps-ar-pose-sampler-D_Zso40V.d.ts +43 -0
- package/dist/{recording-coordinator-DzflP07_.d.ts → gps-event-coordinator-fwvmVfku.d.ts} +6 -5
- package/dist/{h3-ref-point-CFhayNSZ.d.ts → h3-proximity-GwesPTFT.d.ts} +16 -12
- package/dist/index.d.ts +31 -34
- package/dist/index.js +14 -19
- package/dist/{leaflet-map-overlay-CvfQXTye.d.ts → leaflet-map-overlay-CQZcnxbc.d.ts} +10 -6
- package/dist/licensing/index.d.ts +1 -1
- package/dist/licensing/index.js +1 -1
- package/dist/{null-storage-backend-CsWvQwN8.d.ts → null-storage-backend-C0TiwwzQ.d.ts} +4 -2
- package/dist/{opfs-storage-ChOzF_Wp.d.ts → opfs-storage-Dlq1I_Gb.d.ts} +54 -51
- package/dist/opfs-storage-backend-Gt3rd76D.d.ts +13 -0
- package/dist/{persistence-middleware-DrptY02i.d.ts → persistence-middleware-z-75iisb.d.ts} +4 -4
- package/dist/{recording-replayer-oOzPITrd.d.ts → recording-replayer-BFhFs7Mc.d.ts} +2 -2
- package/dist/recording-slice-BiktUIWF.d.ts +28 -0
- package/dist/{replay-engine-DuX316ae.d.ts → replay-engine-B88Va62x.d.ts} +4 -1
- package/dist/sensors/gps-error-handler.d.ts +1 -1
- package/dist/sensors/gps.d.ts +1 -1
- package/dist/sensors/index.d.ts +3 -3
- package/dist/sensors/index.js +1 -1
- package/dist/sensors/permission-checker.d.ts +1 -1
- package/dist/state/app-selectors.d.ts +1 -1
- package/dist/state/create-slam-app-store.d.ts +2 -0
- package/dist/state/create-slam-app-store.js +61 -0
- package/dist/state/gps-ar-pose-sampler.d.ts +4 -0
- package/dist/state/gps-ar-pose-sampler.js +19 -0
- package/dist/state/{recording-coordinator.d.ts → gps-event-coordinator.d.ts} +1 -1
- package/dist/state/{recording-coordinator.js → gps-event-coordinator.js} +3 -4
- package/dist/state/index.d.ts +15 -16
- package/dist/state/index.js +7 -7
- package/dist/state/persistence-middleware.d.ts +1 -1
- package/dist/state/persistence-middleware.js +8 -8
- package/dist/state/recording-replayer.d.ts +3 -2
- package/dist/state/recording-replayer.js +2 -2
- package/dist/state/recording-slice.d.ts +2 -0
- package/dist/state/{recorder-slice.js → recording-slice.js} +7 -15
- package/dist/state/replay-engine.d.ts +1 -1
- package/dist/state/replay-engine.js +3 -3
- package/dist/state/store-subscribers.d.ts +2 -2
- package/dist/state/store-subscribers.js +1 -9
- package/dist/state/subscribe-to-selector.d.ts +1 -1
- package/dist/storage/file-system-utils.d.ts +1 -1
- package/dist/storage/file-system.d.ts +2 -2
- package/dist/storage/file-system.js +103 -94
- package/dist/storage/index.d.ts +9 -11
- package/dist/storage/index.js +5 -7
- package/dist/storage/null-storage-backend.d.ts +1 -1
- package/dist/storage/null-storage-backend.js +7 -0
- package/dist/storage/opfs-storage-backend.d.ts +1 -1
- package/dist/storage/opfs-storage-backend.js +7 -1
- package/dist/storage/opfs-storage.d.ts +2 -2
- package/dist/storage/opfs-storage.js +69 -85
- package/dist/storage/storage-backend.d.ts +2 -2
- package/dist/storage/zip-export.d.ts +2 -2
- package/dist/storage/zip-export.js +55 -62
- package/dist/storage/zip-reader.d.ts +2 -2
- package/dist/storage/zip-reader.js +24 -1
- package/dist/storage-backend-yVnuWGTr.d.ts +28 -0
- package/dist/{store-subscribers-CuoIzB5T.d.ts → store-subscribers-DKKHld49.d.ts} +1 -2
- package/dist/{subscribe-to-selector-UTZ0KkAc.d.ts → subscribe-to-selector-ghDKYtap.d.ts} +1 -1
- package/dist/test-utils/zip-round-trip-helpers.d.ts +1 -1
- package/dist/test-utils/zip-round-trip-helpers.js +4 -4
- package/dist/visualization/gps-anchored-mesh-manager.d.ts +2 -0
- package/dist/visualization/gps-anchored-mesh-manager.js +128 -0
- package/dist/visualization/gps-compass-cubes.d.ts +1 -1
- package/dist/visualization/gps-event-markers.d.ts +1 -1
- package/dist/visualization/index.d.ts +9 -9
- package/dist/visualization/index.js +2 -2
- package/dist/visualization/leaflet-map-overlay.d.ts +1 -1
- package/dist/visualization/leaflet-map-overlay.js +23 -19
- package/dist/visualization/lerp-utils.d.ts +1 -1
- package/dist/visualization/map-overlay.d.ts +1 -1
- package/dist/visualization/three-dispose.d.ts +1 -1
- package/dist/visualization/vis-colors.d.ts +1 -1
- package/dist/{zip-export-Rtpi75JJ.d.ts → zip-export-BjrQPv0X.d.ts} +58 -7
- package/dist/{zip-reader-D7pkpX8K.d.ts → zip-reader-KgJEXbca.d.ts} +33 -1
- package/package.json +15 -4
- package/dist/community-license-key-ChZLCJyO.d.ts +0 -21
- package/dist/file-system-BsQgYCU3.d.ts +0 -128
- package/dist/licensing/community-license-key.d.ts +0 -2
- package/dist/licensing/community-license-key.js +0 -21
- package/dist/opfs-storage-backend-CVcmfJHN.d.ts +0 -11
- package/dist/recorder-slice-fcwAXrsh.d.ts +0 -35
- package/dist/ref-point-importer-B_wn5ABk.d.ts +0 -62
- package/dist/ref-point-loader-Pt1smgHS.d.ts +0 -117
- package/dist/ref-points/h3-ref-point.d.ts +0 -2
- package/dist/ref-points/index.d.ts +0 -2
- package/dist/ref-points/index.js +0 -2
- package/dist/ref-points-slice-tC-Wd6XJ.d.ts +0 -48
- package/dist/reference-points-CFWy8_wj.d.ts +0 -68
- package/dist/routing-slice-BlHTM8eh.d.ts +0 -23
- package/dist/state/recorder-slice.d.ts +0 -2
- package/dist/state/ref-points-slice.d.ts +0 -2
- package/dist/state/ref-points-slice.js +0 -44
- package/dist/state/routing-slice.d.ts +0 -2
- package/dist/state/routing-slice.js +0 -13
- package/dist/state/store.d.ts +0 -9
- package/dist/state/store.js +0 -71
- package/dist/storage/ref-point-importer.d.ts +0 -2
- package/dist/storage/ref-point-importer.js +0 -163
- package/dist/storage/ref-point-loader.d.ts +0 -2
- package/dist/storage/ref-point-loader.js +0 -248
- package/dist/storage/ref-point-recovery.d.ts +0 -28
- package/dist/storage/ref-point-recovery.js +0 -159
- package/dist/storage-backend-BcEItnFr.d.ts +0 -20
- package/dist/store-C7PKOj8S.d.ts +0 -96
- package/dist/visualization/reference-points.d.ts +0 -2
- package/dist/visualization/reference-points.js +0 -160
- /package/dist/{file-system-utils-5cWO8Xyv.d.ts → file-system-utils-BH8FdyIu.d.ts} +0 -0
- /package/dist/{gps-Ddzr2KlX.d.ts → gps-GKc6_Cly.d.ts} +0 -0
- /package/dist/{gps-compass-cubes-C-6JEnpR.d.ts → gps-compass-cubes-jRIJMOuh.d.ts} +0 -0
- /package/dist/{gps-error-handler-VPuNOuf8.d.ts → gps-error-handler-CH1S528z.d.ts} +0 -0
- /package/dist/{gps-event-markers-DpEy2qRd.d.ts → gps-event-markers-sVyO9utS.d.ts} +0 -0
- /package/dist/{lerp-utils-87NWjUOD.d.ts → lerp-utils-CZgQlrmu.d.ts} +0 -0
- /package/dist/{map-overlay-DuiZuCTx.d.ts → map-overlay-C9ifl_4-.d.ts} +0 -0
- /package/dist/{permission-checker-jO2ziCWC.d.ts → permission-checker-Cu3nbH1S.d.ts} +0 -0
- /package/dist/{three-dispose-CCBHjE_a.d.ts → three-dispose-qt_r5wR1.d.ts} +0 -0
- /package/dist/{vis-colors-Qi2vlRGt.d.ts → vis-colors-BKkdTIKb.d.ts} +0 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { r as SlamAppRootState } from "./create-slam-app-store-DBm7g2Zd.js";
|
|
2
|
+
import { t as CombinedRootState } from "./combined-root-state-B3SvPNjU.js";
|
|
3
3
|
import * as _$gps_plus_slam_js0 from "gps-plus-slam-js";
|
|
4
4
|
import { GpsPoint, LatLong, Matrix4, Quaternion, ReferencePoint, Vector3 } from "gps-plus-slam-js";
|
|
5
|
+
import * as _$_reduxjs_toolkit0 from "@reduxjs/toolkit";
|
|
5
6
|
|
|
6
7
|
//#region ../src/state/app-selectors.d.ts
|
|
7
8
|
/** Alignment matrix (4×4), or null if not yet computed. */
|
|
8
|
-
declare const selectAlignmentMatrix: ((state:
|
|
9
|
+
declare const selectAlignmentMatrix: ((state: SlamAppRootState & {}) => Matrix4 | null) & {
|
|
9
10
|
clearCache: () => void;
|
|
10
11
|
resultsCount: () => number;
|
|
11
12
|
resetResultsCount: () => void;
|
|
@@ -27,7 +28,7 @@ declare const selectAlignmentMatrix: ((state: CombinedRootState) => Matrix4 | nu
|
|
|
27
28
|
argsMemoize: typeof _$_reduxjs_toolkit0.weakMapMemoize;
|
|
28
29
|
};
|
|
29
30
|
/** Recorded GPS positions with metadata. */
|
|
30
|
-
declare const selectGpsPositions: ((state:
|
|
31
|
+
declare const selectGpsPositions: ((state: SlamAppRootState & {}) => readonly GpsPoint[]) & {
|
|
31
32
|
clearCache: () => void;
|
|
32
33
|
resultsCount: () => number;
|
|
33
34
|
resetResultsCount: () => void;
|
|
@@ -49,7 +50,7 @@ declare const selectGpsPositions: ((state: CombinedRootState) => readonly GpsPoi
|
|
|
49
50
|
argsMemoize: typeof _$_reduxjs_toolkit0.weakMapMemoize;
|
|
50
51
|
};
|
|
51
52
|
/** Recorded odometry positions (AR-local space). */
|
|
52
|
-
declare const selectOdometryPositions: ((state:
|
|
53
|
+
declare const selectOdometryPositions: ((state: SlamAppRootState & {}) => readonly Vector3[]) & {
|
|
53
54
|
clearCache: () => void;
|
|
54
55
|
resultsCount: () => number;
|
|
55
56
|
resetResultsCount: () => void;
|
|
@@ -71,7 +72,7 @@ declare const selectOdometryPositions: ((state: CombinedRootState) => readonly V
|
|
|
71
72
|
argsMemoize: typeof _$_reduxjs_toolkit0.weakMapMemoize;
|
|
72
73
|
};
|
|
73
74
|
/** Recorded odometry rotations (AR-local space). */
|
|
74
|
-
declare const selectOdometryRotations: ((state:
|
|
75
|
+
declare const selectOdometryRotations: ((state: SlamAppRootState & {}) => readonly Quaternion[]) & {
|
|
75
76
|
clearCache: () => void;
|
|
76
77
|
resultsCount: () => number;
|
|
77
78
|
resetResultsCount: () => void;
|
|
@@ -93,7 +94,7 @@ declare const selectOdometryRotations: ((state: CombinedRootState) => readonly Q
|
|
|
93
94
|
argsMemoize: typeof _$_reduxjs_toolkit0.weakMapMemoize;
|
|
94
95
|
};
|
|
95
96
|
/** GPS zero reference (origin for coordinate conversion), or null. */
|
|
96
|
-
declare const selectZeroReference: ((state:
|
|
97
|
+
declare const selectZeroReference: ((state: SlamAppRootState & {}) => LatLong | null) & {
|
|
97
98
|
clearCache: () => void;
|
|
98
99
|
resultsCount: () => number;
|
|
99
100
|
resetResultsCount: () => void;
|
|
@@ -115,7 +116,7 @@ declare const selectZeroReference: ((state: CombinedRootState) => LatLong | null
|
|
|
115
116
|
argsMemoize: typeof _$_reduxjs_toolkit0.weakMapMemoize;
|
|
116
117
|
};
|
|
117
118
|
/** User-defined reference points for ground truth validation. */
|
|
118
|
-
declare const selectReferencePoints: ((state:
|
|
119
|
+
declare const selectReferencePoints: ((state: SlamAppRootState & {}) => readonly ReferencePoint[]) & {
|
|
119
120
|
clearCache: () => void;
|
|
120
121
|
resultsCount: () => number;
|
|
121
122
|
resetResultsCount: () => void;
|
package/dist/ar/depth-sampler.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger.js";
|
|
2
|
-
import { extractOdomPosition } from "../state/
|
|
2
|
+
import { extractOdomPosition } from "../state/gps-event-coordinator.js";
|
|
3
3
|
//#region ../src/ar/tracking-state.ts
|
|
4
4
|
/**
|
|
5
5
|
* Tracking State Manager
|
package/dist/ar/webxr-session.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger.js";
|
|
2
2
|
import { CameraBlitCapture, computeCaptureSize } from "./camera-blit-capture.js";
|
|
3
|
-
import { getLastDeviceOrientation } from "../state/
|
|
3
|
+
import { getLastDeviceOrientation } from "../state/gps-event-coordinator.js";
|
|
4
4
|
import { DepthSampler } from "./depth-sampler.js";
|
|
5
5
|
import { DEFAULT_CAPTURE_CONFIG, ImageCaptureManager } from "./image-capture.js";
|
|
6
6
|
import { TrackingStateManager } from "./tracking-state.js";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { GpsPoint, LatLong, LatLongAlt, Matrix4, Quaternion, RootState, RootState as LibraryRootState, Vector3, calcGpsCoords, createGpsSlamStore, isIdentityMatrix4, odometryTrackingRestarted, validateLicenseKey, webxrToNUE } from "gps-plus-slam-js";
|
|
2
|
+
export { type GpsPoint, type LatLong, type LatLongAlt, type LibraryRootState, type Matrix4, type Quaternion, type RootState, type Vector3, calcGpsCoords, createGpsSlamStore, isIdentityMatrix4, odometryTrackingRestarted, validateLicenseKey, webxrToNUE };
|
|
@@ -0,0 +1,85 @@
|
|
|
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 };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { n as SessionMetadata } from "./opfs-storage-Dlq1I_Gb.js";
|
|
2
|
+
|
|
3
|
+
//#region ../src/storage/file-system.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Reset module state - exported for testing only
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
declare function resetStorageState(): void;
|
|
9
|
+
/**
|
|
10
|
+
* Reset session-level state for a new recording.
|
|
11
|
+
*
|
|
12
|
+
* Clears scenario/session names and OPFS session handles, but preserves
|
|
13
|
+
* `storageInitialized` and the OPFS root so `initStorage()` doesn't need
|
|
14
|
+
* to be called again.
|
|
15
|
+
*/
|
|
16
|
+
declare function resetForNewSession(): void;
|
|
17
|
+
/**
|
|
18
|
+
* Result of write access verification.
|
|
19
|
+
*/
|
|
20
|
+
interface WriteAccessResult {
|
|
21
|
+
/** Whether write access was successfully verified */
|
|
22
|
+
success: boolean;
|
|
23
|
+
/** Error message if write verification failed */
|
|
24
|
+
error?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Verify that we have actual write access to a directory.
|
|
28
|
+
*/
|
|
29
|
+
declare function verifyWriteAccess(dirHandle: FileSystemDirectoryHandle): Promise<WriteAccessResult>;
|
|
30
|
+
/**
|
|
31
|
+
* Initialize storage using OPFS.
|
|
32
|
+
*
|
|
33
|
+
* @returns List of existing scenario folder names
|
|
34
|
+
* @throws Error if OPFS is not supported
|
|
35
|
+
*/
|
|
36
|
+
declare function initStorage(): Promise<string[]>;
|
|
37
|
+
/**
|
|
38
|
+
* Create a new session folder.
|
|
39
|
+
*
|
|
40
|
+
* When scenarioName is provided, creates under the scenario directory
|
|
41
|
+
* (legacy scenario layout for the recorder). When omitted, creates under
|
|
42
|
+
* the flat sessions/ directory.
|
|
43
|
+
*
|
|
44
|
+
* @param scenarioName - Optional name of the scenario (omit for flat layout)
|
|
45
|
+
*/
|
|
46
|
+
declare function startSession(scenarioName?: string): Promise<{
|
|
47
|
+
scenarioPath: string;
|
|
48
|
+
sessionPath: string;
|
|
49
|
+
}>;
|
|
50
|
+
/**
|
|
51
|
+
* List all session names.
|
|
52
|
+
* When scenarioName is provided, lists sessions under that scenario.
|
|
53
|
+
* Otherwise lists flat sessions.
|
|
54
|
+
*/
|
|
55
|
+
declare function listSessions(scenarioName?: string): Promise<string[]>;
|
|
56
|
+
/**
|
|
57
|
+
* Write a Redux action to OPFS as a JSON file.
|
|
58
|
+
*/
|
|
59
|
+
declare function writeAction(action: unknown, index: number): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* Write a captured frame image to OPFS.
|
|
62
|
+
*/
|
|
63
|
+
declare function writeFrame(blob: Blob, index: number): Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* Write session metadata (session.json) to OPFS.
|
|
66
|
+
*/
|
|
67
|
+
declare function writeSessionMetadata(metadata: SessionMetadata): Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Get the current scenario handle (for loading prior sessions).
|
|
70
|
+
* Legacy: uses scenario directory layout.
|
|
71
|
+
*/
|
|
72
|
+
declare function getCurrentScenarioHandle(): FileSystemDirectoryHandle | null;
|
|
73
|
+
/**
|
|
74
|
+
* Set the current scenario handle (when user selects a scenario).
|
|
75
|
+
* Legacy: uses scenario directory layout.
|
|
76
|
+
*/
|
|
77
|
+
declare function setCurrentScenario(scenarioName: string): Promise<FileSystemDirectoryHandle | null>;
|
|
78
|
+
/**
|
|
79
|
+
* Ensure a scenario directory exists in OPFS, creating it if necessary.
|
|
80
|
+
* Legacy: used during OPFS recovery.
|
|
81
|
+
*/
|
|
82
|
+
declare function ensureScenarioDirectory(scenarioName: string): Promise<FileSystemDirectoryHandle | null>;
|
|
83
|
+
//#endregion
|
|
84
|
+
export { listSessions as a, setCurrentScenario as c, writeAction as d, writeFrame as f, initStorage as i, startSession as l, ensureScenarioDirectory as n, resetForNewSession as o, writeSessionMetadata as p, getCurrentScenarioHandle as r, resetStorageState as s, WriteAccessResult as t, verifyWriteAccess as u };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as gpsToH3, i as findNearbyGeoAnchor, n as KnownGeoAnchor, o as h3CellsMatch, r as approxDistanceMetres, s as isH3Index, t as H3_RESOLUTION } from "../h3-proximity-GwesPTFT.js";
|
|
2
|
+
export { H3_RESOLUTION, KnownGeoAnchor, approxDistanceMetres, findNearbyGeoAnchor, gpsToH3, h3CellsMatch, isH3Index };
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { gridDisk, latLngToCell } from "h3-js";
|
|
2
|
-
//#region ../src/
|
|
2
|
+
//#region ../src/geo/h3-proximity.ts
|
|
3
3
|
/**
|
|
4
|
-
* H3
|
|
4
|
+
* H3 Geo-Anchor Proximity Matching
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* H3 hexagonal grid indices. Uses gridDisk(cell, 1) to create a ~65m
|
|
6
|
+
* Generic utility for matching GPS positions to known geo-anchored points
|
|
7
|
+
* using H3 hexagonal grid indices. Uses gridDisk(cell, 1) to create a ~65m
|
|
8
8
|
* safe zone that absorbs GPS jitter of 3-10m.
|
|
9
9
|
*
|
|
10
|
+
* Renamed from `ref-points/h3-ref-point.ts` in Iter 4 to drop recorder-only
|
|
11
|
+
* naming. The math is unchanged; only the public type/function names were
|
|
12
|
+
* generalised so the framework can serve any geo-anchored consumer.
|
|
13
|
+
*
|
|
10
14
|
* @see docs/2026-03-08-ref-point-naming-investigation.md §6
|
|
11
15
|
*/
|
|
12
16
|
/** H3 resolution 11: ~25m edge, ~65m gridDisk safe zone */
|
|
@@ -32,20 +36,20 @@ function approxDistanceMetres(lat1, lon1, lat2, lon2) {
|
|
|
32
36
|
return R * Math.sqrt(dLat * dLat + x * x);
|
|
33
37
|
}
|
|
34
38
|
/**
|
|
35
|
-
* Find the known
|
|
39
|
+
* Find the known geo-anchor closest to the given GPS position,
|
|
36
40
|
* provided it falls within the gridDisk safe zone.
|
|
37
41
|
*
|
|
38
42
|
* The safe zone is the center cell plus its 6 neighbors (~65m radius),
|
|
39
|
-
* which absorbs GPS jitter of 3-10m while keeping
|
|
43
|
+
* which absorbs GPS jitter of 3-10m while keeping anchors >130m apart
|
|
40
44
|
* distinguishable.
|
|
41
45
|
*
|
|
42
|
-
* When multiple
|
|
46
|
+
* When multiple anchors have overlapping safe zones (65–130 m apart),
|
|
43
47
|
* the closest one by equirectangular distance is returned.
|
|
44
48
|
*/
|
|
45
|
-
function
|
|
46
|
-
if (
|
|
49
|
+
function findNearbyGeoAnchor(lat, lng, knownAnchors) {
|
|
50
|
+
if (knownAnchors.length === 0) return;
|
|
47
51
|
const safeZone = gridDisk(latLngToCell(lat, lng, 11), 1);
|
|
48
|
-
const candidates =
|
|
52
|
+
const candidates = knownAnchors.filter((rp) => safeZone.includes(rp.h3Index));
|
|
49
53
|
if (candidates.length === 0) return void 0;
|
|
50
54
|
if (candidates.length === 1) return candidates[0];
|
|
51
55
|
return candidates.reduce((closest, rp) => {
|
|
@@ -57,7 +61,7 @@ function findNearbyRefPoint(lat, lng, knownRefPoints) {
|
|
|
57
61
|
* (i.e., one falls within the other's gridDisk safe zone).
|
|
58
62
|
* This is the canonical cross-session matching check.
|
|
59
63
|
*/
|
|
60
|
-
function
|
|
64
|
+
function h3CellsMatch(h3a, h3b) {
|
|
61
65
|
if (h3a === h3b) return true;
|
|
62
66
|
return gridDisk(h3a, 1).includes(h3b);
|
|
63
67
|
}
|
|
@@ -71,4 +75,4 @@ function isH3Index(id) {
|
|
|
71
75
|
return H3_INDEX_PATTERN.test(id);
|
|
72
76
|
}
|
|
73
77
|
//#endregion
|
|
74
|
-
export { H3_RESOLUTION, approxDistanceMetres,
|
|
78
|
+
export { H3_RESOLUTION, approxDistanceMetres, findNearbyGeoAnchor, gpsToH3, h3CellsMatch, isH3Index };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as gpsToH3, i as findNearbyGeoAnchor, n as KnownGeoAnchor, o as h3CellsMatch, r as approxDistanceMetres, s as isH3Index, t as H3_RESOLUTION } from "../h3-proximity-GwesPTFT.js";
|
|
2
|
+
export { H3_RESOLUTION, type KnownGeoAnchor, approxDistanceMetres, findNearbyGeoAnchor, gpsToH3, h3CellsMatch, isH3Index };
|
|
@@ -0,0 +1,56 @@
|
|
|
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 };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { t as ARPose } from "./ar-types-B-ORgk6Z.js";
|
|
2
|
+
import { Quaternion, Vector3 } from "gps-plus-slam-js";
|
|
3
|
+
|
|
4
|
+
//#region ../src/state/gps-ar-pose-sampler.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* GPS coordinate captured at observation time. Loosely typed so the recorder
|
|
7
|
+
* can pass either a `RawGpsPoint` or a plain `{ latitude, longitude,
|
|
8
|
+
* altitude? }` shape from the fused-path computation.
|
|
9
|
+
*/
|
|
10
|
+
interface GpsAnchorSampleGpsPoint {
|
|
11
|
+
readonly latitude: number;
|
|
12
|
+
readonly longitude: number;
|
|
13
|
+
readonly altitude?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A snapshot pairing the raw GPS reading, the optional fused GPS reading
|
|
17
|
+
* (computed when an alignment matrix is available), and the AR pose at the
|
|
18
|
+
* moment of capture. The `odomPosition` and `odomRotation` are pre-extracted
|
|
19
|
+
* from the AR pose for convenience — callers persisting the snapshot
|
|
20
|
+
* usually need them in tuple form.
|
|
21
|
+
*/
|
|
22
|
+
interface GpsAnchorSample {
|
|
23
|
+
readonly gpsPoint: GpsAnchorSampleGpsPoint;
|
|
24
|
+
readonly fusedGpsPoint?: GpsAnchorSampleGpsPoint;
|
|
25
|
+
readonly arPose: ARPose;
|
|
26
|
+
readonly odomPosition: Vector3;
|
|
27
|
+
readonly odomRotation: Quaternion;
|
|
28
|
+
readonly timestamp: number;
|
|
29
|
+
}
|
|
30
|
+
interface CaptureGpsAnchorSampleOptions {
|
|
31
|
+
/** Optional fused GPS point (computed elsewhere from the alignment matrix). */
|
|
32
|
+
readonly fusedGpsPoint?: GpsAnchorSampleGpsPoint;
|
|
33
|
+
/** Defaults to `Date.now()` at capture time. */
|
|
34
|
+
readonly timestamp?: number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Capture a GPS-AR pose snapshot. Extracts `odomPosition`/`odomRotation`
|
|
38
|
+
* from the supplied `arPose`. The supplied `gpsPoint` and optional
|
|
39
|
+
* `fusedGpsPoint` are stored verbatim.
|
|
40
|
+
*/
|
|
41
|
+
declare function captureGpsAnchorSample(arPose: ARPose, gpsPoint: GpsAnchorSampleGpsPoint, options?: CaptureGpsAnchorSampleOptions): GpsAnchorSample;
|
|
42
|
+
//#endregion
|
|
43
|
+
export { captureGpsAnchorSample as i, GpsAnchorSample as n, GpsAnchorSampleGpsPoint as r, CaptureGpsAnchorSampleOptions as t };
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { t as ARPose } from "./ar-types-B-ORgk6Z.js";
|
|
2
|
-
import { n as RawDeviceOrientation, t as GpsPosition } from "./gps-
|
|
3
|
-
import {
|
|
4
|
-
import { Quaternion, RawGpsPoint, Vector3, eulerToQuaternion } from "gps-plus-slam-js";
|
|
2
|
+
import { n as RawDeviceOrientation, t as GpsPosition } from "./gps-GKc6_Cly.js";
|
|
3
|
+
import { i as SlamAppStore } from "./create-slam-app-store-DBm7g2Zd.js";
|
|
4
|
+
import { Quaternion, RawGpsPoint, RecordGpsEventPayload, Vector3, eulerToQuaternion } from "gps-plus-slam-js";
|
|
5
|
+
import { ReducersMapObject } from "@reduxjs/toolkit";
|
|
5
6
|
|
|
6
|
-
//#region ../src/state/
|
|
7
|
+
//#region ../src/state/gps-event-coordinator.d.ts
|
|
7
8
|
/**
|
|
8
9
|
* Configuration for the recording coordinator
|
|
9
10
|
*/
|
|
10
11
|
interface RecordingCoordinatorConfig {
|
|
11
12
|
/** Redux store to dispatch actions to */
|
|
12
|
-
store:
|
|
13
|
+
store: SlamAppStore<ReducersMapObject>;
|
|
13
14
|
/** Function to get current AR pose (from WebXR module) */
|
|
14
15
|
getArPose: () => ARPose | null;
|
|
15
16
|
}
|
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
//#region ../src/
|
|
1
|
+
//#region ../src/geo/h3-proximity.d.ts
|
|
2
2
|
/**
|
|
3
|
-
* H3
|
|
3
|
+
* H3 Geo-Anchor Proximity Matching
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* H3 hexagonal grid indices. Uses gridDisk(cell, 1) to create a ~65m
|
|
5
|
+
* Generic utility for matching GPS positions to known geo-anchored points
|
|
6
|
+
* using H3 hexagonal grid indices. Uses gridDisk(cell, 1) to create a ~65m
|
|
7
7
|
* safe zone that absorbs GPS jitter of 3-10m.
|
|
8
8
|
*
|
|
9
|
+
* Renamed from `ref-points/h3-ref-point.ts` in Iter 4 to drop recorder-only
|
|
10
|
+
* naming. The math is unchanged; only the public type/function names were
|
|
11
|
+
* generalised so the framework can serve any geo-anchored consumer.
|
|
12
|
+
*
|
|
9
13
|
* @see docs/2026-03-08-ref-point-naming-investigation.md §6
|
|
10
14
|
*/
|
|
11
15
|
/** H3 resolution 11: ~25m edge, ~65m gridDisk safe zone */
|
|
12
16
|
declare const H3_RESOLUTION = 11;
|
|
13
17
|
/**
|
|
14
|
-
* A known
|
|
18
|
+
* A known geo-anchored point with its H3 cell index and GPS coordinates,
|
|
15
19
|
* used for proximity matching. GPS coordinates are needed to rank
|
|
16
20
|
* multiple candidates by distance when their gridDisk zones overlap.
|
|
17
21
|
*/
|
|
18
|
-
interface
|
|
22
|
+
interface KnownGeoAnchor {
|
|
19
23
|
readonly h3Index: string;
|
|
20
24
|
readonly displayName?: string;
|
|
21
25
|
readonly lat: number;
|
|
@@ -33,27 +37,27 @@ declare function gpsToH3(lat: number, lng: number): string;
|
|
|
33
37
|
*/
|
|
34
38
|
declare function approxDistanceMetres(lat1: number, lon1: number, lat2: number, lon2: number): number;
|
|
35
39
|
/**
|
|
36
|
-
* Find the known
|
|
40
|
+
* Find the known geo-anchor closest to the given GPS position,
|
|
37
41
|
* provided it falls within the gridDisk safe zone.
|
|
38
42
|
*
|
|
39
43
|
* The safe zone is the center cell plus its 6 neighbors (~65m radius),
|
|
40
|
-
* which absorbs GPS jitter of 3-10m while keeping
|
|
44
|
+
* which absorbs GPS jitter of 3-10m while keeping anchors >130m apart
|
|
41
45
|
* distinguishable.
|
|
42
46
|
*
|
|
43
|
-
* When multiple
|
|
47
|
+
* When multiple anchors have overlapping safe zones (65–130 m apart),
|
|
44
48
|
* the closest one by equirectangular distance is returned.
|
|
45
49
|
*/
|
|
46
|
-
declare function
|
|
50
|
+
declare function findNearbyGeoAnchor(lat: number, lng: number, knownAnchors: readonly KnownGeoAnchor[]): KnownGeoAnchor | undefined;
|
|
47
51
|
/**
|
|
48
52
|
* Check whether two H3 indices refer to the same physical location
|
|
49
53
|
* (i.e., one falls within the other's gridDisk safe zone).
|
|
50
54
|
* This is the canonical cross-session matching check.
|
|
51
55
|
*/
|
|
52
|
-
declare function
|
|
56
|
+
declare function h3CellsMatch(h3a: string, h3b: string): boolean;
|
|
53
57
|
/**
|
|
54
58
|
* Check whether a string looks like a valid H3 resolution-11 index.
|
|
55
59
|
* Used to distinguish H3 IDs from legacy user-typed string IDs.
|
|
56
60
|
*/
|
|
57
61
|
declare function isH3Index(id: string): boolean;
|
|
58
62
|
//#endregion
|
|
59
|
-
export { gpsToH3 as a,
|
|
63
|
+
export { gpsToH3 as a, findNearbyGeoAnchor as i, KnownGeoAnchor as n, h3CellsMatch as o, approxDistanceMetres as r, isH3Index as s, H3_RESOLUTION as t };
|