fix(cctv): keep estimated FOV for PTZ/varifocal hardware; carry datasheet range as capability

A PTZ/varifocal datasheet FOV is a capability range, not the lens's
current zoom, so replacing the frustum's estimate with its wide end
presented unknown optical state as known. Parse the full horizontal
range (ignoring vertical, "combined" panoramic and lens-note figures),
carry it as specFovMinDeg/specFovMaxDeg, and substitute the datasheet
FOV only for fixed single-lens hardware. The HUD labels the range as
capability beside the estimate. This also stops the Q6000-E Mk II's
"360 combined" figure from being read as a 360-degree lens.
This commit is contained in:
bassem chagra committed 2026-09-27 12:09:27 +00:00
1 parent 0533f78be4
commit ffa1891b01
4 files changed
+186 -34

No files matched your search

+18 -7
View File
@@ -1,11 +1,17 @@
import { CAMERA_SEEDS, SOURCE_ENDPOINT } from './policy.js';
import { lookupModelSpec, horizontalFovDeg } from './modelSpecs.js';
import {
lookupModelSpec,
horizontalFovRangeDeg,
fixedHorizontalFovDeg,
} from './modelSpecs.js';
/**
* Applies datasheet enrichment to a camera in place: when it names a known
* hardware `model`, the manufacturer's horizontal FOV replaces the pose
* estimate and the spec record is attached for the HUD. Unknown models — the
* common case — change nothing.
* hardware `model`, the spec record is attached for the HUD and the
* datasheet's horizontal FOV range rides along as `specFovMinDeg`/
* `specFovMaxDeg`. Only fixed-lens hardware replaces the pose estimate: a
* PTZ/varifocal range says what the lens CAN do, not where it is zoomed now.
* Unknown models — the common case — change nothing.
* @param {Object} camera - Camera being built (mutated).
* @param {string} [modelName] - Hardware model from a source or seed.
* @param {(v:number,min:number,max:number)=>number} clamp - Pose clamp helper.
@@ -13,9 +19,14 @@ import { lookupModelSpec, horizontalFovDeg } from './modelSpecs.js';
function applyModelEnrichment(camera, modelName, clamp) {
const spec = modelName ? lookupModelSpec(modelName) : null;
if (!spec) return;
const fov = horizontalFovDeg(spec);
if (fov) {
camera.fovDeg = clamp(fov, 20, 125);
const range = horizontalFovRangeDeg(spec);
if (range) {
camera.specFovMinDeg = range.minDeg;
camera.specFovMaxDeg = range.maxDeg;
}
const fixedFov = fixedHorizontalFovDeg(spec);
if (fixedFov) {
camera.fovDeg = clamp(fixedFov, 20, 125);
camera.fovSource = 'datasheet';
}
camera.spec = spec;