feat(lab): project system obstacles into fisheye
This commit is contained in:
@@ -70,6 +70,14 @@ export interface M4ThreatAssessment {
|
||||
reasonCodes: readonly string[];
|
||||
}
|
||||
|
||||
export interface M4ThreatCameraObstacleProjection {
|
||||
bboxXyxy: readonly [number, number, number, number];
|
||||
nearestDepthM: number;
|
||||
projectedCellCount: number;
|
||||
projection: "factory-kb4-occupied-voxel-bounds";
|
||||
authority: "visual-derived";
|
||||
}
|
||||
|
||||
export interface M4ThreatMetricVisual {
|
||||
componentId: string;
|
||||
state: "current" | "retained" | "held" | "expired";
|
||||
@@ -78,6 +86,7 @@ export interface M4ThreatMetricVisual {
|
||||
cellCentersBodyXyzM: readonly M4Point3[];
|
||||
assessment: M4ThreatAssessment;
|
||||
occupancySource: M4OccupancySource;
|
||||
cameraProjection: M4ThreatCameraObstacleProjection | null;
|
||||
}
|
||||
|
||||
export interface M4ThreatCameraProposal {
|
||||
@@ -177,6 +186,7 @@ export interface M4ThreatTimeline {
|
||||
cameraPointSampleLimit: number;
|
||||
worldStateDelivery: "source-paced-latest-wins" | null;
|
||||
occupancyProvenanceDelivery: "baseline-versus-additive-component-diff" | null;
|
||||
cameraObstacleProjectionDelivery: "factory-kb4-occupied-voxel-bounds" | null;
|
||||
worldStateFrameCount: number;
|
||||
supersededFrameCount: number;
|
||||
sourceRepresentationId: "registered-map-increment-v1";
|
||||
@@ -323,6 +333,32 @@ function parseCameraProposal(value: unknown): M4ThreatCameraProposal {
|
||||
};
|
||||
}
|
||||
|
||||
function parseCameraObstacleProjection(value: unknown): M4ThreatCameraObstacleProjection {
|
||||
const item = object(value, "M4.8R3 camera obstacle projection");
|
||||
const bbox = vector(item.bbox_xyxy, 4, "M4.8R3 camera obstacle bbox");
|
||||
if (bbox[2]! < bbox[0]! || bbox[3]! < bbox[1]!) {
|
||||
throw new M4ThreatContractError("M4.8R3 camera obstacle bbox: нарушена геометрия.");
|
||||
}
|
||||
return {
|
||||
bboxXyxy: [bbox[0]!, bbox[1]!, bbox[2]!, bbox[3]!],
|
||||
nearestDepthM: number(item.nearest_depth_m, "M4.8R3 camera obstacle depth"),
|
||||
projectedCellCount: integer(
|
||||
item.projected_cell_count,
|
||||
"M4.8R3 camera obstacle cells",
|
||||
),
|
||||
projection: exact(
|
||||
item.projection,
|
||||
"factory-kb4-occupied-voxel-bounds",
|
||||
"M4.8R3 camera obstacle projection",
|
||||
),
|
||||
authority: exact(
|
||||
item.authority,
|
||||
"visual-derived",
|
||||
"M4.8R3 camera obstacle authority",
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
function parseMetricVisual(value: unknown): M4ThreatMetricVisual {
|
||||
const item = object(value, "M4.6 metric visual");
|
||||
const state = text(item.state, "M4.6 temporal state");
|
||||
@@ -347,6 +383,9 @@ function parseMetricVisual(value: unknown): M4ThreatMetricVisual {
|
||||
),
|
||||
assessment: parseAssessment(item.assessment),
|
||||
occupancySource,
|
||||
cameraProjection: item.camera_projection === undefined
|
||||
? null
|
||||
: parseCameraObstacleProjection(item.camera_projection),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -704,6 +743,13 @@ export async function fetchM4ThreatTimeline(
|
||||
"baseline-versus-additive-component-diff",
|
||||
"M4.8R3 occupancy provenance",
|
||||
),
|
||||
cameraObstacleProjectionDelivery: payload.camera_obstacle_projection_delivery == null
|
||||
? null
|
||||
: exact(
|
||||
payload.camera_obstacle_projection_delivery,
|
||||
"factory-kb4-occupied-voxel-bounds",
|
||||
"M4.8R3 camera obstacle projection delivery",
|
||||
),
|
||||
worldStateFrameCount: payload.world_state_frame_count === undefined
|
||||
? frameCount
|
||||
: integer(payload.world_state_frame_count, "M4.6 world-state frames"),
|
||||
@@ -756,16 +802,21 @@ export async function fetchM4ThreatTimelineChunk(
|
||||
fetcher = fetch,
|
||||
signal,
|
||||
endpointRoot = M4_THREAT_TIMELINE_ENDPOINT_ROOT,
|
||||
cameraObstacleProjectionDelivery = null,
|
||||
}: {
|
||||
fetcher?: LaboratoryFetch;
|
||||
signal?: AbortSignal;
|
||||
endpointRoot?: string;
|
||||
cameraObstacleProjectionDelivery?: M4ThreatTimeline["cameraObstacleProjectionDelivery"];
|
||||
} = {},
|
||||
): Promise<M4ThreatTimelineChunk> {
|
||||
const params = new URLSearchParams({
|
||||
start: String(startSequence),
|
||||
count: String(frameCount),
|
||||
});
|
||||
if (cameraObstacleProjectionDelivery !== null) {
|
||||
params.set("obstacle_projection", cameraObstacleProjectionDelivery);
|
||||
}
|
||||
const response = await fetcher(
|
||||
`${endpointRoot}/${result}/timeline/chunk?${params}`,
|
||||
{ headers: { Accept: "application/json" }, signal },
|
||||
|
||||
Reference in New Issue
Block a user