ReviewOS

also looking at this

stacks/drone

feat: add shared-clock scoped vehicle simulation sessions

#98
Merged chris wants to merge codex/cargo-fleet-runtime into main
42 files +2764 -127
resources/functions/drone/controls/sensors.tsmodified+3-2
Changes to resources/functions/drone/controls/sensors.ts
@@ -3,9 +3,10 @@ import { rotateNedToBody } from './physics'
33import { createSensorPipeline } from '../sensors/pipeline'
44import { runtimeCrc32 } from '../runtime/protocol'
55import { multirotorModel } from './model'
6const bootId = 55n, boardOrigin = 1000000n
6const boardOrigin = 1000000n
77/** Modeled raw IMU/GNSS only. Measurement epoch is known because this is a synthetic source. */
8export function createPhysicsSensorFeed(additionalDelayMs: number) {
8export function createPhysicsSensorFeed(additionalDelayMs: number, bootId = 55n) {
9 if (typeof bootId !== 'bigint' || bootId < 1n || bootId > 0xffffffffffffffffn) throw new TypeError('Invalid synthetic sensor boot scope')
910 if (!Number.isFinite(additionalDelayMs) || additionalDelayMs < 0 || additionalDelayMs > 200) throw new RangeError('Sensor delay must be 0..200 ms')
1011 const pipeline = createSensorPipeline({ anchor: { bootId, boardUs: boardOrigin, localMs: 0, uncertaintyUs: 0, driftPpm: 0, source: 'fixture' }, calibrations: { imu: {
1112 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],