API Reference

Navigation System Programming Interface

Back to Project

Navigation Filter API

initializeFilter()

Initialize the Extended Kalman Filter with initial state and covariance.

initializeFilter(initialState: State, initialCovariance: Matrix): Filter State = { position: [number, number, number], // [x, y, z] in meters velocity: [number, number, number], // [vx, vy, vz] in m/s attitude: [number, number, number], // [roll, pitch, yaw] in radians gyroBias: [number, number, number], accelBias: [number, number, number] }

predict()

Propagate state forward using IMU measurements.

predict(gyroMeasurement: Vector3, accelMeasurement: Vector3, dt: number): void // Example: filter.predict([0.01, -0.02, 0.5], [0.0, 0.0, 9.81], 0.01);

updateDVL()

Update filter with Doppler Velocity Log measurement.

updateDVL(velocityMeasurement: Vector3, measurementNoise: number): void // Example: filter.updateDVL([2.0, 0.5, -0.1], 0.01); // velocity in m/s, noise std dev

updateLBL()

Update filter with Long Baseline acoustic position fix.

updateLBL(positionMeasurement: Vector3, measurementNoise: number): void // Example: filter.updateLBL([125.5, -50.2, 100.0], 2.5); // position in m, noise std dev

Acoustic Positioning API

computeGDOP()

Calculate Geometric Dilution of Precision for a given vehicle position and transponder array.

computeGDOP(vehiclePos: Vector3, transponders: Vector3[]): number // Example: const gdop = computeGDOP( [0, 0, 100], [[-500, -500, 0], [500, -500, 0], [500, 500, 0], [-500, 500, 0]] );

trilaterate()

Solve for position given ranges to multiple transponders.

trilaterate(ranges: number[], transponders: Vector3[]): Vector3 // Example: const pos = trilaterate( [512.3, 510.8, 515.2, 508.9], // measured ranges in meters [[-500, -500, 0], [500, -500, 0], [500, 500, 0], [-500, 500, 0]] );

Data Structures

Core Types

Type Description Format
Vector3 3D vector [number, number, number]
Matrix 2D matrix number[][]
Quaternion Rotation representation [w, x, y, z]
Timestamp Time in seconds number

Utility Functions

mackenzieEquation()

Compute sound speed in seawater.

mackenzieEquation(temp: number, salinity: number, depth: number): number // Returns sound speed in m/s const c = mackenzieEquation(15, 35, 100); // temp(°C), salinity(PSU), depth(m)

coordinateTransform()

Transform coordinates between reference frames.

coordinateTransform(point: Vector3, from: Frame, to: Frame): Vector3 Frame = 'ECEF' | 'NED' | 'BODY' | 'LLA' // Example: Convert from body to NED const nedPos = coordinateTransform([1, 0, 0], 'BODY', 'NED');
Theory Guide Tutorials