Skip to content

Layer 3 — World State

Part of the OpenRAL public-symbol inventory. Hand-curated; (LNN) markers are refreshed by tools/refresh_methods_linenos.py.

python/state_adapter/src/openral_state_adapter/

Layout adapter registry that assembles per-checkpoint state vectors from manifest-declared StateContractBindings plus live /tf and /joint_states. Pure-Python and rclpy-free; the skill_runner supplies TfLookup via tf2_ros.Buffer.lookup_transform at call time.

  • @dataclass TransformView (_protocol.py L21) — rclpy-free view of a geometry_msgs/TransformStamped (position + quaternion_xyzw).
  • Protocol TfLookup (_protocol.py L36) — __call__(target_frame: str, source_frame: str) -> TransformView. Implementations MUST raise on missing transforms — assembler never silently substitutes identity.
  • Protocol Assembler (_protocol.py L49) — __call__(bindings: StateContractBindings, joint_positions: dict[str, float], tf_lookup: TfLookup) -> NDArray[float32]. Pure-function signature every layout file implements.
  • const _LAYOUT_ASSEMBLERS: dict[StateLayout, Assembler] (_registry.py L29) — Package-global layout → assembler map; layout files populate it at import via register.
  • register(layout: StateLayout, assembler: Assembler) -> None (_registry.py L32) — Bind assembler to layout in the package-global registry. Layout files call this at module load.
  • registered_layouts() -> frozenset[StateLayout] (_registry.py L43) — Snapshot of currently-registered layouts. Reasoner palette filter consults this to admit wrapped-task-space rSkills.
  • assemble_state(layout, bindings, joint_positions, tf_lookup) -> NDArray[float32] (_registry.py L55) — Look up and run the assembler for layout after checking every bound joint is present. Raises ROSConfigError when no assembler is registered or a bound joint is missing; ROSPerceptionStale when no joint frame has arrived at all.
  • const _DIM = 16 (layouts/human300_16d.py L35) — Output vector width.
  • const _N_GRIPPER_JOINTS = 2 (layouts/human300_16d.py L36) — Per-finger gripper-joint count.
  • assemble_human300_16d(bindings, joint_positions, tf_lookup) -> NDArray[float32] (layouts/human300_16d.py L86) — RoboCasa365 / pi05_pretrain_human300 16-D task-space layout (EE pose + base pose + gripper). Registered as "human300_16d" at import.
  • const _DIM = 8 (layouts/libero_eef8d.py L41) — Output vector width.
  • const _N_GRIPPER_JOINTS = 2 (layouts/libero_eef8d.py L42) — Per-finger gripper-joint count.
  • const _EPS = 1e-10 (layouts/libero_eef8d.py L43) — Near-identity threshold below which _quat_xyzw_to_axisangle returns the zero vector rather than dividing by a ~zero norm.
  • assemble_libero_eef8d(bindings, joint_positions, tf_lookup) -> NDArray[float32] (layouts/libero_eef8d.py L67) — LIBERO 8-D task-space layout (EE pos + axis-angle + gripper), byte-matching the benchmark's _quat_to_axisangle so deploy sim feeds LIBERO checkpoints the same proprio as the benchmark. world_frame defaults to "map" — LIBERO manifests MUST override it to the HAL sim root. Registered as "libero_eef8d" at import.
  • rc365 layout (layouts/rc365.py) registers assemble_human300_16d above under the "rc365" key — same 16-D vector, re-sliced downstream by the RLDX-1 policy adapter; no separate assembler.

python/world_state/src/openral_world_state/aggregator.py

