scene_service.state.data_assoc¶
Associate per-frame detections with persistent scene objects.
The version 1 algorithm applies these steps:
Gate candidates spatially using a class-specific radius.
Keep candidates with the same class.
Run Hungarian minimum-cost matching.
Allocate objects for unmatched detections.
Leave unmatched-object expiry to
mark_stale.Update matched object poses with an exponential moving average.
Not implemented in v1 (deferred): Kalman filtering, IoU-based gating, appearance embeddings, learned association.
Functions
|
Resolve detections against the registry. |
Classes
|
One per-frame perception output. |
- class scene_service.state.data_assoc.Detection(cls: str, pose: Pose3D, bbox: BBox3D, confidence: float, source: str = 'perception')[source]¶
Bases:
objectOne per-frame perception output. Stable id is NOT supplied — it’s this layer’s job to assign / find one. pose is in map frame (ingest does the TF transform before producing Detection).
- cls: str¶
- confidence: float¶
- source: str = 'perception'¶
- scene_service.state.data_assoc.associate(registry: ObjectRegistry, detections: list[Detection], *, now: float | None = None) tuple[list[str], list[str]][source]¶
Resolve detections against the registry. Caller must hold registry.lock().
Returns (matched_ids, new_ids) for logging / metrics. The registry is mutated in place: matched detections EMA-update existing records, unmatched detections allocate new ones, unmatched objects are NOT touched (mark_stale runs separately on a periodic tick).