also looking at this
feat: add shared-clock scoped vehicle simulation sessions
#98
42 files
+2764
-127
| @@ -3,9 +3,10 @@ import { rotateNedToBody } from './physics' | ||
| 3 | 3 | import { createSensorPipeline } from '../sensors/pipeline' |
| 4 | 4 | import { runtimeCrc32 } from '../runtime/protocol' |
| 5 | 5 | import { multirotorModel } from './model' |
| 6 | const bootId = 55n, boardOrigin = 1000000n | |
| 6 | const boardOrigin = 1000000n | |
| 7 | 7 | /** Modeled raw IMU/GNSS only. Measurement epoch is known because this is a synthetic source. */ |
| 8 | export function createPhysicsSensorFeed(additionalDelayMs: number) { | |
| 8 | export function createPhysicsSensorFeed(additionalDelayMs: number, bootId = 55n) { | |
| 9 | if (typeof bootId !== 'bigint' || bootId < 1n || bootId > 0xffffffffffffffffn) throw new TypeError('Invalid synthetic sensor boot scope') | |
| 9 | 10 | if (!Number.isFinite(additionalDelayMs) || additionalDelayMs < 0 || additionalDelayMs > 200) throw new RangeError('Sensor delay must be 0..200 ms') |
| 10 | 11 | const pipeline = createSensorPipeline({ anchor: { bootId, boardUs: boardOrigin, localMs: 0, uncertaintyUs: 0, driftPpm: 0, source: 'fixture' }, calibrations: { imu: { |
| 11 | 12 | id: 'physics-frd-synthetic', provenance: 'fixture', axes: [1, 2, 3], referenceC: 25, minC: -20, maxC: 60, accelBias: [0, 0, 0], gyroBias: [0, 0, 0], accelScale: [1, 1, 1], gyroScale: [1, 1, 1], accelTempSlope: [0, 0, 0], gyroTempSlope: [0, 0, 0], accelNoiseStd: [0.005, 0.005, 0.005], gyroNoiseStd: [0.001, 0.001, 0.001], |