import type { DisplacementVector, FusedPosition, FusionEngineConfig, FusionEventPayloads, PositionAnchor } from './types'; import { SensorRegistry } from '../sensors/sensor-registry'; import { PubSub } from '@packages/internal/common/pubsub'; import { HeadingFusionFilter } from './algorithms/heading-filter'; import { MultiSensorEKF } from './algorithms/multi-sensor-ekf'; import { type AnchorState } from './anchor-state'; /** * Multi-sensor fusion engine that combines position updates from multiple sources. * * Uses an Extended Kalman Filter (EKF) for position fusion with: * - Confidence-weighted measurements (high confidence = more influence) * - Half-life decay of old estimates (uncertainty grows over time) * - Hybrid anchor behavior (anchor-only period, then transition to GPS) * * Heading fusion uses a separate complementary filter combining compass and gyroscope. */ export declare class FusionEngine extends PubSub { #private; constructor(registry: SensorRegistry, config?: Partial); /** * Get the current fusion configuration. */ get config(): Readonly; /** * Get the current anchor state. * @param nowMs - Current timestamp (defaults to Date.now()) */ getAnchorState(nowMs?: number): AnchorState; /** * Get the current position anchor if one is set and not expired. */ get anchor(): Readonly | undefined; /** * Get the current accumulated displacement from the anchor in meters. * Returns (0, 0) if no anchor is set or no movement has occurred. */ get displacement(): Readonly; /** * Set an absolute position anchor from a calibration source (VPS, AI Localizer). * When an anchor is active, it provides the absolute position and other sensors * can provide relative updates from this reference point. * * @param anchor - The position anchor to set * @param configOverride - Optional config overrides for this anchor (e.g., anchorOnlyPeriodMs) */ setAnchor(anchor: PositionAnchor, configOverride?: Partial>): void; /** * Clear the current position anchor and accumulated displacement. */ clearAnchor(): void; /** * Reset the EKF state. * Call on floor changes or large position jumps. */ resetEKF(): void; /** * Reset the heading fusion filter state. * Call on floor changes or when heading should be re-initialized. */ resetHeadingFilter(): void; /** * Get the heading fusion filter for configuration. * @internal Used by debug tools for runtime tuning. */ get headingFilter(): HeadingFusionFilter; /** * Get the multi-sensor EKF for inspection. * @internal Used by debug tools for runtime inspection. */ get ekf(): MultiSensorEKF; /** * Get the last fused position. * @returns The last fused position, or undefined if none available */ getLastPosition(): FusedPosition | undefined; destroy(): void; }