feat(perception): add persistent lidar motion evidence
This commit is contained in:
@@ -73,7 +73,7 @@ class _PresentedCuboid:
|
||||
track_id: int
|
||||
label: str
|
||||
association_group: str
|
||||
distance_m: float
|
||||
distance_m: float | None
|
||||
support_points: int
|
||||
center: np.ndarray
|
||||
half_size: np.ndarray
|
||||
@@ -126,12 +126,20 @@ class _CuboidPresentationState:
|
||||
raise RecordedPerceptionOverlayError(
|
||||
"integrated perception cuboid track identity is invalid"
|
||||
)
|
||||
distance_value = item.get("distance_smoothed_m")
|
||||
distance_m = (
|
||||
float(distance_value)
|
||||
if isinstance(distance_value, int | float)
|
||||
and not isinstance(distance_value, bool)
|
||||
and np.isfinite(float(distance_value))
|
||||
else None
|
||||
)
|
||||
self._latest[track_id] = _PresentedCuboid(
|
||||
observed_ns=timestamp_ns,
|
||||
track_id=track_id,
|
||||
label=str(item.get("label", "object")),
|
||||
association_group=str(item.get("association_group", "object")),
|
||||
distance_m=float(item["distance_smoothed_m"]),
|
||||
distance_m=distance_m,
|
||||
support_points=int(item["clustered_points"]),
|
||||
center=np.asarray(center).copy(),
|
||||
half_size=np.asarray(half_size).copy(),
|
||||
@@ -160,9 +168,10 @@ class _CuboidPresentationState:
|
||||
color[3] = max(24, round(float(color[3]) * (1.0 - 0.55 * fade)))
|
||||
presented_colors.append(color)
|
||||
age_label = "" if age_ns == 0 else f" · hold {age_ns / 1_000_000:.0f} ms"
|
||||
distance_label = "" if cuboid.distance_m is None else f" · {cuboid.distance_m:.1f} m"
|
||||
labels.append(
|
||||
f"{cuboid.association_group} #{cuboid.track_id} {cuboid.label} · "
|
||||
f"{cuboid.distance_m:.1f} m · {cuboid.support_points} pts{age_label}"
|
||||
f"{cuboid.association_group} #{cuboid.track_id} {cuboid.label}"
|
||||
f"{distance_label} · {cuboid.support_points} pts{age_label}"
|
||||
)
|
||||
return (
|
||||
np.stack([cuboid.center for cuboid in presented]),
|
||||
|
||||
Reference in New Issue
Block a user