fix(controller): preserve UUID continuity across occlusion on main#1449
fix(controller): preserve UUID continuity across occlusion on main#1449Copilot wants to merge 3 commits into
Conversation
) (#1155) When a static object becomes temporarily occluded and later reappears in the scene, the controller assigns a new UUID instead of preserving the original one. This breaks object identity continuity for static objects across short occlusions. This change updates the controller logic to ensure that static objects retain their original UUID when reactivated from suspended tracks. Fixes #1152 (cherry picked from commit f4d8d7f) Co-authored-by: saratpoluri <1325325+saratpoluri@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Ports the controller-side UUID continuity fix to main so tracked objects keep stable identities across short occlusions by retaining UUID mappings while tracks are suspended or temporarily unreliable.
Changes:
- Exposes suspended and unreliable tracker states through the Python
MultipleObjectTrackerpybind interface. - Updates controller tracking flow to prune UUID mappings using the union of reliable, unreliable, and suspended tracks (instead of only reliable tracks).
- Adjusts UUID assignment to reuse an existing GID for a reappearing
rv_idwhen available.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| controller/src/robot_vision/python/src/robot_vision/extensions/tracking.cpp | Adds Python bindings for MultipleObjectTracker.get_suspended_tracks() and get_unreliable_tracks(). |
| controller/src/robot_vision/include/rv/tracking/MultipleObjectTracker.hpp | Exposes suspended/unreliable track retrieval on the C++ tracker wrapper. |
| controller/src/controller/uuid_manager.py | Uses a set comprehension for active track IDs during pruning (more efficient membership checks). |
| controller/src/controller/ilabs_tracking.py | Preserves UUID continuity by pruning with all active track states and reusing existing GID mappings for returning rv_ids. |
| # Check if UUID manager already has a mapping for this rv_id | ||
| with self.uuid_manager.active_ids_lock: | ||
| existing_gid_data = self.uuid_manager.active_ids.get(sscape_object.rv_id) | ||
| existing_gid = existing_gid_data[0] if existing_gid_data else None | ||
| if existing_gid is None: |
| reliable_tracks = self.tracker.get_reliable_tracks() | ||
| # Include ALL active C++ tracks to preserve UUID mappings | ||
| all_active_tracks = set(chain( | ||
| reliable_tracks, | ||
| self.tracker.get_unreliable_tracks(), | ||
| self.tracker.get_suspended_tracks())) |
Agent-Logs-Url: https://github.com/open-edge-platform/scenescape/sessions/a99d5e2d-3cf2-41d2-b3cc-2f6b4acf71e8 Co-authored-by: saratpoluri <1325325+saratpoluri@users.noreply.github.com>
f3d9937 to
db0cfff
Compare
Add TestPruneInactiveTracks to test_uuid_manager.py (7 cases covering reliable/unreliable/suspended track pruning behavior) and a new test_uuid_continuity.py (4 cases covering GID reuse in from_tracked_object when a track reappears after occlusion). Agent-Logs-Url: https://github.com/open-edge-platform/scenescape/sessions/18491a6d-dd2c-41e5-be18-b1515b2f6ba0 Co-authored-by: saratpoluri <1325325+saratpoluri@users.noreply.github.com>
Added 11 unit tests in commit 282b9e7 covering the two code paths introduced by this PR:
Both test classes run under make controller && make -C controller test-build && make -C tests uuid-manager-unit SUPASS=<password> |
📝 Description
This ports the UUID continuity fix from the release branch onto
mainand folds in the follow-up Re-ID behavior review from the later PR sequence. The net effect is that static objects keep their identity through short occlusions without regressing the newer UUID assignment flow already present onmain.Scope
mainmain's currentassignIDflow, avoiding a stale fallback path from being reintroducedController tracking
Tracker bindings
Net behavior
TestPruneInactiveTracks(7 cases intests/sscape_tests/uuid_manager/test_uuid_manager.py): verifies thatpruneInactiveTrackspreserves UUID mappings for reliable, unreliable, and suspended tracks and only removes truly inactive entries; includes a regression guard documenting the pre-fix breakageTestGIDReuseAcrossOcclusion(4 cases intests/sscape_tests/uuid_manager/test_uuid_continuity.py): verifies thatfrom_tracked_objectreuses the existing GID fromactive_idswhen anrv_idreappears, falls back to the UUID for new or pending-query tracks, and takes thesetPreviouspath when a prior-frame object is available✨ Type of Change
Select the type of change your PR introduces:
🧪 Testing Scenarios
Describe how the changes were tested and how reviewers can test them too:
Run the uuid-manager unit tests inside the controller test container:
✅ Checklist
Before submitting the PR, ensure the following: