fix(k1): stabilize repeated acquisition and live viewer recovery
This commit is contained in:
@@ -396,6 +396,11 @@ class LivePerceptionIngress:
|
||||
if self._session_id == session_id:
|
||||
return
|
||||
raise RuntimeError("another live perception session is active")
|
||||
# Queued items belong to one acquisition. A worker may be absent
|
||||
# while a session ends, so clear bounded leftovers before the next
|
||||
# session can become visible to that worker.
|
||||
for queue in self._queues.values():
|
||||
queue.items.clear()
|
||||
self._session_id = session_id
|
||||
self._active = True
|
||||
self._publish_locked(
|
||||
@@ -681,9 +686,7 @@ class LiveSensorSynchronizer:
|
||||
or retention_seconds <= 0
|
||||
):
|
||||
raise ValueError("live sensor synchronizer bounds are invalid")
|
||||
self._maximum_lidar_camera_delta_ns = round(
|
||||
maximum_lidar_camera_delta_ms * 1_000_000
|
||||
)
|
||||
self._maximum_lidar_camera_delta_ns = round(maximum_lidar_camera_delta_ms * 1_000_000)
|
||||
self._maximum_pose_point_delta_ns = round(maximum_pose_point_delta_ms * 1_000_000)
|
||||
self._capacity = capacity_per_modality
|
||||
self._retention_ns = round(retention_seconds * 1_000_000_000)
|
||||
@@ -801,8 +804,7 @@ class LiveSensorSynchronizer:
|
||||
newest = values[-1].context.captured_at_epoch_ns
|
||||
oldest_allowed = newest - self._retention_ns
|
||||
while values and (
|
||||
len(values) > self._capacity
|
||||
or values[0].context.captured_at_epoch_ns < oldest_allowed
|
||||
len(values) > self._capacity or values[0].context.captured_at_epoch_ns < oldest_allowed
|
||||
):
|
||||
values.popleft()
|
||||
removed += 1
|
||||
@@ -837,9 +839,7 @@ class WorldStateProjector:
|
||||
if velocity_history_limit_s <= 0:
|
||||
raise ValueError("velocity history limit must be positive")
|
||||
self._velocity_history_limit_s = velocity_history_limit_s
|
||||
self._track_history: dict[
|
||||
int, deque[tuple[float, tuple[float, float, float]]]
|
||||
] = {}
|
||||
self._track_history: dict[int, deque[tuple[float, tuple[float, float, float]]]] = {}
|
||||
|
||||
def project(
|
||||
self,
|
||||
@@ -950,9 +950,7 @@ class WorldStateProjector:
|
||||
math.sqrt(
|
||||
sum(
|
||||
(observed - expected) ** 2
|
||||
for observed, expected in zip(
|
||||
observed_center, predicted, strict=True
|
||||
)
|
||||
for observed, expected in zip(observed_center, predicted, strict=True)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user