feat(planning): consolidate recorded-route localization and spatial scene
Preserve the completed teach-and-repeat laboratory stage: reference preparation, cascaded acquisition, local tracking and recovery, recording lifecycle, replay qualification, and persistent Rerun scene controls. Document the open grid-picking regression and Rerun upgrade contract. No autonomous driving or loop-closure optimization is claimed.
This commit is contained in:
@@ -385,8 +385,12 @@ class LivePerceptionIngress:
|
||||
"control": 4,
|
||||
"camera-init": 1,
|
||||
"camera-frame": 2,
|
||||
"lidar": 8,
|
||||
"pose": 16,
|
||||
# Recorded K1 bursts reach 19 spatial receipts in 500 ms despite a
|
||||
# ~10 Hz mean. Allow one burst plus consumer scheduling headroom.
|
||||
# Still bounded (64 MiB worst case per spatial modality); overflow is
|
||||
# observable and receipt timestamps/freshness are never rewritten.
|
||||
"lidar": 32,
|
||||
"pose": 32,
|
||||
}
|
||||
_MAX_PAYLOAD_BYTES: Final[dict[LiveIngressModality, int]] = {
|
||||
"control": 16 * 1024,
|
||||
@@ -406,6 +410,7 @@ class LivePerceptionIngress:
|
||||
self._session_id: str | None = None
|
||||
self._session_generation = 0
|
||||
self._active = False
|
||||
self._spatial_stop_requested = False
|
||||
self._closed = False
|
||||
self._consumer_id: str | None = None
|
||||
self._results_accepted = 0
|
||||
@@ -430,6 +435,7 @@ class LivePerceptionIngress:
|
||||
self._session_id = session_id
|
||||
self._session_generation += 1
|
||||
self._active = True
|
||||
self._spatial_stop_requested = False
|
||||
self._publish_locked(
|
||||
modality="control",
|
||||
source_id="mission-core",
|
||||
@@ -439,6 +445,33 @@ class LivePerceptionIngress:
|
||||
payload=b'{"event":"session-start"}',
|
||||
)
|
||||
|
||||
def request_spatial_stop(self, session_id: str, session_generation: int) -> bool:
|
||||
"""Fence derived localisation after an admitted acquisition STOP.
|
||||
|
||||
Not proof of hardware standby: recording and raw-first publications
|
||||
remain active. Only the lifecycle owner supplies this exact identity.
|
||||
The latched snapshot survives overflow and wakes a waiting consumer.
|
||||
"""
|
||||
with self._condition:
|
||||
if (
|
||||
not self._active
|
||||
or self._closed
|
||||
or self._session_id != session_id
|
||||
or self._session_generation != session_generation
|
||||
):
|
||||
return False
|
||||
if not self._spatial_stop_requested:
|
||||
self._spatial_stop_requested = True
|
||||
self._publish_locked(
|
||||
modality="control",
|
||||
source_id="mission-core",
|
||||
source_sequence=0,
|
||||
captured_at_epoch_ns=time.time_ns(),
|
||||
received_monotonic_ns=time.monotonic_ns(),
|
||||
payload=b'{"event":"spatial-stop-requested"}',
|
||||
)
|
||||
return True
|
||||
|
||||
def end_session(self, session_id: str) -> None:
|
||||
with self._condition:
|
||||
if not self._active or self._session_id != session_id:
|
||||
@@ -560,6 +593,7 @@ class LivePerceptionIngress:
|
||||
"schema_version": LIVE_INGRESS_SCHEMA,
|
||||
"mode": "shadow-diagnostic-only",
|
||||
"active": self._active,
|
||||
"spatial_stop_requested": self._spatial_stop_requested,
|
||||
"session_id": self._session_id,
|
||||
"session_generation": self._session_generation,
|
||||
"consumer_connected": self._consumer_id is not None,
|
||||
|
||||
Reference in New Issue
Block a user