fix(lab): show only actionable obstacle boxes

This commit is contained in:
DCCONSTRUCTIONS
2026-08-26 16:09:32 +03:00
parent a98ad929d9
commit ac1dc7d930
6 changed files with 306 additions and 31 deletions
@@ -370,7 +370,7 @@ test("M4.8S timeline binds factory-KB4 camera points through its exact endpoint"
camera_point_sample_limit: 20000,
world_state_delivery: "source-paced-latest-wins",
occupancy_provenance_delivery: "baseline-versus-additive-component-diff",
camera_obstacle_projection_delivery: "factory-kb4-occupied-voxel-bounds",
camera_obstacle_projection_delivery: "factory-kb4-actionable-added-corridor-bounds",
world_state_frame_count: 4481,
superseded_frame_count: 8,
local_surface_visualization: {
@@ -400,7 +400,7 @@ test("M4.8S timeline binds factory-KB4 camera points through its exact endpoint"
assert.equal(timeline.supersededFrameCount, 8);
assert.equal(
timeline.cameraObstacleProjectionDelivery,
"factory-kb4-occupied-voxel-bounds",
"factory-kb4-actionable-added-corridor-bounds",
);
const chunk = await fetchM4ThreatTimelineChunk(replayResultId, 1, 1, {
@@ -455,7 +455,7 @@ test("M4.8S timeline binds factory-KB4 camera points through its exact endpoint"
assert.match(requested, new RegExp(`^${endpointRoot}/${replayResultId}/timeline/chunk`));
assert.match(
requested,
/obstacle_projection=factory-kb4-occupied-voxel-bounds/,
/obstacle_projection=factory-kb4-actionable-added-corridor-bounds/,
);
assert.equal(chunk.frames[0].worldStateAvailable, false);
assert.equal(chunk.frames[0].terminalOutcome, "superseded");
@@ -525,6 +525,24 @@ test("M4.8R3 turns active low-step components into native fisheye obstacle boxes
obstacle,
{ ...obstacle, componentId: "baseline", occupancySource: "baseline" },
{ ...obstacle, componentId: "held", state: "held" },
{
...obstacle,
componentId: "unknown",
assessment: {
...obstacle.assessment,
decision: "unknown",
corridorIntersection: "unknown",
},
},
{
...obstacle,
componentId: "clear",
assessment: {
...obstacle.assessment,
decision: "not-threat",
corridorIntersection: "clear",
},
},
], 800, 600);
assert.equal(boxes.length, 1);
assert.deepEqual(boxes[0].boxXyxy, [394, 294, 406, 306]);
@@ -533,6 +551,59 @@ test("M4.8R3 turns active low-step components into native fisheye obstacle boxes
assert.equal(boxes[0].dashed, false);
});
test("M4.8R3 keeps separate CURRENT threats and suppresses their spanning ROLLING box", () => {
const current = {
componentId: "temporal-left-1",
state: "current",
motion: "stationary",
centroidBodyXyzM: [3, 0, 0.3],
cellCentersBodyXyzM: [[3, 0, 0.3]],
occupancySource: "additive-low-step",
cameraProjection: {
bboxXyxy: [350, 260, 410, 310],
nearestDepthM: 3,
projectedCellCount: 2,
projection: "factory-kb4-occupied-voxel-bounds",
authority: "visual-derived",
},
assessment: {
componentId: "temporal-left-1",
decision: "threat",
corridorIntersection: "intersects",
relativeSpeedMps: null,
closestApproachM: 2.5,
ttcSeconds: null,
reasonCodes: ["current-corridor-intersection"],
},
};
const boxes = buildM4StaticObstacleBoxes([
current,
{
...current,
componentId: "temporal-right-2",
cameraProjection: {
...current.cameraProjection,
bboxXyxy: [405, 265, 445, 320],
},
},
{
...current,
componentId: "rolling-spanning",
state: "retained",
cameraProjection: {
...current.cameraProjection,
bboxXyxy: [340, 255, 450, 325],
},
},
], 800, 600);
assert.equal(boxes.length, 2);
assert.deepEqual(boxes.map((box) => box.label).sort(), [
"OBS #1 · 3 м",
"OBS #2 · 3 м",
]);
});
test("M4.6 local SLAM surface reprojects registered increments into the active body frame", () => {
const frames = [
timelineFrame(0, 10, {