WorldStateAggregator — tf2-aware, injectable snapshot producer.

  • const DEFAULT_RATE_HZ: float = 30.0 — Advertised default snapshot rate. (L91)
  • const DEFAULT_STALENESS_S: float = 0.5 — General component staleness window, covering every heterogeneous-rate component with margin over the slowest expected stream; a freshness indicator, not a safety gate. (L98)
  • const DEFAULT_POLICY_STATE_STALENESS_S: float = 5.0 — Staleness window for policy_state, which is step-locked not rate-locked; wide enough for a heavy sidecar sim while still flagging a wedged one faster than its 120 s ZMQ timeout. (L105)
  • const DEFAULT_TRACKED_OBJECTS_STALE_S: float = 1.5 — Age past which the object tracker's last set is dropped from the snapshot (three missed beats of its ≥ 2 Hz heartbeat, issue #418). Calibration point. (L108)
  • class WorldStateAggregator — Aggregates sensor data and produces WorldState snapshots. (L111)
  • __init__(description, *, staleness_limit_s=DEFAULT_STALENESS_S, image_staleness_limit_s=None, policy_state_staleness_limit_s=DEFAULT_POLICY_STATE_STALENESS_S, clock_fn=None, tracked_objects_stale_s=DEFAULT_TRACKED_OBJECTS_STALE_S) — Camera and policy-state streams get independent staleness windows: image_staleness_limit_s defaults to the general window but deploy sim passes 5.0 s for slow rendered frames vs 0.5 s for real deploys; policy_state defaults to 5.0 s since it's step-locked. (L174)
  • update_joint_state(state) -> None — Record a fresh joint reading. (L292)
  • update_policy_state(values) -> None — Store a defensive copy of simulator-native checkpoint proprioception for WorldState.policy_state. (L315)
  • update_image_frame(sensor_name, frame: SensorFrame) -> None — Record an inline pixel payload for a named sensor (unlike update_image, which stores only the topic ref). (L326)
  • update_image(sensor_name, topic, stamp_ns) -> None — Record image arrival. (L303)
  • update_ee_pose(ee_name, pose) -> None — Record EE pose from tf2. (L360)
  • update_base_pose(pose, twist=None) -> None — Record base pose (and optional twist). (L374)
  • update_battery(pct) -> None — Record battery %. (L391)
  • update_attached_objects(objects: list[AttachedCollisionObject], *, revision=0, stamp_ns=None, place_declaration: PlaceDeclaration | None = None, grasp_declaration: GraspDeclaration | None = None) -> None — Atomically replaces the complete attached-payload set; duplicate ids or backwards revisions raise ValueError. place_declaration is replaced in the same atomic step as its payload, and liveness is judged against the stream's own stamp_ns, never clock_fn, so a sim-clock declaration is never wrongly judged stale by the wall clock. grasp_declaration is stored under the same atomic step and the same liveness gate; a set that carries none clears it. (L415)
  • update_tracked_objects(tracked: TrackedObjectSet) -> None — Store the object tracker's newest set (issue #418), stamped with its arrival on the tracked clock (clock_fn until use_tracked_clock); snapshot relays it verbatim as WorldState.tracked_objects (the kernel judges frame, caps, revision, stamp) and drops it (None, i.e. tracked_objects_valid false) once older than tracked_objects_stale_s. (L495)
  • use_tracked_clock(clock_fn: Callable[[], int]) -> None — Age the tracked set on the clock its producer heartbeats on (the node passes its ROS clock, sim time under use_sim_time); a wall-clock age dropped live sets on a sim below real time (Isaac R23/R26). (L511)
  • set_error(component, status='error') -> None — Latch a forced diagnostic. (L551)
  • clear_error(component) -> None — Remove a forced diagnostic. (L567)
  • fresh_joint_state() -> JointState | None — The received joint state while its diagnostic reads "ok"; None before the first reading (where snapshot substitutes zeros), once stale, or while joint_state carries a latched status. No span or metric: for poll loops (the runner's starting-pose wait). (L576)
  • snapshot() -> WorldState — Produce a typed snapshot (hot path, acquires lock), emitting OTel span/metrics for staleness and latched errors. staleness_latched fires only for a component that has had data before — a never-received one counts as stale but doesn't latch, so bringup stays quiet before the HAL's first publish. (L594)
  • update_detected_objects(objects: list[DetectedObject]) -> None — Replace the remembered detected-object set (thread-safe); the next snapshot() reflects it. Called by the world-state lifecycle node's memory tick. (L400)
  • _emit_snapshot_telemetry(span, diag, ages_ms) -> None — Internal: lift the snapshot diagnostics onto the OTel span + meter instruments. (L732)

python/world_state/src/openral_world_state/spatial_memory.py

SpatialMemory — persistent object-centric scene-graph memory (advisory; never a safety input).

  • compute_approach_viewpoint(target, *, standoff_m=DEFAULT_STANDOFF_M, camera_frame_id=DEFAULT_CAMERA_FRAME, approach_from=None) -> ApproachViewpoint — Standoff pose standoff_m from target (on the approach_from side, else −X), yawed so the gripper camera faces it. (L99)
  • class SpatialMemory — Accumulates WorldState.detected_objects into a queryable SceneGraph; pure-Python (typed BFS for traversal, JSON persistence — no graph-engine dep). (L142)
  • __init__(*, assoc_distance_m=DEFAULT_ASSOC_DISTANCE_M, default_standoff_m=DEFAULT_STANDOFF_M, camera_frame_id=DEFAULT_CAMERA_FRAME, map_frame=DEFAULT_MAP_FRAME, embedder=None, min_text_similarity=DEFAULT_MIN_TEXT_SIMILARITY) — embedder (optional TextEmbedder) enables open-vocab matching: object labels are embedded on creation and free-text queries match by CLIP cosine ≥ min_text_similarity. (L153)
  • upsert_node(node) -> None — Mutator; add or replace a node. (L191)
  • add_edge(src, dst, kind) -> None — Mutator; both endpoints must already exist. (L195)
  • ingest_detected_objects(objects, *, now_ns, follow_eviction=False) -> list[str] — Fold detections into object nodes, associating by track_id else label+proximity (assoc_distance_m); updates pose/last_seen/confidence (keeping the higher) and the node's belief state from DetectedObject.existence, embeds the label if set. follow_eviction=True (the reasoner, fed the world-state object memory's whole remembered set) marks a node the previous such snapshot carried and this one does not absent — kept, with its pose and history. Returns touched node ids. (L203)
  • recall_object(query: RecallObjectQuery, *, now_ns) -> RecallObjectResult — Rank object nodes by max(label-match, CLIP-cosine) × confidence, tiebreaking on proximity/recency; each match carries an ApproachViewpoint + inside_container_id. Empty result means unknown (caller may raise ROSObjectNotInMemory). (L312)
  • resolve_place(query: ResolvePlaceQuery, *, from_node_id=None) -> ResolvePlaceResult — Resolve a place/room/agent reference to a goal pose (an object resolves to its at_place) + a traversable_to BFS path. A declared node (SpatialNode.declared) matches only its label/aliases exactly; a reference tied between a declared node and another is refused. Raises ROSObjectNotInMemory when unresolved or ambiguous. (L372)
  • to_scene_graph() -> SceneGraph — Snapshot the current graph. (L490)
  • from_scene_graph(graph, *, embedder=None) -> SpatialMemory (classmethod) — Rebuild from a snapshot; re-embeds labels when an embedder is given (embeddings aren't serialized). (L495)
  • save(path) -> None — JSON persistence via the SceneGraph contract. (L512)
  • load(path, *, embedder=None, restored_uncertain=False) -> SpatialMemory (classmethod) — Inverse of save; re-embeds labels when an embedder is given. restored_uncertain=True (a deploy restoring an earlier run or a scene file) starts every present object uncertain. (L517)
  • const DEFAULT_ASSOC_DISTANCE_M (L76) — Default assoc_distance_m (see field docstring in the source for calibration).
  • const DEFAULT_STANDOFF_M (L79) — Default default_standoff_m.
  • const DEFAULT_CAMERA_FRAME (L82) — Default camera_frame_id.
  • const DEFAULT_MAP_FRAME (L85) — Default map_frame.
  • const DEFAULT_MIN_TEXT_SIMILARITY (L88) — Default min_text_similarity; min CLIP cosine for an embedding-only match (calibrated for ViT-B/32 openai) — an exact/substring label match always qualifies regardless.
  • const _MIN_DIR_NORM = 1e-6 (L95) — Below this horizontal distance, compute_approach_viewpoint's approach direction is treated as degenerate.

python/world_state/src/openral_world_state/geometry.py

Shared rotation geometry, relocated to openral_core.geometry; this module is a re-export shim. Canonical entries (ViewAxis, look_at_quat_wxyz, compute_gaze_pose, rotation_to_quat_wxyz, yaw_to_quat_xyzw, yaw_to_quat_wxyz, quat_xyzw_to_yaw) are documented under 00-core-schemas.md.

python/world_state/src/openral_world_state/grid.py

Occupancy-grid queries + approach-pose refinement (planning-layer proposal; the kernel check_nav_goal gate stays the enforcement).

  • const _GRID_NDIM = 2 (L33) — Required data.ndim for OccupancyGridIndex.__init__'s validation guard.
  • FREE_MAX (module constant, 25) — Highest nav_msgs/OccupancyGrid value still treated as free; -1 unknown and anything above block placement and sight (conservative). (L34)
  • class OccupancyGridIndex — Queryable view over one grid snapshot; ROS-free (from_msg duck-types the message). __init__(data (h,w) int8, *, resolution_m, origin_xy, origin_yaw=0.0); handles rotated origins. (L39)
  • from_msg(msg) -> OccupancyGridIndex (classmethod) — decode a (duck-typed) nav_msgs/OccupancyGrid. (L79)
  • resolution_m (property) — Cell edge length in metres. (L98)
  • world_to_cell(x, y) -> tuple[row, col] | None — None off-grid. (L102)
  • is_free(x, y, *, inflation_m=0.0) -> bool — point + world-space inflation disc all free; off-grid (or disc off-grid) counts blocked. (L114)
  • line_of_sight(a_xy, b_xy) -> bool — Bresenham; every cell strictly before the endpoint free (the target's own footprint cell is exempt — a mug shares its cell with its counter). (L148)
  • refine_approach_pose(grid, viewpoint, target_xyz, *, inflation_m=0.25, max_radius_m=2.0, min_standoff_m=None, max_standoff_m=None) -> ApproachViewpoint | None — Return the viewpoint unchanged when already free + sighted; else ring-search outward for the nearest admissible point (standoff within [0.5x, 2.0x] ideal by default), re-aim via compute_approach_viewpoint. None = no reachable viewpoint (caller reports honestly, never fabricates). (L183)

python/world_state/src/openral_world_state/scene_objects_span.py

Publish the durable object nodes as a dashboard OTel span (advisory; never a safety input).

  • const _DEFAULT_FRAME = "map" (L27) — Default frame name used by callers building SceneGraph nodes for this emitter (the SLAM 2D map frame the dashboard overlays markers on).
  • scene_objects_payload(graph) -> list[dict[str, object]] — Project a SceneGraph's object-kind nodes to JSON-friendly dicts; non-object nodes are skipped. (L30)
  • emit_scene_objects_span(graph, *, source_node) -> int — Emit one world.scene_objects span carrying the object list; returns the object count. Currently emitted by the Reasoner from its preloaded map. (L77)

python/world_state/src/openral_world_state/embedder.py

Open-vocabulary text embedder (optional; uv sync --group clip).

  • const DEFAULT_CLIP_MODEL = "ViT-B-32-quickgelu" (L33)
  • const DEFAULT_CLIP_PRETRAINED = "openai" (L37)
  • class TextEmbedder(Protocol) — Text-embedding interface open-vocab matching consumes. (L42)
  • dim (property) — Embedding width. (L46)
  • embed_text(texts) -> NDArray[float32] — L2-normalized embeddings, one row per input text. (L50)
  • class OpenClipEmbedder — OpenCLIP ViT-B-32-quickgelu / openai weights (MIT). __init__(*, model_name=DEFAULT_CLIP_MODEL, pretrained=DEFAULT_CLIP_PRETRAINED, device=None) raises ROSConfigError if open-clip-torch/torch missing or weights unfetchable; lazy-imports torch/open_clip so the base install stays light. (L55)
  • dim (property) — 512. (L102)
  • embed_text(texts) -> NDArray[float32] — L2-normalized CLIP text embeddings. (L106)

python/world_state/src/openral_world_state/object_lift.py

2D→3D object-center lift helpers — pure, ROS-free, unit-testable.

  • const _DEPTH_EPS = 1e-6 (L38) — Minimum +z (metres) for a voxel/point to count as "in front of" the camera.
  • const _QUAT_NORM_TOL = 1e-6 (L42) — Tolerance on |q|^2 for a grid orientation quaternion; wide enough for one that has been through a wire round-trip, far too tight for the all-zero value an unset field carries.
  • const _DEPTH_EPS = 1e-6 (L38) — Minimum +z (metres) for a voxel/point to count as "in front of" the camera.
  • const _QUAT_NORM_TOL = 1e-6 (L42) — Tolerance on |q|^2 for a grid orientation quaternion; wide enough for one that has been through a wire round-trip, far too tight for the all-zero value an unset field carries.
  • class ObjectsLiftError(ValueError) — Raised by geometry helpers on degenerate inputs (zero-norm quaternion; occupancy buffer size mismatch). (L45)
  • homogeneous_from_quat_xyz(translation, quat_xyzw) -> NDArray[np.float64] — Build a 4×4 homogeneous transform from translation + xyzw quaternion; delegates to openral_core.geometry.homogeneous_from_quat_xyz (layer 0 needs the same step) and re-raises its ROSConfigError as ObjectsLiftError. (L49)
  • decode_occupied_centers(*, origin, resolution, size_xyz, occupancy, orientation_xyzw=(0,0,0,1)) -> NDArray[np.float64] — Occupied voxel centres (N, 3) in the grid's reference frame, honoring orientation_xyzw since OccupancyVoxels is an oriented lattice — dropping the rotation misplaces objects whenever the base isn't map-aligned. Raises ObjectsLiftError on a size mismatch or non-unit orientation quaternion (an unset field's all-zero value is never read as identity). (L79)
  • depth_cloud_to_centers_base(points_cloud, t_base_from_cloud, *, max_points=0) -> NDArray[np.float64] — Octomap-free fallback depth source for VoxelFrustumLifter: drops non-finite returns, subsamples to max_points, and maps the cloud from its optical frame to base frame. Output is interchangeable with decode_occupied_centers. (L165)
  • aabb_iou_3d(a, b) -> float — 3D axis-aligned bbox IoU in [0, 1], boxes as (xmin, ymin, zmin, xmax, ymax, zmax); 0.0 for disjoint/degenerate. The only IoU helper in the repo — reuse it, don't add another. (L201)
  • class VoxelFrustumLifter(*, k_nearest=25, min_voxels=3) — Lift 2D detections to 3D object centres via voxel-frustum K-nearest: projects occupied voxels into the camera image plane and takes the K nearest each box centre, returning one DetectedObject (pose.frame_id="map") per detection. Skips a detection with fewer than min_voxels surviving voxels. (L227)
  • lift(*, detections, occupied_centers_base, intrinsics, frame_size, t_cam_from_base, t_map_from_base, map_frame="map", pad_m=0.0) -> list[DetectedObject] — pad_m (half a voxel edge) is added on every face of the box: the points are cell centres, and one voxel layer would otherwise lift to a zero-volume box whose IoU is 0 even with itself. — Core lift call (vectorised over voxels). Returns [] when occupied_centers_base is empty. track_id carries the 2D detection's det_id into 3D so a physical object keeps one id across the 2D and 3D views; ObjectMemory adopts it for new tracks. (L246)
  • class MissEvidence(str, Enum) — NONE | OCCUPIED | FREE: what one sensing run says about a remembered object nothing matched (issue #636). (L346)
  • build_miss_classifier(*, occupied_centers_map, intrinsics, t_cam_from_map, max_range_m, min_points=3, margin_m=0.03) -> Callable[[DetectedObject], MissEvidence] — One camera's verdict on an undetected object, from the depth evidence (the cloud is projected once and shared). Observable only when all 8 corners of its bbox_3d project in the image, in front of the camera and within max_range_m; then OCCUPIED when min_points occupied points lie in the box grown by margin_m, at least one above the margin_m floor band (the band alone is the support a removed object stood on); FREE when min_points or more project into its image rectangle beyond it and fewer than min_points in front; else NONE (occluded, even partly; depth hole; nothing mapped behind). Counts points, not rays, and the points may be another sensor's — the z-buffered depth-image test is object_tracker.fit.visible_fraction. (L360)

python/world_state/src/openral_world_state/object_memory.py

IoU-gated spatial object memory — pure, ROS-free, unit-testable.

  • class ObjectMemory(*, iou_threshold=0.3, hit_log_odds=0.85, miss_free_log_odds=-0.85, miss_occupied_log_odds=-0.1, belief_max=3.5, belief_absent=-2.0) — IoU-gated spatial memory with freeze-on-match and a per-object existence belief in log-odds (issue #636), clamped to [belief_absent, belief_max]; an object is evicted when its belief reaches belief_absent, never on one miss. Maintains a monotonic track_id counter. (L46)
  • tick(candidates: list[DetectedObject], *, stamp_ns: int, miss_evidence: Callable[[DetectedObject], MissEvidence]) -> list[DetectedObject] — Run one association step: greedy highest-confidence matching by same-label + aabb_iou_3d ≥ iou_threshold freezes a track (unchanged pose/bbox, bumped confidence) and adds one hit_log_odds per run; no match mints a new track (adopting the 2D det_id unless a live track holds it). An unmatched track adds what miss_evidence is worth (NONE 0, OCCUPIED, FREE). Returns the remembered set, each with its existence probability. (L113)
  • to_scene_graph() -> SceneGraph — The remembered objects as OBJECT nodes (obj_track_<id>, belief state) — the persistence contract. (L187)
  • restore(graph: SceneGraph, *, map_frame: str) -> int — Seed from a persisted graph: non-absent OBJECT nodes in map_frame with a bbox_3d become tracks at belief 0 (uncertain), keeping the track id their obj_track_<id> key names (fresh ids otherwise). Returns the count. (L210)
  • objects() -> list[DetectedObject] — The remembered set as tick returns it, without running a tick. (L252)

python/world_state/src/openral_world_state/object_tracker/__init__.py

Object-centric tracker core (issue #418) — ROS-free; every threshold and module constant of the package is read from openral_core/data/tracking_thresholds.yaml (openral_core.load_tracking_thresholds), never hard-coded; a lifecycle node wraps it. The module docstring is the binding/release contract: those modules mutate tracks only through ObjectTracker.store (TrackStore.get / all / replace); the tracker never fits, ages or confirms a BOUND track and hands BOUND fits back in TrackerOutput.bound_fits.

python/world_state/src/openral_world_state/object_tracker/fit.py

Containing fit (#418 step 3, the #266 rule): C = cone(dilate(S)) ∩ {z ≥ support} ∩ {z_opt ≥ z_front − ε} ∪ prism(P, support), never a hull of sampled surface points.

  • const ROBOT_PIXEL = 255 — robot_filter mask value for robot pixels (0 is free). (L75)
  • const UNCERTAIN_PIXEL = 128 — robot_filter mask value for the uncertain band around the robot. (L76)
  • class FitParams(BaseModel) — Frozen calibration: k_px (mask + extrinsic error), w_occ_px (occluder band), eps_m (A2/A3 tolerance), occluder_tol_m, min_points, min_depth_valid, depth range, extent ("measured" default: the measured surface's 16-direction footprint grown half a cell or the measured pixel quad's horizontal diagonal at the 90th-percentile neighbour spacing (sample_gap_m in assumptions; points within a cell of the support are kept only under the footprint of the points above that band grown by that spacing, support_dropped_points — restock scene 09 2026-11-01: refit masks over the strip a 6.5 cm carton stood on boxed 14.5 x 12 cm, now 7.6-8.3 cm; a 2 cm box's far corner lay 8.3 mm from its nearest sample from DROID's exterior camera), support to top + half a cell, 32 hull vertices, single-padded box; "containing": the #266 cone set below, which doubled a 6 cm carton from the OpenArm head camera; measured misses up to 5 mm of an oblique sphere's far side there, 22 mm on DROID's exterior camera; Safety-WG review owed). Every value a calibration point. (L85)
  • @dataclass ContainingFit — provisional (the robot touches the mask and reaches past the occluder band: may under-contain; replaces the old a4_robot_occluder_wide refusal); box (gravity-aligned, min-area yaw, +½ cell sides/top, bottom on the support), tight (one box primitive whose stage-2 hull is the 64-vertex polytope), surface (P, base frame), support_z, assumptions (A1-A4 evidence: a1_border_clear, a2_gap_m, a3_depth_valid, a4_occluder_px), refusal, cone ((origin, rays) of the dilated silhouette's 16-direction outer polygon, base frame, for any extent: multi_view cuts and gates with it), extent (the FitParams.extent that boxed it; empty when unknown). (L125)
  • containing_fit(mask, depth_m, robot_mask, intrinsics, t_base_from_cam, *, support_z, resolution, frame_id, stamp_ns, params=None, detector_box=None, part_box=None) -> ContainingFit — With params.extent="measured" (default) the box and hull are the measured footprint prism (FitParams); the rest describes "containing". detector_box (the open-vocabulary detector box the mask was prompted with; never a track's own projection) joins the silhouette and its non-robot depths the front cut, so a mask that lost a rim the detector saw is still contained (A1); with "measured" it also cuts a spilled mask: the mask's points more than a cell above the support are split into parts no chain of adjacent pixels joins within a cell, and parts with most of their pixels outside the detector box are dropped with the near-support points (spill_dropped_points in assumptions; restock scene 13 2026-10-31: a carton and a neighbour 1.6 cm away boxed 18 x 9 cm, cut to 7.6 x 7.6 cm for the 6.1 cm carton; part_box (default detector_box; the tracker passes a refit's projection of the track's own box) only picks the parts, never joins the silhouette, so a refit is split too — scene 09's refits spilled to 10.4 x 11.8 cm under the growth gate and the carried box reached the shelf board 5.5 cm ahead of the carton; ceiling: an object pushed mostly out of its old box with a neighbour left inside it would be swapped for the neighbour; Safety-WG review owed); Robot pixels leave the mask, the uncertain band and an occluder band (where a nearer surface or the robot cuts the boundary) re-enter, k_px dilation; the surface P and the front plane come from the mask pixels the filter is sure are not the robot (a robot or uncertain-band pixel never lifts the prism or the front cut: logged a5_robot_band_px); the cone over the silhouette's 16-direction outer polygon between the front plane and the support, union the prism of P's footprint: exactly 64 vertices, no hull solver, no inward step. Marks provisional (the robot touches the mask and reaches past the occluder band; a provisional refit never replaces a clear track's geometry, but one that leaves it in place re-dates its last_fit_stamp_ns for the grasp binder, and a clear refit clears the flag), refuses too_few_points, a1_border_truncated (mask touches the image border), a2_below_support (a surface point under the support), a3_depth_invalid, ray_misses_support, and the grasp-region caps. A4 (a hidden part wider than the occluder band) is logged, not provable here — the tracker's θ_vis gate covers it. (L264) The set is cut at a ceiling, the highest point any silhouette pixel's first hit allows (ceiling_z in assumptions); a cut keeps the 64-vertex multi_view layout (rays' nearest points, rays at the support, prism floor, a lid raised over the cuts' crossings) — Spark banana R325's bowl boxed 15 cm tall without it.
  • project_box(box, intrinsics, t_base_from_cam) -> tuple[tuple[int, int, int, int], float] | None — A box's clipped image rectangle and nearest optical depth; None behind the camera or outside the image. (L649)
  • visible_fraction(box, depth_m, robot_mask, intrinsics, t_base_from_cam, *, tol_m=0.01) -> float | None — Z-buffered fraction of the box's image rectangle not covered by the robot (robot or uncertain), a nearer surface, or missing depth; None out of view. Ceiling: an occluder between the box's nearest corner and the object's surface counts as visible. (L672)

python/world_state/src/openral_world_state/object_tracker/catalog.py

External declarations remain candidates; only calibrated necessary-condition size contradictions block queries. No geometry tightening or contact permissions.

  • class CatalogDeclarations(catalog) — Bounded candidate association and latched maximum-size contradictions. (L30)
  • retain(identities) -> None — Retire disappeared identities without clearing live mismatches. (L43)
  • associate(object_id, epoch, label, *, observed_label_count) -> str — Exact normalized unique label on both catalog and observed sides; ambiguity suspends measurement association. Newer epochs preserve mismatches. (L47)
  • observe_span(object_id, epoch, measured_span_m, *, camera, stamp_ns, now_ns) -> str — Lower-bound measured span versus declared maximum primitive diameter plus twice the calibrated point error. Compatible partial observations cannot clear a mismatch; complete upper-bound revalidation is not implemented. (L82)
  • blocked(object_id, epoch) -> bool — Query gating for a latched contradiction in this lifecycle generation. (L139)
  • diagnostics() -> dict[str, str] — Bounded declaration provenance and state. (L144)

python/world_state/src/openral_world_state/object_tracker/surface_model.py

Observation-only object-local occupied surface voxels. Uses bounded native PCL ICP; never supplies collision geometry or world occupancy clearing. Explicit bounded depth rays may retire only its independently owned diagnostic surface cells.

  • class ObjectSurfaceModels(config) — Explicit ObjectSurfaceModelConfig; loads the ROS-built _openral_pcl_registration module, fails configuration if unavailable. Stores at most TrackedObjectSet.MAX_OBJECTS independent identities and bounded local surface cells. (L69)
  • retain(identities) -> None — Drops models for retired track IDs. (L92)
  • observe(object_id, epoch, points_world, initial_world_pose, stamp_ns) -> str — Seeds a canonical frame from the first observed fit; later observations register against accumulated local points with PCL, gated by convergence/residual/overlap. Rejects old stamps/generations and invalid rigid inputs; only accepted measurements update pose/voxels. Reports capacity explicitly. No unseen-space inference or deformation model. (L96)
  • world_points(object_id) -> NDArray — Projects the stored local surface at its latest accepted observed pose without retaining world-coordinate trails. (L195)
  • clear_observed_free(object_id, epoch, stamp_ns, depth_m, robot_mask, intrinsics, t_world_from_cam, *, now_ns, max_age_ns, depth_error_m, pose_error_m, pixel_error, min_depth_m, max_depth_m) -> int — Removes only model-owned voxels whose entire projected volume is independently observed free in the same accepted-pose frame, within explicit error/freshness bounds. Unknown/occluded/off-image/unexamined cells remain; projected pixel work bounded by max_points, once per frame. No world-map edits. (L201)
  • diagnostics() -> dict[str, str] — Model status, voxel count, actual observation stamp, residual, overlap, epoch and retired-cell count. (L314)

python/world_state/src/openral_world_state/object_tracker/multi_view.py

Multi-view containing fit (#418 phase 4): K = conv(C_primary) ∩ cone_j ∩ … — only second views' silhouette cones intersect, never their front cut or prism; pure numpy, no scipy.

  • @dataclass MultiViewFit — fit (the multi-view ContainingFit, or the primary single-view fit on any fallback), fit_kind (MULTI_VIEW_CONE when a cone cut the result, else SILHOUETTE_CONE), refusals (per view index: primary / fallback:<why>, contributed, or why the view did not cut: its own fit refusal such as a1_border_truncated, cone_layout, silhouette_too_small). (L68)
  • intersect_views(views, *, resolution, frame_id, stamp_ns) -> MultiViewFit — views are (containing_fit result, T_base_from_optical) per depth camera. A second view cuts only when its own fit was not refused (A1 border clear) and its cone holds every measured surface point of every view (a too-small silhouette is refused whole). K is exact (plane-triple vertex enumeration), reduced outwards to the 64-vertex hull cap (two horizontal slabs' 16-direction outer polygons when K has more), boxed by fit._boxed; falls back (logged object_tracker.multi_view_fallback) on no_second_view, empty_intersection, views_disagree (a measured point outside the result) or no_gain (box not smaller). A second view's cone is the fit's own cone (a hull read only for a fit without one: a measured fit's hull is its seen prism, so every measured second view used to be refused cone_layout). A primary with extent="measured" combines by union instead: the measured prism of the primary's surface plus each second view's points inside the primary's cone (a spill out of it is dropped), a second view joining only when its cone holds every primary point; no_gain there means not larger. Wired through ObjectTracker._combine_views for recent clear camera fits. (L265)

python/world_state/src/openral_world_state/object_tracker/cover.py

Size-aware map confirmation (#418 step 4).

  • def cover_need(n_cells: int) -> int — Cells of n_cells expected ones a track's own cover must hold: max(need_min_cells, ceil(need_fraction * n_cells)) from openral_core/data/tracking_thresholds.yaml (50 % / min 2). (L354)
  • @dataclass CoverVerdict — visible (|E|), occupied (|E ∩ occupied|), kind ("" / map_disagrees / map_split / map_split_own), why. (L56)
  • surface_cells(grid, surface, *, exclude=()) -> frozenset[tuple[int, int, int]] — E: lattice cells holding the fit's surface points, minus cells centred in exclude (the robot's own space). (L79)
  • cover_verdict(grid, cells, box, *, support_z, own=(), others=(), static=frozenset(), hidden=frozenset()) -> CoverVerdict — others (the other CONFIRMED/OCCLUDED tracks' boxes): a second body wholly inside one is that object, not a split (design step 4, closure minus other tracks); |E ∩ occupied| ≥ max(2, ⌈0.5·|E|⌉) (cover on expected cells, not a padded footprint), then object_primitives.map_confirms for one body; a second body wholly inside a declared hand's own space is map_split_own; a body wholly inside static (the declared static cells, padded by TrackerParams.static_pad_cells) is the declared wall, not a second body, for this one-body test only. (L364) A second body under MIN_SPLIT_CELLS cells is a fragment and does not split.
  • MIN_SPLIT_CELLS = 3 (L52) — The fewest cells a second body inside a track's box needs to make it map_split: 1-2 cell fragments of the object itself (a banana's tip, a piece the hand's occlusion cuts off; Isaac R28/R31) went SPLIT mid-grasp. ~3 cm at 15 mm cells; Safety-WG review owed. Calibration point.
  • box_cells(grid, box, *, support_z, exclude=()) -> frozenset[Cell] (L320) — The occupied cells centred in box more than a cell above the support (the support's own layer left out, as map_confirms does; Isaac R79: 212 of 235 were the table top's layer) and in none of exclude: what the map holds of an object inside its box now. While a hand is at a TARGET / DESTINATION whose expected cells a push emptied (map_disagrees), the tracker re-anchors them on these cells when they number at least the old cover's need and at most _REANCHOR_MAX_RATIO (2.0) times the expected cells, and re-stamps on a passing verdict (object_tracker.contact_reanchor; Isaac R68/R69: a banana pushed 66–94 mm inside its box; Safety-WG row owed). A push out of the box leaves nothing to re-anchor on. The re-anchor reference is what the track filled in the map (box_cells) at its last plain pass, and it also runs on a "hidden" verdict (Isaac R83/R85/R92: the hand hid the object, 3–7 cells in view, while the map held 33–52 in the box, and the confirmation aged out). Its companion rule: while touched, a refit's box is the private _union_box(old, new) (the box in the new fit's orientation enclosing both, None past GraspDeclaration's half-extent / volume caps), both fits' hulls kept up to TrackedObject.MAX_TIGHT_HULLS (object_tracker.contact_union; Isaac R70: a refit at the banana shrank its box 26 → 19 cm and the finger met the dropped part).
  • uncovered_cells(grid, cells, box) -> int (L280) — How many of a track's last-fit surface cells the map still holds occupied, centred outside box grown by a cell. The tracker ignores an unmoved object's refit when this reaches max(3, 5%) of the cells (object_tracker.partial_refit_ignored): a partial mask's clear refit halved an unmoved banana's box (Isaac R37/R39). A true tightening passes, since the surface it drops is no longer occupied.
  • hand_touches(box, hands, margin_m) -> bool (L249) — Whether any declared hand box reaches box grown by margin_m (27 samples per hand box). The tracker's contact hold uses it: while a hand is at a CONFIRMED/OCCLUDED TARGET or DESTINATION (_CONTACT_ROLES; never CONTEXT), map_split / map_disagrees keep its status without a re-stamp (object_tracker.contact_hold), so the kernel's grasp_region_max_age_s ends the exemption (Isaac R33/R38; Safety-WG row owed). Since the visibility-aware cover, at a target or destination the hand touches, a second body within a cell of the hand is the piece the fingers cut off, so the track confirms and re-stamps.
  • cells_behind_robot(grid, cells, depth_m, robot_mask, k, t_base_from_cam, tol_m=0.01) -> frozenset[Cell] (L198) — The expected cells the camera cannot see now because the robot is in front (the centre projects onto a robot or band pixel whose depth is nearer by more than tol_m). cover_verdict(hidden=...) leaves them out of the cover count, numerator and denominator alike, and returns "hidden" (no evidence: held, not re-stamped) under two visible cells. A confirmation publishes the visible count as visible_cells, the kernel's cover bar (2026-10-21 decision; the kernel-free baseline's successful grasps keep the fingers on the banana for 255–466 steps).
  • static_cell_keys(grid, centres, *, pad_cells=0) -> frozenset[tuple[int, int, int]] (L121) — The declared static cells on grid's lattice, grown by pad_cells (Chebyshev, clipped): the one-body test's keep-out (#418 restock).
  • read_static_cells(path) -> NDArray (L103) — The launch's static-cells file (one x y z per line) as an (N, 3) array.
  • own_cover(grid, cells, others) -> int (L160) — |E ∩ occupied| over the cells centred in none of others. A TENTATIVE track confirms only when this is ≥ max(2, ⌈0.5·occupied⌉), else INFO refusal cover_already_tracked (#418 r6po_dbg4 ghost trk:5: one mask over two tracked oranges, hazard OT-13).

python/world_state/src/openral_world_state/object_tracker/stall.py

  • class JawStallDetector(closed, gap, settle, *, window_s=0.6, dwell_s=0.3, min_samples=5, approach_s=2.0) (L65) — The tracker's own stalled-jaw read (issue #418, tracking / on, sim only): the commanded jaw is further from closed than the MEDIAN measured jaw (last dwell_s) by at least gap (closed_rest_offset + stall_gap), the last dwell_s has a Theil-Sen drift within max(settle_tolerance, gap / 2) per window_s, the jaw closed into the hold (a sample in the last approach_s sits that allowance further from closed), and both the gap and the hold (the run of samples within twice the allowance of the median) have lasted dwell_s, with no command band. The hold dates from where the jaw entered that band, so a policy that lifts while a simulated jaw wobbles under the load still binds from the grasp pose (restock bench 2026-10-31: hold within 5 mm of the carton's rest on 30 of 30 grasps, fired at most 9 cm into the lift, vs up to 36 cm / never). Chatter does not reset it; a jaw at its command (closed on nothing), still closing, not yet closing (an open jaw under a chunk whose last row closes: Spark banana R322), or pre-shaped and then closing (the gap must last the dwell) never fires. Tested on r7dr_on1's close 2 (DROID), r9po_camlong (SO-101, no fire), and restock clean3_08 / clean2_02 (OpenArm, 6 cm carton lift; pre-shape).
  • JawStallDetector.command(target, stamp_ns) (L141) — The approved command; one leaving the hold ends it.
  • JawStallDetector.update(position, stamp_ns) -> bool (L205) — One measured sample; True once per hold.
  • JawStallDetector.suppress() (L154) — A real ATTACH covers this hold: never fire for it.
  • JawStallDetector.reset() (L158) — Forget the window (a release, a sim reset).
  • JawStallDetector.hold_since_ns -> int | None (L128) — Source time the jaw entered the band it holds in (a late ATTACH names the hand pose the object was grasped at).
  • JawStallDetector.held_median (L123) — The median jaw over the last dwell_s (the hold a fired stall reads).
  • JawStallDetector.latched (L137) — Whether this hold already fired or was suppressed.

python/world_state/src/openral_world_state/object_tracker/commands.py

  • jaw_commands(joints, joint_order, *, n_dof, flat, joint_names, tick_group_size, ee_name) -> dict[str, float] (L31) — Issue #418 (WP C): the gripper targets one safety-approved chunk carries, by gripper joint: a full-dof row at the manifest index, a compact row by joint_names, and an ADR-0102 slot group's one-value gripper slot by ee_name (arm slots carry none). The node read only the first two and dropped every slot group, so the restock tracker never held a jaw command and the stalled-jaw read never fired (r12rs02_on1/on2/camlong_b).
  • class SourceClock(window_s=10.0, max_lead_s=0.5) (L95) — The joint states' source time at a moment on the node's clock, for stamping an approved jaw command (the chunk carries no stamp; a --clock bag replay runs the node on wall time over sim-time joint stamps): observe(clock_ns=, stamp_ns=) per handled joint state, source_at(clock_ns) -> int | None = clock minus the smallest recent offset (a running min-deque, O(1) amortised), so a joint-state backlog never dates a command into the past, held to at most max_lead_s past the newest stamp (a clock faster than the source, as in a wall-clock replay, delays a read by at most that).
  • SourceClock.observe(*, clock_ns, stamp_ns) (L128) — Fold in one handled joint state (its stamp, the node's clock); forgets the window when the node's clock goes back or the stamp falls more than a second behind the newest (a sim reset, also under a --clock replay).
  • SourceClock.source_at(clock_ns) -> int | None (L149) — The joint states' source time at clock_ns; None before any joint state.

python/world_state/src/openral_world_state/object_tracker/heartbeat.py

  • M = TypeVar("M") (L22) — Type of the cached wire messages.
  • class StarvationFill(*, gap_s=0.4, silent_s=5.0) (L25) — Issue #418 (WP C): ROS-free cache of the tracker's last published tracked-set and attachment-state messages. touch / joints / published record the main thread's activity; due(now) -> (tracked | None, attach | None) returns what a steady-clock timer on its own callback group should republish when the main heartbeat is late by gap_s, and nothing once the main thread has been silent silent_s (a hung tracker is never covered for) or, for the attachment stream, no joint state arrived in silent_s. The kernel judges the stream by attachment_state age; 2 s wall gaps from a long fit made r10rs02_camlong stop on n=0 of=0.
  • touch(now_s) -> None (L51) — Records main callback activity.
  • joints(now_s) -> None (L56) — Records receipt of joint feedback.
  • published(now_s, *, tracked=None, attach=None) -> None (L61) — Caches published messages and their publication times.
  • due(now_s) -> tuple[M | None, M | None] (L69) — Returns cached messages only while their producer and required joint feedback remain live.

python/world_state/src/openral_world_state/object_tracker/hidden_side.py

  • grow_hidden_side(box, size_m, *, depth_m, robot_mask, intrinsics, t_base_from_cam, grid, support_z, others=(), tol_m=0.01) -> tuple[PlaceRegion, list[tuple[int, int, float]]] (L157) — Issue #418 (OT-6 / OT-14 amendment, Safety-WG review pending): a PROVISIONAL track's box grown along each horizontal axis toward size_m, on the side the robot is on (some of the slab's samples behind a robot pixel), where every occupied cell more than one cell past the fitted box is hidden behind the robot (a cell the camera sees, or sees past, stops it: r6po_dbg5's depth-edge cells between the oranges split a box grown past them), never into another track's box, in half-cell steps from the full deficit (never past the size). Within one cell of the fitted box a seen-past cell is allowed (the object's own partial-volume edge; observed-free space holds nothing an exemption acts on). Returns the box and the (axis, sign, grown_m) applied. The tracker calls it on every provisional fit with _measured_size: the track's own largest clear fit, else the largest CONFIRMED clear same-label track, else no growth (INFO object_tracker.hidden_side_grown). r6po_dbg4: orange_3's 5.2 cm box grows 1.5 cm on the jaw side (stopped by a depth-edge cell the camera sees past) and covers the five cells the gripper stopped on.

python/world_state/src/openral_world_state/object_tracker/tracks.py

Track table, association by continuity, source-time ageing (#418 steps 5-6).

  • const LIVE — Statuses a fit refreshes by continuity (TENTATIVE, CONFIRMED, OCCLUDED, SPLIT, BOUND). (L40)
  • class TrackStore(frame_id) — The TrackedObject rows; every change bumps revision. Contract for binding/release: get, all, replace. (L52)
  • revision (property) — Strictly increasing. (L96)
  • get(object_id) -> TrackedObject | None — (L100)
  • all() -> list[TrackedObject] — Mint order. (L104)
  • replace(obj) -> None — Swap the row for an updated copy; bumps revision; ROSConfigError on an unknown id, a frame mismatch or an epoch going backwards; logs status transitions. Never mints. (L108)
  • mint(**fields) -> TrackedObject — TENTATIVE trk:<n>, never reused; past 32 rows the oldest LOST is dropped, else ROSConfigError. (L137)
  • drop(object_id) -> None — Forget a row. (L163)
  • snapshot(stamp_ns) -> TrackedObjectSet — (L168)
  • associate(tracks, centroid, *, voxel_m) -> tuple[str | None, str] — continuity (a live box holds the centroid or its centre is within a voxel), tie (two candidates within one voxel of each other: update nothing, HZ-0115-2), inferred (exactly one LOST track within a diameter), else new; a RELEASED track takes no fit (never followed: the object is found afresh under a new id). (L183) A SPLIT track takes no fit by continuity (its box holds two bodies: a neighbour inside it is a new object). The tracker ignores a refit of a CONFIRMED/OCCLUDED track whose new box splits on the map (split_refit_ignored).
  • age_tracks(store, now_ns, *, max_age_s, lost_s, keep_lost_s, held=frozenset()) -> None — Source-clock ageing: CONFIRMED/OCCLUDED without a confirming grid → TENTATIVE (ineligible); TENTATIVE/SPLIT without evidence → LOST; LOST forgotten after keep_lost_s. BOUND/RELEASED are not aged here. (L257) A held track (a live untracked / provisional hold's candidate, ObjectTracker.held_ids from the session) is never aged: Spark banana R335 aged one TENTATIVE mid-carry and the kernel dropped the payload's own cells.

python/world_state/src/openral_world_state/object_tracker/grounding.py

Standing queries (#418 Addendum G): a query lives as long as its goal; never a first-frame snapshot.

  • @dataclass StandingQuery — (goal_id, query_id), the ObjectQuery, declaration_key, ObjectQueryStatus, search start (since_ns), fairness key (last_served_ns), escalated, the last eight typed refusal observations, and within (a grasp declaration's search_box under tracking: matches then also needs the track's box centre in it, centre_within, except for a BOUND / RELEASED track, in_scope; a seeded TARGET query's seed instead, re-expressed per grid by TrackerSession, issue #631). (L58)
  • key (property) — (goal_id, query_id). (L96)
  • matches(track) -> bool — Same label and role, and the box centre in within when set. (L100)
  • centre_within(box, region) -> bool — Whether box's centre lies in the oriented region (same frame, else False). (L123)
  • in_scope(track, within) -> bool — A goal's within gate: within is None, the track is BOUND / RELEASED (once grasped the search box no longer locates it: a lifted payload keeps its query RESOLVED and keyed, and its release outside the box still seeds note_released), or its centre lies in it. (L109)
  • @dataclass QueryEscalation — Active-search data for the reasoner, never executed by the tracker: kind unresolved (start find-object) / exhausted (budget spent → replanning ladder), last_seen (last LOST match's box, a search prior). (L142)
  • class QueryBook(*, search_start_s, search_max_s, continuous_s=2.0) — Every live goal's queries. (L162) note_released(track) seeds every query the retired released track matches with its box (StandingQuery.prior), the search's seed until every raised top in it was tried; a CONTEXT query never escalates.
  • note_released(track) -> None (L288) — Seeds every query the retired RELEASED track matches with its box (StandingQuery.prior): the object is first looked for where it was let go.
  • queries (property) — (L191)
  • get(goal_id, query_id) -> StandingQuery | None — (L195)
  • record_observation(goal_id, query_id, observation: ObjectQueryObservation) -> None — Append one query-scoped refused observation and retain only the latest eight. (L199)
  • open(goal_id, query_id, query, declaration_key, *, stamp_ns, invocation_id="") -> None — Start a query with the owning action UUID; the session suffixes invocation IDs into internal goal IDs so repeated target/stamp pairs on a paused source clock cannot collide. (L209)
  • close_goal(goal_id) -> None — End a goal's queries. (L233)
  • ready(goal_id) -> bool — grounding_ready: every query RESOLVED. (L238)
  • update(tracks, *, now_ns, blocked_ids=frozenset()) -> list[QueryEscalation] — UNRESOLVED → RESOLVING (TENTATIVE match; a RELEASED one counts for nothing) → RESOLVED (≥ min_instances CONFIRMED/OCCLUDED/BOUND); all lost again → UNRESOLVED with the timer restarted; one unresolved escalation after search_start_s, EXHAUSTED + exhausted at search_max_s, all in source time. (L243)
  • due(*, now_ns) -> list[StandingQuery] — Passive-search order: unresolved queries least-recently-served first, then resolved count: "all" queries (they keep detecting more instances) and every other resolved query whose last locate is continuous_s of source time old (#418, user 2026-10-17: detection runs for the whole goal, so an object that only becomes visible later, e.g. one the arm hid at goal start, is still picked up; TrackerParams.continuous_locate_s). (L319)

python/world_state/src/openral_world_state/object_tracker/scheduler.py

One segmenter/detector request in flight, rate-capped in wall time (#418 step 7).

  • const PRIORITY_QUERY = 1 — Step-7 priority of unresolved queries. (L39)
  • const PRIORITY_DISAGREE = 3 — Tracks the map disagrees with. (L40)
  • const PRIORITY_BOUND = 4 — Bound-object protrusion checks. (L41)
  • const PRIORITY_REFRESH = 5 — Oldest visible CONFIRMED refresh and resolved count: "all" re-detection. (L42)
  • @dataclass TrackerRequest — One locate_in_view / segment_in_view prompt on the frame (camera, stamp_ns): priority, fairness served_ns, label, query_key or object_id, box_xyxy / point_uv (prompts), within_xyxy (a bound on the mask pick only: a map seed's image rectangle), seed_cell (the lattice cell a map-seeded prompt sits on: a served one is skipped until a locate is served), request_id (0 until issued). (L46) roi_norm_xyxy (issue #418): a locate's region of interest in [0, 1] of the frame, sent as LocateInView.roi_norm_xyxy. prompt: a locate's open-vocabulary text, label then the query's synonyms, comma-separated (the node sends it as LocateInView.query).
  • class Scheduler(*, segment_hz, budget_wall_s) — Lowest priority number, then served longest ago; abandons (and logs) a request unanswered past budget_wall_s; abandon() frees the slot at once (a station change: a late answer is then unexpected_result). (L97)
  • in_flight (property) — (L128)
  • complete(request_id) -> TrackerRequest | None — Free the slot; None (logged) for an unknown id. (L132)
  • next(candidates, *, wall_s) -> TrackerRequest | None — Issue the best candidate when the slot is free and the rate allows. (L147)
  • abandon() -> None — Free the slot unanswered (the station changed: ObjectTracker.drop_requests), logging object_tracker.request_abandoned; a late answer is then unexpected. (L141)

python/world_state/src/openral_world_state/object_tracker/tracker.py

ObjectTracker — steps 0-7 per depth frame; pure (no ROS, no clock read). - duplicate_of(box, tracks) -> tuple[str, float] | None (L171) — The live (not LOST / RELEASED) track whose box the new fit's box overlaps at 3D AABB IoU >= 0.5 (_DUPLICATE_MINT_IOU, via aabb_iou_3d), and that IoU. _apply_mask refuses such a mint for a CONTEXT-role query only (a target / destination query refused would never resolve) (INFO object_tracker.refused why=duplicate_of_track); and every accepted TARGET / DESTINATION fit retires (LOST) a non-BOUND CONTEXT track it boxes at that IoU (INFO object_tracker.context_duplicate_retired; bench_dup_05: a generic track minted over a LOST target blocked its re-grounding): association is same-label only, so a generic query ("carton") fitted over a named target minted a second track on it (restock bench_fix_08, IoU ~0.85; inflated neighbours 7 cm apart ~0.25). A CONTEXT track's refit whose box duplicates a live non-CONTEXT track is refused (INFO object_tracker.context_refit_duplicate), so a retired context track is never revived on the target; and a TARGET / DESTINATION query's map-seeded point prompt (instance_prompt) skips only non-CONTEXT tracks' boxes, so a context track never hides its object from the named query (pro#51 restock, arms out of view: every "stock object" prompt masked the tote wall behind the carton the "carton" query had boxed). - covers_destination(box, dest) -> bool (L226) — Whether a TARGET box is the destination's own body (half the larger footprint overlapped, 80 % of its height), not something lying on or in it: the plate minted as an "orange" (yf1 ep4) is refused as a target. - provisional_oversize(extent_m, prior_m, factor) -> bool (L400) — Issue #418 (OT-6 / OT-14 amendment): a PROVISIONAL refit of a known track whose longer horizontal extent exceeds factor (TrackerParams.provisional_oversize_factor, default 2.0) times its clear prior (ObjectTracker._extent_prior: the track's own clear history, else the MEDIAN over clear CONFIRMED same-label tracks, so one bad clear fit cannot loosen the gate) is refused in _refuse_refit and the previous box kept, unless the fit moved (a moved fit replaces the box it left) (INFO object_tracker.provisional_oversize); clear fits and labels with no clear evidence are never blocked. r16po_on1: half 0.096 x 0.167 refit of a 5.8 cm orange through the arm's occluder band. - PRIOR_MARGIN_M = 0.05 (L131) — Margin a released match's box is grown by as its query's seed: down onto the support it fell to, and around where it rolled (Spark R242-R261). Calibration point. - LOW_PROMPT_SCORE = 0.3 (L538) — Issue #418: a track grounded from a locator box scored under this needs TrackerParams.low_score_confirm_grids (3) consecutive confirming grids (distinct stamps; a refuting grid restarts the run) before CONFIRMED, then logs object_tracker.low_score_prompt_confirmed (object, label, score, grids) at INFO. The tracker asks its locator down to TrackerParams.locate_min_score (0.15; TrackerRequest.min_score → LocateInView.min_score): a box is only a prompt (SAM, the containing fit and map confirmation filter it); restock cartons scored 0.15-0.29 under OmDet's own 0.30. TrackerResult.box_scores / TrackerRequest.prompt_score carry the score. - VIEW_WINDOW_S = 0.5 (L529) — Source seconds within which one track's fits from different depth cameras are combined: a refit from camera B is passed with the other cameras' newest clear fits no older than this to intersect_views (this fit primary), and the track takes its fit_kind (MULTI_VIEW_CONE when a second view contributed, else SILHOUETTE_CONE); provisional fits neither contribute nor are intersected (ObjectTracker._combine_views). - ROBOT_BOX_FRACTION = 0.5 (L534) — A detector box more than this fraction ROBOT pixels is re-prompted (below). - ROBOT_BOX_NEGATIVES = 3 (L536) — Issue #418 (PickOrange orange_3 under the open jaw: the locator boxed the arm as "orange" and SAM segmented the arm): a detector box more than half ROBOT pixels is re-prompted (ObjectTracker._robot_box_reprompt) with a positive point on the free pixels in the box that stand above the support -- the connected region lying most beside the robot (_most_hidden), at its pixel nearest its centroid -- and negative points on the robot (TrackerRequest.negative_uv, sent as SegmentInView.negative_points), the box kept as the mask's bound. Logged object_tracker.robot_box_reprompt. The fit then goes through the robot (PROVISIONAL) and needs only TrackerParams.theta_vis_provisional (0.25) of the object visible, not theta_vis (0.5). A served re-prompt clears its pending box; a resolved count-all query that keeps detecting logs object_tracker.count_all_research (at most every 5 s). - LOCATE_ROI_PAD = 0.25 (L532) — A locate's crop: the projected search region grown by this fraction of its size on every side. The region is the query's seed (a seed outside the grid frame, a recalled memory node in map, #631, is replaced by the query's grid-frame within, or dropped), else ObjectTracker.search_region (the active grasp declaration's workspace_box, set by ObjectTrackerSession.on_grasp_declaration); none = the whole frame (ObjectTracker._locate_roi). #418 restock: the whole 1920×1080 head frame squashed to omdet's 640×640 left a carton ~40 px and found in ~24 % of locates. - REFUSAL_LOG_PERIOD_S = 5.0 (L526) — Source seconds between INFO reports of one (key, reason) refusal. - ObjectTracker.refusal_counts: Counter[tuple[str, str]] — Every refusal by (key, reason): <label>@<camera> for a fit (too_few_points, half_extent_cap before the support scan when the mask's axis span exceeds 4 × GraspDeclaration.MAX_HALF_EXTENT_M (no capped box holds it; Isaac R89/R94: whole-table masks cost ~2 s of the scan each), no_support, the fit's own refusal, occluded, candidate_split, locate_found_nothing, no_mask, no_grid), camera:<name> for a frame (no_camera_pose, no_robot_mask). Each is reported as an INFO object_tracker.refused event (key, why, count, the numbers) at most every REFUSAL_LOG_PERIOD_S per key and reason (_refuse), never DEBUG-only (#418 restock grounded nothing with no reason at INFO); the node publishes the counts on /diagnostics (openral_object_tracker: refusals, key <key>|<why>) at most every 5 s. - class TrackerParams(BaseModel) — Frozen calibration: theta_vis (an OCCLUDED track returns to CONFIRMED only at theta_vis + 0.1, _VIS_HYSTERESIS: restock scene 08 2026-11-01 flipped every frame under a hovering hand and went CONFIRMED in the second of the grasp, binding untracked), max_age_s, lost_s, keep_lost_s, disagree_grids, segment_hz, segment_budget_wall_s, search_start_s, search_max_s, support probe, low_score_confirm_grids (3), provisional_oversize_factor (2.0), refit_growth_factor (1.5: any refit past it times the track's first clear fit, horizontally or in height (height since 2026-11-01, restock scene 00's 8 cm carton boxed 14.6 cm tall), unless a re-orientation (sorted extents and volume within the factor, INFO object_tracker.refit_reoriented: a tipped carried carton) (else first provisional fit; a clear fit is never refused against that) is refused, INFO object_tracker.refit_growth_refused (re-dated when 2/3 of its surface lies in the box, INFO object_tracker.refit_growth_redated), unless admitted by ObjectTracker._admit_growth: the last 3 refused clear growth fits agree within 1 cm in extent, height and centre within 15 s of source time, the height stays within a cell of the reference's (a camera above sees the top; growth in height is spill onto something taller), the box reaches no live track the kept box does not already touch, and cover_verdict is not map_split; then, once _refuse_refit's later gates pass it too, it becomes the reference, once per track (no 14 -> 24 -> 39 cm ratchet), INFO object_tracker.refit_growth_admitted / refit_growth_blocked (#479 review: restock seeds 111/112 kept a partial-first-fit carton 6 cm for an 8.2 cm object all episode); a refused partial / occluded refit measured inside the box re-dates the fit; a moved refit through the robot keeps the clear size, INFO object_tracker.covered_move_size_kept, unless the shift is within one cell, INFO object_tracker.covered_move_within_cell; 2026-10-31), fit: FitParams. (L410) - @dataclass CameraFrame — Depth at its source stamp with intrinsics, t_base_from_cam and robot_mask (either None = ageing only). (L489) - @dataclass TrackerResult — Answer to an issued request: mask (segmenter) or boxes_xyxy (detector); failure_reason (bounded service cause; empty means the request completed, including a no-match); alternatives (smaller qualifying candidates, largest first: feed tries the next when a candidate cannot be fitted or its box splits on the map, and mints a SPLIT track only from the last). A failed locate is recorded on its standing query as a refusal cause, never locate_found_nothing. (L558) - @dataclass TrackerOutput — requests (≤ 1), tracked (TrackedObjectSet), escalations, bound_fits (fits associated with BOUND tracks, for the in-hand update). (L582) - _MOVED_MIN_POINTS = 3 / _MOVED_MIN_FRACTION = 0.05 [private] — Issue #418 (2026-10-21 decision, Spark R17 banana / R19 bowl): a refit whose measured surface has at least max(3, 5 %) points more than one cell outside the stored box has MOVED its track (object_tracker.moved_refit). It replaces the box even when the track is OCCLUDED or the fit is through the robot, kept PROVISIONAL (never a payload, still K2 / K7 geometry). Otherwise an occluded refit, or a provisional one over a clear box, is ignored as before. - class ObjectTracker(frame_id, params=None) — store: TrackStore, queries: QueryBook. (L598) - set_static_geometry(centres) (L2681) — Declare static cell centres (grid frame) for the one-body test only (#418 shelf scene): bodies wholly inside them, padded by static_pad_cells, are the declared wall; the fit and the cover gate keep every measured point. - open_query(goal_id, query_id, query, declaration_key, *, stamp_ns, invocation_id="", within=None) -> None — Start a standing query; within scopes its instances (StandingQuery.within). (L695) - close_goal(goal_id) -> None — End a goal's queries; tracks persist. (L721) - rebase(t_new_old, carried, riders=frozenset(), *, keep_records) -> None (L726) — Re-expresses the carried tracks and every base-frame record across a base move (TrackerSession.on_joint_state), once, at the source, so association, confirmation, grasp_region and the binder all read the moved state: each carried track's box (rebase_box, still gravity-aligned), tight hulls (rebase_pose) and centroid; its surface cells, kept as moved centres and put on the lattice of the next grid fed (feed, via surface_cells: a grid's lattice may turn with the base); and, with keep_records, every let-go and placed record not of a riders track (else those are dropped: past the station's odometry budget). Carried cells never replace cells measured since the carry. Per-camera views, growth votes, the carried tracks' surface models, prompted seed cells and in-flight / pending requests are from the old pose and are dropped. support_z / floor_z are heights a planar motion keeps. - drop_requests() -> None — Forget the in-flight request (Scheduler.abandon), every pending prompt and every placed record (base-frame boxes): taken at the last station (TrackerSession.leave_station). (L784) - record_query_refusal(req, reason, frame) -> None — Add one bounded typed refusal observation to the request's standing query, if it has a query key. Shared by fit failures and query/track mismatch producers; it emits no per-frame failure event. Object-query escalation carries the query's action invocation_id. (L1071) - feed(frame, *, grid, grid_stamp_ns, wall_s, results=(), hand_spaces=()) -> TrackerOutput — Results (answers on this same frame) → support (ring counted only below the mask's lowest point, truncated one cell under the measured top) → containing fit → θ_vis gate → association → mint/refit → immediate cover check; a new grid re-confirms every track (map_split → SPLIT, own-hand split → unchanged and not re-stamped, disagree_grids refutations → LOST, RELEASED → CONFIRMED epoch+1 after a fresh fit); visibility (CONFIRMED ↔ OCCLUDED, OCCLUDED never re-fits); source-time ageing; query update and escalations; at most one new request. (L794) - apply_instance_cells(cells_by_id, grid, stamp_ns, hands) -> int (L2405) — EXPERIMENT (pro#51 vision + voxel fusion, sim-only; Safety-WG review owed). Per track, the occupied lattice cells its SAM2 video mask labels (/openral/instance_cells): a CONFIRMED / OCCLUDED / LOST TARGET or DESTINATION gets the box _vision_fit accepts (size, other-track, role-conflict and cover gates) and is re-confirmed, its fit time re-dated too (the grasp binder reads it, _fresh_ns); its tight hulls are dropped with the old box. _vision_fit refuses a map_disagrees or map_split cover verdict (the refit rule), never map_split_own / hidden. It is only re-dated (confirmation and fit time) when unmoved: the labelled cells lie in its box grown a cell (_MOVED_MIN_*) and the map still fills the box (cover_need), so a partly hidden object keeps its box. Cells older than the track's last fit / confirmation are ignored. A RELEASED target is re-minted once within recent_s of its release (_vision_refind, never on cells older than the release; the release support stands, the released track's tight hulls do not; its clear size and extent outlive the retired track while the re-find window is open). The session applies instance cells only on an axis-aligned lattice (InstanceCells carries no orientation; INFO object_tracker.instance_cells_lattice_rotated). A retired target's placed record is dropped once a BOUND payload is over it (re-grasped under a new id). Returns how many tracks moved. - oversize_provisional(track) -> bool (L2723) — A PROVISIONAL track whose box is past provisional_oversize_factor x its clear prior (_extent_prior: its own clear history, else the MEDIAN over clear same-label tracks); the bind drops it.

python/world_state/src/openral_world_state/object_tracker/pinch.py

Issue #418 WP C2. The hand's pinch volume J_h by mimic-aware joint-state FK (openral_core.kinematics), pure numpy over the manifest, no HAL import.

  • class PinchVolume(centre, axes, half, palm_m) (L45) — An oriented box in the attach link, axes (c, a, b) = closing, approach, pad width; palm_m the palm plane x·a ≥ palm_m it never crosses.
  • box() -> Box (L60) — (centre, rotation, half) for box_gap_lower_bound_m.
  • grown(margin_m) -> PinchVolume (L64) — Every face out by margin_m (J_h takes one cell).
  • class HandModel(description, gripper_joint, wrist_links=1) (L69) — One role: gripper joint: attach link = its parent link, touch_links = grasp_contact_links([joint]), pads = touch links no other finger hangs off (the Robotiq's distal/proximal phalanges, the SO-101's moving jaw), closed end = closure_calibration.closed_position. Axes fixed per hand at contact: c the principal direction of the pads' closing motion, a palm → pads square to c. The palm plane is the jaw joint's origin, moved forward to the wrist link's front face over the carrying joint's range where the wrist reaches past it (SO-101: 17 mm; g20's cube hit it). The hand boxes (hand_boxes) also carry RobotDescription.wrist_links_of(attach_link, wrist_links), the kernel's wrist links (Isaac R87: panda_link6 at the bowl rim was no contact to the tracker; DROID's welded-on carrier had left out panda_link7 too). ROSConfigError on a non-gripper joint, no calibration, or padless fingers.
  • pinch_in_link(jaw) -> PinchVolume (L199) — J_h (unpadded): the box in (c, a, b) around the pads swept from the measured jaw to closed (16 samples), clipped at the palm plane.
  • open_end (property) (L214) — The end of the jaw's position_limits farther from the closed end: the manifest's full stroke.
  • fallback_in_link(jaw, opening=None) -> PinchVolume (L219) — The PINCH_FALLBACK payload, OT-10 bounded (#418 r4: the old pad-width box under-covered every held orange, banana and carton by 4–16 cm): along c the pad gap at opening, the jaw the grasping closure started from (the whole stroke when none was seen); along a and b the full stroke (the pad gap at open_end) from J_h's centre at jaw; back face on the palm plane.
  • hand_boxes(frame, positions) -> list[Box] (L242) — The fingers', palm link's and wrist's collision primitives as boxes in frame (never evidence of an object).
  • t_frame_from_attach(frame, positions) -> NDArray (L250) — T_frame<-attach_link by FK.

python/world_state/src/openral_world_state/object_tracker/binding.py

Issue #418 WP C2, design "Grasp binding and in-hand update". ATTACH binds what meets J_h; the bound geometry then only grows (the kernel's K4 union). Logs object_tracker.bound / untracked_grasp / ambiguous_grasp / bound_geometry_grew / bound_geometry_cap. The map never grows a payload (removed 2026-11-02: 46 of 62 map-grown pieces in the restock audit were not the object).

  • MAX_PRIMITIVES = 16 (L79) — The kernel's per-object primitive cap (K4).
  • TRACKED_CONFIDENCE = 0.7 (L81) — A tracked binding's confidence (region_attachment's).
  • FALLBACK_CONFIDENCE = 0.2 (L83) — A pinch fallback's (the HAL jaw-span fallback's).
  • class TrackStoreLike(Protocol) (L97) — The C1 TrackStore interface.
  • get(object_id) -> TrackedObject | None (L100) — One track.
  • all() -> list[TrackedObject] (L103) — Every track.
  • replace(obj) -> None (L106) — Store under its id; bumps the set revision.
  • class BindOutcome(StrEnum) (L110) — TRACKED, AMBIGUOUS, PROVISIONAL, UNTRACKED.
  • class Binding(outcome, attachment, candidates, reground) (L120) — One hand's held payload as published on /openral/attachment_state; reground asks for a re-ground after lift.
  • class GraspBinder(hand, *, frame_id, cell_m, max_track_fit_age_s) (L435) — One hand. frame_id must be the manifest's base_frame (FK root), else ROSConfigError. Free-track geometry may bind only when its fit stamp is nonfuture and within this existing tracker age bound (an OCCLUDED target track's map agreement counts as fresh too, 2026-10-31); RELEASED fall-column regrasp is separate.
  • pinch_in_frame(positions) -> Box (L495) — J_h grown by one cell, in the grid frame.
  • object_pose(positions) -> Pose6D (L501) — The held object frame in the grid frame, FK(q) · pose_in_link (the release pose).
  • observe_jaw(jaw) -> None (L468) — Keep the jaw the last closing stroke started from (its most open reading; fed every joint state by the session); it bounds the next fallback's width along c. A reopening starts a new stroke only past half the manifest's stall_gap, so jitter never narrows it; a regrasp closing from part way no longer takes an earlier full-stroke opening (Spark bkA_on_rs_10).
  • on_attach(store, positions, stamp_ns) -> Binding (L509) — Provisional candidates never bind an identity: with clear candidates they are ignored; with only provisional ones the payload is PROVISIONAL, PINCH_FALLBACK of the fallback box ∪ their boxes cut at the palm plane (provisional_grasp, reground=True): measured but maybe short, so unioned it only grows the payload. Candidates: free tracks (TENTATIVE/CONFIRMED/OCCLUDED/SPLIT) of any role but DESTINATION (never the payload: Spark R193 / R205 bound the bowl, destination_not_bound) whose measured geometry holds J_h's centre within one cell (their tight k-DOP when they carry one, else the box; a padded box merely meeting the swept pinch volume bound a tracked neighbour of an ungrounded held orange, p2po_on2); a RELEASED track is never one (not followed after release). One: TRACKED_OBJECT under the track id (pose_in_link = T_link⁻¹·T_obj, the shape — tight hulls or the box — unioned with itself slid along c onto the pinch axis), the track set BOUND. Two or more: PINCH_FALLBACK of the fallback box ∪ the candidates' boxes (cut at the palm plane) (one enclosing box past 15), object id pinch:<joint>@<stamp>, no track touched. None: the fallback box alone (HandModel.fallback_in_link at the opening of the closing stroke observe_jaw kept), reground=True. A tracked binding's primitives are cut at the palm plane (_palm_clipped: nothing held lies behind the palm). The outcome is final for the hold, in every TrackingMode: nothing promotes a PROVISIONAL hold later (an in-hand fit sees the gripper past the occluder band, so A4 keeps it provisional anyway); the candidate's flag that decides it is logged at object_tracker.mint and on each flip (object_tracker.provisional_changed, ObjectTracker._refit_track).
  • on_regrasp(positions, stamp_ns) -> Binding | None (L771) — Unions the shape slid onto the new pinch axis, geometry_revision + 1; None when already on it or past the cap (union kept).
  • on_release() -> None (L784) — Forget the held payload.

python/world_state/src/openral_world_state/object_tracker/release.py

Issue #418 WP C2, design "Release". Source-clock stamps only.

  • class JawReleaseMonitor(hold, closed, release_gap, release_dwell_ns) (L38) — The jaw-open trigger (the kernel's K5, mirrored): further from closed than hold + release_gap continuously for the dwell; a source clock going back restarts it.
  • opened_ns (property) — When the jaw first read open in the current run (the let-go), or None; the session freezes a jaw-open release at the joint sample nearest it, not at the decision a dwell later. (L63)
  • for_hand(hand, *, hold, release_dwell_s) -> JawReleaseMonitor (L68) — release_gap = half the manifest's stall_gap (its release hysteresis).
  • observe(jaw, stamp_ns) -> bool (L74) — Fold one sample in; True once open for the dwell.
  • release_track(store, object_id, *, object_pose, support_z, cell_m, stamp_ns) -> TrackedObject | None (L104) — A BOUND track → RELEASED at the release pose (yaw-only box containing the tilted body, hulls dropped, binding fields cleared, support/floor from the support measured under the release pose); a box breaking the caps goes LOST (logged).

python/world_state/src/openral_world_state/object_tracker/session.py

Issue #418 WP D1. TrackerSession — the ROS-free glue the object-tracker lifecycle node drives: goals from the declarations, the grounding wait, binding/release at grasp events and the jaw-open rule. All stamps source time. A RELEASED track is never followed: it lives out the release window (the kernel freezes the payload: in tracking the session re-attaches the released record to the root at the let-go pose with released_by_link, in on the record stays as held and the exemption provider releases it), is then retired (released_track_retired), and the object is found afresh under a new id. Logs object_tracker.goal_closed / grounding_ready / grounding_incomplete (error level under grounding_required) / reground_queued / jaw_open_release / ambiguous_pruned / grasp_event_unposed.

  • const STATION_MOTION_M = 0.02 (L170) — Planar base displacement (m) past which TrackerSession.on_joint_state carries the base-frame state to the new base pose; tracking_thresholds.yaml tracker.station_motion_m, the safety kernel's station_motion_translation_m default.
  • const CARRY_MAX_M = 0.75 (L176) — Base travel (m) a track is carried by odometry since its last fit (tracker.carry_max_m). Travel and turn share one budget (m / CARRY_MAX_M + rad / CARRY_MAX_RAD > 1 drops it): at a 2 % odometry drift (calibration point) the carried box stays within the 1.5 cm extrinsic bound the grounding pad budgets (MAX_PLANAR_ERR_M). Records with no fit of their own (released records, query priors, let-go and placed records) share the station's budget since it was entered.
  • const CARRY_MAX_RAD = 0.8 (L177) — The turn counterpart (rad; tracker.carry_max_rad): 2 % of the turn at the 0.9 m manipulation reach within the same 1.5 cm.
  • const STATION_ROTATION_RAD = 0.02 (L171) — The rotation counterpart (rad per revolute base dof): tracker.station_rotation_rad, the kernel's station_motion_rotation_rad default.
  • class StationChange(NamedTuple) (L362) — What a measured base move did (TrackerSession.on_joint_state): why (base_moved = carried; base_unmeasured / base_measured / clock_reset / base_untrusted = discarded, fail closed), carried, dropped track ids, released records retired.
  • const RELEASED_CLEAR_TIMEOUT_S = 3.0 (L124) — The released-binding lifetime default (must equal the kernel's tracked_release_timeout_s and the voxel bridge's released_clear_timeout_s).
  • const RELEASE_DWELL_S = 0.3 (L121) — The jaw-open release dwell default; the node's param defaults and the deploy launch (release_dwell_s, the exemption provider's contact_exemptions.tracked_release_dwell_s, the tracked_release_timeout_s launch-arg default) read them.
  • class TrackingMode(StrEnum) (L234) — tracking, on (DeployRuntime.object_tracking; off never starts the node; the removed shadow / bind map to tracking in the schema). tracking (open): tracks, grounds and may ADD geometry (grow-only payload binding); every contact allowance published comes from a scene declaration (search_box, workspace_box, a PlaceZone), a track only confirms one is populated. on (needs the Pro exemption provider): track-driven allowance.
  • class GraspEventKind(StrEnum) (L251) — attach, regrasp, detach (openral_msgs/GraspEvent.kind).
  • declaration_key(target_id, stamp_ns) -> str (L400) — The kernel's "<target_id>@<stamp_ns>".
  • zone_candidates_target_id(zones) -> str (L186) — Station mode: the place target_id naming a candidate set, zone:<a>|<b>|... (sorted): the rSkill runner names every zone the prompt matches when the same slot is declared at several map / odom-frame stations; TrackerSession._zone_region keeps the one whose box centre, re-expressed in the grid frame (zone_transform + rebase_box), lies inside zone_reach (the launch's world-map coverage ball: the kernel collision model's moving-link reach plus margin); none or several in reach → no region, every candidate's reason logged (object_tracker.place_zone_chosen / _unchosen).
  • ZONE_CANDIDATE_SEP = "|" (L223) — Separates the zone names of a candidate-set place target_id (PlaceZone.name never holds it).
  • zone_candidate_names(target_id) -> list[str] | None (L214) — The names of a candidate-set target_id; None for a single zone or anything else.
  • class TrackerSession(description, *, cell_m, grounding_wait_s, grounding_required=False, release_dwell_s=RELEASE_DWELL_S, released_clear_timeout_s=RELEASED_CLEAR_TIMEOUT_S, params=None, require_hands=False, derive_attach=False, wrist_links=1, mode=TrackingMode.TRACKING) (L410) — mode selects the region semantics below (default tracking, the safer). One ObjectTracker in the manifest's base_frame and one GraspBinder per gripper joint (require_hands: a gripper the binder cannot model is a ROSConfigError, else logged and skipped).
  • now_ns (property) (L596) — The newest source stamp seen.
  • on_grid(grid, source_stamp_ns) -> None (L801) — Keep the newest grid in the tracks' frame (another frame: logged, ignored).
  • on_joint_state(positions, stamp_ns) -> StationChange | None (L1044) — Manifest-named joints; a hand's JawReleaseMonitor firing releases it. On a mobile base (RobotDescription.base_joints, all on the chain above base_frame with nothing else moving there, else object_tracker.base_chain_unsupported and no carry; the root is the parent of the topmost one) it first follows the measured base pose (issue #651, _follow_base), from a sample that carries every base joint (a sample without them says nothing about the base). The first finite pose anchors the station quietly, unless tracks measured before it exist (base_measured: dropped, the motion since is unknown). Once the pose leaves it by more than STATION_MOTION_M / STATION_ROTATION_RAD (openral_core.geometry.base_displaced), every base-frame record not riding the robot is re-expressed by the rigid base motion from the anchor to the new pose (link_transform over the base chain: the odometry in /joint_states, no tf2 buffer limit), once, at the source (_carry): each track (via ObjectTracker.rebase), each released record's pose_in_link and each query prior (_carry_records), and each resolved fixed-frame goal scope (re-resolved through tf2 at the next grid). The anchor then moves there. Riding the robot, never carried (_riding_robot): held payloads (BOUND, a live hold's candidates), and a track centred in the live grasp declaration's base-frame search_box (on a mobile base such a box is on the robot, e.g. a tote; a robot-mounted object outside it is carried as world-fixed, fails map confirmation within max_age_s and is measured again where it is). The grid, in-flight requests, zone cache and instance cells from the old pose are dropped, and base_moved_ns makes on_grid, on_instance_cells and the node refuse anything stamped up to the move. Fail closed, through leave_station (every unheld track dropped): a base pose that stops being measured (base_unmeasured, warning) and the first one after (base_measured), since the motion over the gap is unknown; a clock reset (clock_reset: a sim reset puts the base back, it does not drive there); a motion that lifts or tilts the base frame (base_untrusted). A track past the shared CARRY_MAX_* budget since its last fit is dropped, with its released record; a fresh fit restarts its budget. Logs object_tracker.base_moved (debug when nothing was dropped). Returns the StationChange, for the node to drop its queued frames and in-flight request; None otherwise, and always on a fixed base.
  • hands_clear_of_targets() -> bool — No hand holds anything and every hand's pinch box is _JUDGE_CLEAR_M (2 cm, box to box) clear of every CONFIRMED / OCCLUDED / RELEASED TARGET box (False with no such track); published by the node on /openral/object_tracker/hands_clear, where the completion check reads it (Spark banana R336 / R338 / R340: the judge said done with the fingers still on the banana). (L646)
  • held_attachments() -> list[AttachedCollisionObject] — Every hand's held payload, without the released records: what the node publishes on /openral/attachment_state while its station perception is off (a mobile base driving), with no grasp / place declaration (so no region and no tracked key reach the kernel). (L1464)
  • leave_station() -> tuple[list[str], list[str]] — Station mode (the node calls it on every activate / deactivate and station switch; on_joint_state only on a base move it cannot carry, issue #651): drops every track not held (BOUND or a live hold's candidate), every released record (no 3 s window), the grid, the in-flight and pending detection requests (ObjectTracker.drop_requests) and the zone resolve logs / cache, all base-frame state wrong once a mobile base drives; held payloads ride the hand and are kept (dropping them would publish "nothing carried"). A goal's fixed-frame scope resolved at the last station goes back to unresolved (matching no track) until tf2 resolves it at the new one, and the station anchor is cleared (the next measured base pose sets it). Returns the dropped track ids and the retired released records. (L703)
  • base_moved_ns: int (property) (L830) — Joint stamp of the last base move, carried or discarded (-1: none; cleared by a clock reset). on_grid refuses a grid stamped up to it (object_tracker.grid_before_base_move_ignored) and the node a depth frame.
  • open_standing_queries(queries) -> None — The deploy's prompt-time queries (object_queries_json) as goal deploy:deploy@0: they ground whatever declarations are in force (a scene with no place declaration still grounds its plate); a declaration's own goal re-keys the tracks they match. (L749)
  • on_grasp_declaration(decl) -> None (L1088) — Opens one standing query per target_queries entry under goal grasp:<key> (key = declaration_key), re-keys the live tracks the queries match (label + role) to it; a retraction or a new key closes the old goal. Under tracking a declaration search_box in the grid frame scopes its TARGET queries (within): only a track centred in it resolves the query or is keyed to the declaration (a same-label object elsewhere is not the goal's target, AMR aisle 2026-11-16); off the grid frame it logs object_tracker.search_box_unscoped and is not scoped; on keeps every instance keyed. A single seeded TARGET query (a recalled memory node, issue #631) scopes it by its seed instead, overriding the search_box; a seed equal to the declaration's own search_box (the runner's scene seed) is not an instance scope; seeds that differ name no single instance and are logged (object_tracker.goal_scope_ambiguous, label match only). The scope is re-expressed in the grid frame through zone_transform at every grid (the base moves under map); a lookup that misses (or a tilted transform) after it resolved keeps the last resolved box, one that never resolved leaves it in its own frame, so no track matches (fail closed); object_tracker.goal_scope logs each change of resolve state, with the lookup's error.
  • on_place_declaration(decl) -> None (L1139) — The same for destination_query (goal place:<key>).
  • on_jaw_command(gripper_joint, target, stamp_ns) (L819) — The approved gripper command, for the derived-attach read (derive_attach; tracking / on, sim only: a JawStallDetector per calibrated gripper reads commanded vs median measured jaw with the manifest's stall gap; its stall binds exactly as an ATTACH does and a real ATTACH for the same hold is a duplicate that returns the held binding untouched; the HAL trigger is unchanged and real hardware refuses tracking / on).
  • on_grasp_event(kind, gripper_joint, *, jaw, hold, stamp_ns, derived=False) -> Binding | None (L1166) — A non-finite jaw (the HAL had no measured jaw) falls back to the newest joint sample, else the event is logged and ignored; a non-finite hold takes the jaw. ATTACH binds at the measured jaw (a second ATTACH releases the first hold), arms the jaw-open monitor at hold, re-opens the live grasp goal's queries on an untracked grasp; REGRASP grows; DETACH releases (release_track at FK(q)·pose_in_link, support = the highest occupied cell top under the body, else the track's old support). None when the hand is unknown or the joints are unposed.
  • on_instance_cells(stamp_ns, frame_id, origin, resolution, cells) -> None (L758) — EXPERIMENT (pro#51): keep the newest /openral/instance_cells; applied at the next frame (ObjectTracker.apply_instance_cells) only on the tracker's own lattice (origin / resolution to 1 um).
  • on_frame(frame, *, wall_s, results=()) -> TrackerOutput (L1377) — A frame stamped up to base_moved_ns is from the old pose and is not fed (issue #651). Otherwise ObjectTracker.feed with the newest grid and the hands' spaces; an ambiguous union drops every candidate re-fitted after the ATTACH whose box no longer meets the pinch volume (geometry_revision + 1); grounding logged once per goal.
  • snapshot() -> TrackedObjectSet (L1456) — The table at the newest source stamp.
  • attachments() -> list[AttachedCollisionObject] — Every hand's held payload, then each released TRACKED_OBJECT binding still on the wire: kept (the kernel freezes it, the voxel bridge clears its box) until released_clear_timeout_s passes (source time), every hand collision box is _RELEASE_CLEAR_M (0.04 m, the kernel's tracked_release_clear_m FK separation) clear of its box (Spark R281; R370: an 8 cm pinch-volume rule left the box the kernel already held as a plain obstacle on the wire and it blocked the regrasp), or a CONFIRMED track of its label minted after the release touches its box: the object came to rest and is tracked again (Spark R369: the orange dropped onto the table, and the box frozen in the air stopped the arm carrying the next one); the update that drops it also retires the RELEASED track from the store (a released object is never followed, 2026-10-22 Spark R177-R185) and bumps attachment_changes. released_clear_timeout_s must equal the kernel's tracked_release_timeout_s and the voxel bridge's released_clear_timeout_s. (L1460)
  • workspace_region() -> PlaceRegion | None (L1473) — The live grasp declaration's workspace_box while the newest grid covers WORKSPACE_MIN_COVER of its footprint, re-stamped with the grid's source_stamp (the HAL producer's rule); the node relays it as workspace_region in tracking/on, where the producer stands down. Declared workspace_box in both modes (confirmed on the grid, never shaped by a track).
  • place_region() -> PlaceRegion | None (L1492) — The live place declaration's region while a payload is held, else None (fail closed). A declaration whose target_id is zone:<name> gets that declared PlaceZone's box (the session's place_zones, the node's place_zones_json), stamped with the newest grid's source_stamp, evidence_ref declared:<name>; a zone in a fixed frame (map / odom) is re-expressed in the grid frame through zone_transform (the node's tf2 lookup, grid <- frame at the grid's source_stamp) with openral_core.geometry.rebase_box; an unknown zone, no transform at that stamp, or a base tilted past 0.5° is None, logged once per zone and state change (object_tracker.place_zone_{resolved,no_tf,rejected,refused}; the logs are forgotten on a zone reload, a new place declaration, leave_station and a clock reset, so each state logs again). A zone outside zone_frames (zone_frame_refusal) is refused even when the deploy CLI was bypassed (a launch arg). The region is computed once per (target, grid stamp) when it resolves. That is the only place region in tracking. In on only, otherwise the one CONFIRMED / OCCLUDED DESTINATION track labelled as its destination_query, its box stamped with its last map confirmation. Safety-WG review owed.
  • grasp_region() -> PlaceRegion | None (L1643) — tracking only (on: always None): the one CONFIRMED / OCCLUDED / BOUND TARGET track keyed to the live grasp declaration, its box returned only while all eight corners lie inside the declaration's search_box (a track narrows the declaration, never widens it; the declared box itself would allow more than off, whose HAL grasp-target leg measures a region inside it), stamped with the track's last map confirmation, evidence_ref tracked:<id>|epoch=<n>|within:search_box (within:search_box+scope when the grasp goal has a memory-node scope, #631: the one keyed track must also be centred in it, BOUND included, else None; the scope narrows which track, never the extent, #652); None (fail closed) without a declaration, a grid, a search_box in the grid frame, exactly one such track whose centre is in it, or within GraspDeclaration's caps. The kernel latches it at handover (ADR-0115). 2026-11-01 mode split (tracking = declarations only); Safety-WG review owed.
  • zone_frames: frozenset[str] / zone_frame_refusal(zone) -> str | None — The frames a PlaceZone may be declared in: the robot's map_frame / odom_frame, plus its base frame on a fixed-base kind (manipulator / bimanual) only; the reason any other zone is refused (None if allowed). The node logs refused zones at load (object_tracker.place_zones_refused). (L403) (L523)
  • zone_frame_refusal(zone) -> str | None — Why zone is refused for its region.frame_id, or None when the frame is in zone_frames: a base frame on a mobile robot (the box would ride away from the furniture; declare it in map_frame), or any other frame that is neither map / odom nor a fixed base frame. (L582)
  • place_zones: dict[str, PlaceZone] (property) — The declared zones by target_id; setting it forgets the zone resolve logs and cache. (L555)
  • zone_transform: Callable[[str, int], NDArray | None] | None (property) — tf2 grid <- frame at a stamp (the node's lookup) used to resolve a zone declared in a fixed frame, and a grasp goal's seeded scope (#631, the last resolved box kept across a miss), into the grid frame; the node sets it on every configure; unset, no fixed-frame zone resolves. Setting it drops the zone cache (regions resolved through the old lookup). (L565)
  • hand_spaces() -> list[PlaceRegion] (L1728) — The hands' collision boxes at the measured configuration (empty while unposed).

packages/openral_octomap_bridge/include/openral_octomap_bridge/self_filter.hpp

C++ (Layer 2). The real-camera counterpart of the sim depth renderer's robot transparency: removes the robot's (and a held payload's) own returns from a depth cloud before octomap_server inserts it. Poses the kernel's own collision primitives via an FK that mirrors the kernel's operation for operation (a test links the kernel library to pin it; the runtime does not, since Layer 2 may not depend on Layer 5). The node is src/robot_self_filter.hpp (robot_self_filter executable), wired by deploy_e2e.launch.py on the real path only.

  • enum class SelfJointKind — The kernel's joint codes: kFixed / kRevolute / kPrismatic / kMimicRevolute / kMimicPrismatic (a mimic kind reads another joint's column and moves by mimic_multiplier * q + mimic_offset, the OpenArm's follower finger; SelfModelParams::mimic_multiplier / mimic_offset are the per-link collision_mimic_* arrays, empty = identity).
  • kSelfDopAxes / kSelfDopAxis / kSelfMaxHullVertices / kSelfHullContainmentEpsilonM / kSelfGjkMaxIterations / kSelfGjkTolerance — The kernel's kDopAxes / kDopAxis / kMaxTightHullVertices / kTightContainmentEpsilonM / kGjkMaxIterations / kGjkTolerance, pinned equal by test_self_filter.cpp.
  • struct SelfHull — One box's tight geometry in the box frame: 13 dop_lo / dop_hi slabs plus the exact hull's vertices (empty = DOP only).
  • self_hull_distance(hull, local, stop_above, stop_at_or_below = -inf) -> double — Lower bound on the point-to-hull distance (<= 0 inside): the 26-DOP slab bound, then GJK on the vertices with an exhaustive support scan; exact to 1e-9 on convergence, never an over-report. Stops early once the answer is settled against either threshold. Pinned against the kernel's dop_cell_lower_bound + hull_cell_distance (half_side = 0) on panda_mobile's hulls. Allocation-free.
  • struct SelfModelParams — The kernel's collision_* parameter arrays, exactly as the launch passes them, including the tight-geometry CSR arrays (box_hull, hull_dop_lo/_hi, hull_vertex_first/_count, hull_vertices).
  • struct SelfModel — Flattened tree + every link-attached primitive (capsule, sphere as a zero-length capsule, box) in its link frame, primitive_hull (parallel, index into hulls or -1) and hulls; link_index(name) -> int.
  • self_transform_from_xyz_rpy(x, y, z, roll, pitch, yaw) -> tf2::Transform — Rz·Ry·Rx, the kernel's transform_from_xyz_rpy element for element.
  • build_self_model(params, out, error) -> bool — All-or-nothing, like the kernel's load_collision_model: any shape disagreement, out-of-order parent, unknown joint code, out-of-range primitive link or non-finite/negative dimension refuses the model. Tight geometry is held to the kernel's loader shape checks and validate_tight_hull chain (vertices ⊆ DOP ⊆ box, finite, non-inverted, positive extent, <= 320 vertices); where the kernel falls back to the box, the filter refuses the model.
  • curve_value(curve, x) -> double — Piecewise-linear (x, y) curve at x, clamped at the ends: the kernel's link_joint_value curve step, applied to a curved link (SelfModelParams::curve_point_* / curve_points, SelfModel::curves; #533) before any mimic relation.
  • self_forward_kinematics(model, q, n_dof, link_world) — Link frames in the model root; pinned to 1e-12 against openral_safety_kernel::forward_kinematics by test_self_filter.cpp.
  • place_self_primitives(model, link_world, frame_from_root, out, out_hulls = nullptr) — Every robot primitive placed in the cloud's frame; out_hulls receives each one's SelfHull* (or null) in parallel.
  • kMaxTrailingSweepS = 0.5 — Cap on the self-filter's trailing_sweep_s (issue #418, Safety-WG pending): how long a volume the robot left stays blind to new returns. The node refuses a value outside [0, 0.5] and forwards nothing.
  • kMaxSelfFilterPaddingM = 0.10 / valid_self_filter_padding(padding_m) -> bool — Cap on the self-filter's padding_m (the blind shell around the arm, hazard log Entry 035) and its check: in [0, 0.10], finite. RobotSelfFilter logs an ERROR and forwards nothing otherwise. Mirrors DeployRuntime.robot_self_filter_padding_m <= 0.10 (pinned by tests/unit/test_perception_caps_mirror.py).
  • class SelfMask — Primitives in the cloud frame with inverse poses and broad-phase bounds precomputed once per cloud; set(primitives, padding_m, hulls = {}, extra_padding_m = {}) (per-entry padding padding_m + extra_padding_m[i], clamped to kMaxSelfFilterPaddingM: a fast link is under-padded, a false stop, never more world erased; entries past extra_padding_m — payloads — get padding_m), contains(p) -> bool, padding(i) -> double. A box with a hull: box shell first (cheap reject, hull ⊆ box), then self_hull_distance.
  • struct JointSample / enum class JointStateVerdict (kOk, kNoState, kGap, kExtrapolation) / joint_state_at(history, stamp_ns, period_s, max_skew_s, q, qdot) -> JointStateVerdict — Joint positions and rates at a stamp, linearly interpolated between the bracketing samples of a stamp-sorted history; refused when they are > 2 periods apart, when reaching the stamp needs > 1 period of extrapolation (one sample is never extrapolated), or when the nearest sample is past max_skew_s. A stamp on a sample is that sample. Issue #418.
  • self_primitive_motion(model, link_a, link_b, out) — Per robot primitive, |Δorigin| + bounding radius × rotation angle between two FK poses: an upper bound on any of its points' displacement. The node's velocity padding (FK at q vs q + qdot·velocity_padding_dt_s).
  • kRobotMaskFree/Uncertain/Robot (0/128/255) / kRobotMaskDepthTolM = 0.005 / kRobotMaskHandMarginM = 0 / kRobotMaskArmMarginM = 0.010 / kRobotMaskSeeThroughM = 0.03 (#418: a return that far behind the rendered front and > 10 mm outside every primitive is seen past the robot's envelope, not ROBOT) / struct PinholeCamera / struct RobotMaskScratch / render_robot_mask(primitives, hulls, backstop_margin_m, depth_m, camera, uncertain_px, scratch, mask) — The robot mask of one depth image from UNPADDED primitives in the optical frame: per primitive, a ray per pixel of its projected bounding box only (capsule/sphere analytically, a box or a hulled box's 26-DOP by slabs; the DOP contains the hull, so the silhouette only grows) into a z-buffer Z_r; ROBOT iff Z_r <= D + 5 mm (an object in front of a finger stays FREE) or the back-projected return is within its primitive's backstop margin; UNCERTAIN within uncertain_px (Chebyshev) of both a ROBOT and a non-ROBOT z-test pixel, or where the robot covers a pixel with no return. Buffers reused across frames. Issue #418.
  • struct SelfFilterStats — points_in, non_finite, removed, kept for one call.
  • filter_xyz_points(data, n_points, point_step, x_offset, y_offset, z_offset, mask, out) -> SelfFilterStats — Copies every finite point the mask does not contain, whole records, in order.
  • xyz_records(data, point_step, x_offset, y_offset, z_offset) -> std::vector<std::uint8_t> — The x/y/z of each record as packed 12-byte FLOAT32 records (offsets 0, 4, 8): a coloured cloud's points for octomap, which reads nothing else.
  • xyz_cloud_layout_valid(data_size, n_points, point_step, x_offset, y_offset, z_offset) -> bool — Overflow-checked: n_points * point_step fits in data_size and every FLOAT32 coordinate offset lies wholly inside a record. The precondition filter_xyz_points / xyz_records trust; the self-filter node drops a cloud failing it (throttled error log).
  • class RobotSelfFilter (src/robot_self_filter.hpp) — The node (the model is posed in the base_frame parameter, on a fixed arm too, else, with none given, in its root link's name; a mobile manipulator's planar base dofs, collision_base_dofs, held at zero and the model posed in base_frame, as the kernel does, so TF needs nothing above the base; never read from or required in a joint state; it forwards nothing unless the root -> base_frame chain is identity-origin fixed / revolute / prismatic links, no curve, moving on exactly collision_base_dofs, with no other link on a base dof): joint positions interpolated at the cloud's CAPTURE stamp (joint_state_at: joint_state_period_s, default 0.05 s, the launch passes 1 / control_freq_hz; max_joint_state_skew_s; manifest names or their collision_joint_aliases; only complete samples are kept, sorted by stamp, and only from a message carrying at least one posed joint, so another publisher's joints never re-stamp a stale arm), camera pose from tf2 at that stamp, held payloads from /openral/world_state_fast. No pose at the stamp — including a refused gap or extrapolation (totals().refused_joint_gap / refused_extrapolation, WARN rate-limited) — drops the cloud (the map goes stale and the kernel fails closed); an unplaceable payload stays in the cloud. Robot primitives are padded padding_m + motion within velocity_padding_dt_s (δt_sync, default 0.02 s), or, with trailing_sweep_s > 0 (default 0; the deploy launch's _self_filter_trailing_sweep_s: 0.2 s in sim, 0 real), the larger of that and their motion since stamp − trailing_sweep_s, capped at kMaxSelfFilterPaddingM. Optional robot mask (robot_mask_enabled, default off; robot_mask_cameras + parallel robot_mask_depth_topics / robot_mask_camera_info_topics / robot_mask_topics, robot_mask_hand_links get the 0 mm backstop, others 10 mm, robot_mask_uncertain_px = 3): per depth image (32FC1 or 16UC1 mm) with a matching CameraInfo, the unpadded model posed at the DEPTH stamp is rendered (render_robot_mask) and published mono8 with the depth header, BEST_EFFORT KEEP_LAST 5; a frame it cannot pose publishes nothing (masks_dropped). Forwards the capture stamp unchanged; logs self-filter: every 5 s. cloud_out is x/y/z only; an input with more fields (a sim cloud's rgb) also goes out whole, robot removed, on cloud_out_rgb (/openral/world_cloud/self_filtered_rgb) for viewers, only while that topic has a subscriber.

packages/openral_octomap_bridge/include/openral_octomap_bridge/payload_clearing.hpp

C++ (Layer 2). The attached payload's own occupancy leaves the published OccupancyVoxels grid here, partitioned against the safety kernel's support-contact witness (ADR-0092 D6); header-documented and gtested against a real octomap::OcTree.

  • struct PayloadPrimitive — One attached-payload collision primitive placed in the grid frame, mirroring the kernel's AttachedPrimitive conventions (a capsule's segment on local +Z, a box's half-extents on its own axes).
  • struct SupportPatch — One attested support contact placed in the grid frame (point + outward normal + patch radius + max penetration); the wire form is openral_msgs/SupportContactWitness, lifted here through the payload's live pose. has_anchor / anchor_point / anchor_normal: the attestation's plane on its first grid (SupportPatchAnchors); when set, a cell is withheld only if both planes claim it.
  • pose_from_msg(pose, out) -> bool — A wire pose as a transform; false on a non-finite position or a zero quaternion (never silently the identity).
  • place_attached_object(object, grid_from_link, out, out_patches) -> bool — Place one wire AttachedCollisionObject's primitives (and support patch, when valid) using the kernel's own pose composition. Fail-closed on any of the kernel's ingest_attached_objects validation rules, returning false and appending nothing — so a rejected object clears nothing.
  • support_patch_withholds(patch, center, resolution) -> bool — Does an attested patch withhold this cell from clearing? Mirrors the kernel's support_contact_exempts (with zero slack) so the withheld set is always a subset of what the kernel exempts — a withheld cell can never be the one that stops the robot. With an anchor it is the AND of the live and anchored planes (only ever narrower). Deliberate mirror of the kernel predicate; see 14-duplication-watch.md item 8.
  • clear_attached_payload_cells(grid, primitives, patches, padding_m) -> size_t — Zero every occupied cell within resolution·√3/2 + padding_m of a payload primitive's surface, except cells a patch withholds; returns the count cleared. Only ever writes 0 (never marks); a grid with mismatched dimensions or non-positive resolution is left untouched.
  • struct AttachedObjectRevision — One payload's attachment-record identity: the wire object_id plus WorldStateStamped.attachment_revision, the producer's counter bumped once per atomic change, never per frame.
  • struct AttachSweepObservation — That identity plus the payload's payload_position on one grid, stated in the OctoMap frame — not base_link, since a payload motionless in the base frame on a driving base still leaves residue behind.
  • class AttachSweepLedger — The bridge's attach-window memory (the other is SupportPatchAnchors): the open attach-transition window per live object (identity, the position it is anchored at, whether it has shut). Not a latch on cells — nothing about which cells were cleared is remembered, and no cell is held out of a later grid.
  • sweep(present, window_m) -> vector<uint8_t> — Which of present are still inside their attach-transition window, answering and recording in one call. A key seen for the first time opens its window; the window latches closed once the payload has moved more than window_m from its anchor, and an absent object is forgotten (so detach restarts the window).
  • size() -> size_t — How many windows the last swept grid carried.
  • struct SupportWitnessKey — The kernel's support-witness re-arm key (object id, support id, producer stamp_ns), with operator==.
  • struct SupportPatchObservation — One attestation on one grid: its key and its SupportPatch in the world-fixed OctoMap frame.
  • class SupportPatchAnchors — The first-grid plane per live attestation, so the bridge's support band stays on the support instead of riding a lifted payload into its own stale interior (Isaac i64/i70 false stop). Same commit discipline as AttachSweepLedger.
  • anchor(present) -> vector<SupportPatch> — The first-seen patch for each of present, in order; an absent key is forgotten.
  • using AttachLinkTfFrames = std::unordered_map<std::string, std::string> — Manifest attach link → the TF frame it is looked up as.
  • parse_attach_link_tf_frames(entries, out, error) -> bool — Parse the bridge's attach_link_tf_frames param ("link=frame", the HAL's vision_attachment_tf_frames strings; empty entries skipped). A malformed entry or a link mapped to two frames returns false with error set and out EMPTY, so every link falls back to its own name and a renamed hand's payload stays in the map (fail closed).
  • tf_frame_for(frames, attach_link) -> const std::string& — The frame clear_attached_payload asks tf2 for: the mapping, else attach_link itself.
  • attach_transition_padding(steady_padding_m, attach_sweep_padding_m) -> double — The clearing padding one object gets on one grid: steady padding plus the attach-sweep padding while its window is open, so widened sweep is never tighter than an ordinary frame. Non-finite or negative inputs contribute 0 — a parameter can never narrow the clearing below what the payload's volume explains.
  • struct SweptBox — Axis-aligned box (lo, hi, valid, add(point)) in the octomap frame: one carried-payload primitive at one attached pose; the bridge clears these from the octree via payload_sweep_clear_service (octomap_server ~/clear_bbox) every payload_sweep_clear_period_s, attached poses only (no pre-attach backfill). Off by default; the launch sets the service only for DeployRuntime.payload_sweep_clear_enabled on hal_mode == "sim". User-approved 2026-10-16; Safety-WG review + hazard-log row owed (the payload's volume is cleared from the world map).
  • add_payload_to_swept_box(box, primitives, frame_from_base) -> void — Grow the box by the exact axis-aligned bounds of the placed primitives (box corners; sphere/capsule caps grown by the radius); non-finite primitives add nothing.
  • payload_primitive_boxes(primitives, frame_from_base) -> vector<SweptBox> — One box per primitive at its exact bounds (add_payload_to_swept_box on that primitive alone): the payload's own posed volume at one pose, never the AABB of its motion (PR #417 review: a diagonal approach's AABB took in the neighbour beside the path).
  • enum class SweepFloor { kSupport, kMeasuredPayload, kNone } — Where floor_swept_box put a box's floor; kNone = do not clear it.
  • struct SweepSupports — Every support known for a swept box, in its frame: patches (attested during the carry, as first attested), static_points (declared static geometry), has_measured_floor / measured_floor_z (a measured payload's lowest point at attach).
  • floor_swept_box(box, supports, resolution) -> SweepFloor — The swept-volume clear_bbox never reaches below a support: one cell above every patch under the box and every static point under its footprint below its top, and never below the REGION payload's attach bottom when measured (the highest bound wins; a support under the box never switches it off) (the node sets SweepSupports::measured_floor_z only for evidence_kind == "grasp_target_region"; a segmented payload's bottom can include counter / depth-edge points, LeIsaac g17); with neither (a segmented or gripper-closure payload), kNone and the box is not cleared (DROID t7 fix). A non-vertical patch under the box is kNone; every kNone leaves box.valid == false.
  • floor_pose_boxes(boxes, supports, resolution, out) -> SweepFloor — One clearing period's clear_bbox set: each posed box floored by floor_swept_box and never below the union's floor (the highest bound wins, so it clears a subset of what the one union box would); kNone boxes and boxes inside one already in out are dropped; the union's kNone clears nothing.

packages/openral_octomap_bridge/include/openral_octomap_bridge/identity_clearing.hpp

C++ (Layer 2). Octomap clearing by identity (issue #418): an unambiguous tracker binding's cells, its sweep since t_attach and its vacated box; PINCH_FALLBACK / ambiguous bindings get none (hazard OT-8). Wired in OctomapVoxelBridge::clear_by_identity (release window: clear_released_box).

  • kTrackedObjectEvidence / kPinchFallbackEvidence — The AttachmentEvidenceKind wire values; the legacy path skips both.
  • kIdentityBackfillMaxS = 5.0, kIdentityBackfillStepS = 0.05, kIdentityMaxInterpGapS = 0.25, kIdentityMaxClearBoxes = 64 — Backfill depth and step, the longest gap bridged by interpolation, and clear_bbox requests per clear.
  • kReleasedClearTimeoutS = 3.0, kReleasedClearTimeoutMaxS = 10.0 — Default and bound of released_clear_timeout_s; must equal the kernel's tracked_release_timeout_s (K5).
  • IdentityKeys, struct ReleaseClear, ReleaseClears — (object_id, epoch) set; one open release window (epoch, opened stamp) and the windows by id.
  • advance_release_clears(windows, was_bound, state, grid_frame, now_ns, timeout_s) -> vector<const TrackedObject*> — Release window (#418 F2): opens for a released track whose (id, epoch) the bridge cleared by identity last tick; kept while the track is unique, released, same epoch, the wire carries exactly one tracked_object attachment with that id and epoch, and within the timeout; else erased for good.
  • released_clear_pieces(set, track, frame_from_grid, pieces, keep) -> bool — A RELEASED track's box as the clearing piece plus its keep-out (floor_z, other tracks' boxes).
  • tracked_set_usable(state, grid_frame) -> bool — Valid set whose frame and every box's frame is the grid frame.
  • identity_clearing_track(object, state, grid_frame, why=nullptr) -> const TrackedObject* — The bound track licensing identity clearing, or null (why, when given, names the failed condition as a snake_case token) (wrong kind, unusable set, no or duplicated id, not bound, epoch / attach-link mismatch, non-finite floor_z, another track bound to the link, another payload on it).
  • track_box(track, out) -> bool — A track's box as a SHAPE_BOX PayloadPrimitive; fail-closed on a bad extent or pose.
  • struct IdentityPiece — One placed primitive, its inverse pose and optional tight hull (SelfHull).
  • place_identity_pieces(object, frame_from_link, out) -> bool — place_attached_object plus each primitive's tight refinement; malformed tight geometry clears nothing.
  • identity_covers(pieces, c, half_cell) -> bool — Cell centre within half a cell of a primitive AND its tight hull.
  • struct IdentityKeepOut — Floor plane + boxes no cleared cell may meet.
  • identity_keep_out(set, self, frame_from_grid, keep_own_box, out) -> bool — self.floor_z plane and every other track's box (own box too when keep_own_box), in the clearing frame.
  • identity_keeps(keep, c, resolution) -> bool — Below the floor or within the circumradius of a keep-out box.
  • clear_identity_cells(grid, pieces, keep) -> size_t — Grid current-pose clear; never marks.
  • append_swept_poses(out, a, b, reach_m, step_m) -> void — Interpolated poses (lerp + slerp) so no point within reach_m moves more than step_m.
  • octree_clear_boxes(tree, window, clear, max_boxes, truncated) -> vector<SweptBox> — Accepted occupied finest leaves as cell-exact clear_bbox boxes (x-runs merged along y), capped.

packages/openral_octomap_bridge/include/openral_octomap_bridge/octree_freshness.hpp

C++ (Layer 2), header-only. When the bridge may still republish the last octree it received (hazard log Entry 033).

  • kMaxOctreeAgeS = 2.0 — Cap on max_octree_age_s: the kernel's own world_voxel_deadline_ms cap. Mirrors DeployRuntime.world_voxel_deadline_s <= 2.0 (pinned by tests/unit/test_perception_caps_mirror.py).
  • valid_max_octree_age(max_age_s) -> bool — Is max_octree_age_s usable: in (0, kMaxOctreeAgeS]; NaN and infinity are not. The node logs an ERROR and publishes nothing otherwise.
  • octree_is_fresh(age_s, max_age_s) -> bool — May an octree received age_s ago (receipt time, the node's clock — the one the kernel times voxel freshness on) still be published? False for an unusable bound and for a negative or non-finite age, so a map of unknown age is never republished; past the bound the bridge goes silent and the kernel's world_voxel_deadline_ms drops with DROP_VOXEL_UNAVAILABLE.
  • OccupancyVoxels.source_stamp (set by the bridge node in src/octomap_voxel_bridge.hpp) — The octree's own stamp, which octomap_server takes from the capture stamp of the cloud it inserted, carried into every grid built from it. header.stamp is production time (fresh on every republish) and cannot say how old the WORLD is; this can, and the kernel's world_voxel_data_age_budget_ms budgets it (an unset value reads as stale). The bridge logs world_voxels data age N ms at publish every 5 s.

packages/openral_octomap_bridge/include/openral_octomap_bridge/octree_to_grid.hpp

C++ (Layer 2). OctoMap → dense base-frame grid lowering, ROS-graph-free.

  • struct GridSpec — The volume to cover: center[3] + radius, a ball (not a box) in the base frame, since only a ball keeps cell count heading-invariant as the octree's lattice turns with base_frame. radius must reach wherever the kernel's checked geometry can go — a manifest property, so the bridge node has no default that publishes.
  • rasterize_octree_to_grid(tree, base_to_octomap, spec, base_frame) -> openral_msgs::msg::OccupancyVoxels — Lower a real octomap::OcTree onto the kernel grid on the octree's own lattice, so occupied volume carries over exactly. Returns an empty (unpublished) grid on an unusable radius/spec rather than throwing from the timer callback; still inherits octomap's own ≤1-resolution sensor-ward inflation.
  • mark_base_points(grid, base_points) -> std::size_t — Marks every cell of a published grid that contains one of the base-frame points occupied, on the grid's own placement (origin/orientation/resolution); only adds occupancy; returns cells newly marked; a malformed grid is left untouched. The bridge applies it to the declared static geometry (static_points_file param) before payload clearing. (#349)
  • load_points_file(path, out, error) -> bool — Reads base-frame x y z lines (#/blank skipped); false + error (path:line:) on an unreadable file or malformed line, out then empty. A configured file that does not load is fatal at bridge start.