Refine sensor integration strategy

This commit is contained in:
2026-03-25 17:42:16 +08:00
parent a19342d61f
commit f7d4499e36
11 changed files with 1509 additions and 8 deletions

View File

@@ -1,6 +1,9 @@
import { type LonLatPoint } from '../../utils/projection'
import { type GameSessionStatus } from '../core/gameSessionState'
export type DevicePose = 'upright' | 'tilted' | 'flat'
export type HeadingConfidence = 'low' | 'medium' | 'high'
export interface TelemetryState {
sessionStatus: GameSessionStatus
sessionStartedAt: number | null
@@ -15,6 +18,14 @@ export interface TelemetryState {
lastGpsPoint: LonLatPoint | null
lastGpsAt: number | null
lastGpsAccuracyMeters: number | null
accelerometer: { x: number; y: number; z: number } | null
accelerometerUpdatedAt: number | null
accelerometerSampleCount: number
gyroscope: { x: number; y: number; z: number } | null
deviceMotion: { alpha: number | null; beta: number | null; gamma: number | null } | null
deviceHeadingDeg: number | null
devicePose: DevicePose
headingConfidence: HeadingConfidence
heartRateBpm: number | null
caloriesKcal: number | null
calorieTrackingAt: number | null
@@ -34,6 +45,14 @@ export const EMPTY_TELEMETRY_STATE: TelemetryState = {
lastGpsPoint: null,
lastGpsAt: null,
lastGpsAccuracyMeters: null,
accelerometer: null,
accelerometerUpdatedAt: null,
accelerometerSampleCount: 0,
gyroscope: null,
deviceMotion: null,
deviceHeadingDeg: null,
devicePose: 'upright',
headingConfidence: 'low',
heartRateBpm: null,
caloriesKcal: null,
calorieTrackingAt: null,