Skip to content

Commit fb767a9

Browse files
Piotr Brzyskimeta-codesync[bot]
authored andcommitted
{BugFix} Allow Aria Data Plotter to connect to existing rerun instance
Summary: This diff implements the fix for streaming in Electron frozen Linux build. **Problem:** In the frozen Electron build, streaming data does not flow because the Rerun viewer is not started via the frozen-safe pattern. The streaming worker process calls `rr.spawn()` which cannot launch the bundled binary correctly in frozen mode. **Solution:** Modify both Aria Studio and the ClientSDK to use the frozen-safe pattern for streaming: 1. **Aria Studio (`device_manager_new.py`)**: - Added `await rerun_manager.start_frozen_rerun()` before `start_viewer()` in `start_streaming()`, - Added `await rerun_manager.start_frozen_rerun()` before `start_viewer()` in `reopen_streaming_viewer()`, - This matches the VRS playback pattern and ensures the viewer is available for gRPC connection. 2. **Aria Studio (`streaming_rerun_task.py`)**: - Added frozen mode detection (`is_frozen = getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS')`), - Pass `connect_to_existing_viewer=is_frozen` to `AriaStreamManager`. 3. **ClientSDK (`aria_streaming_viewer.py`)**: - Added `connect_to_existing_viewer: bool = False` parameter to `AriaStreamManager.__init__()`, - Added `connect_to_existing_viewer: bool = False` parameter to `AriaStreamingViewer.__init__()`, - Pass the flag through to `AriaDataViewerConfig`. 4. **Project Aria Tools (`aria_data_plotter.py`)**: - Added `connect_to_existing: bool = False` field to `AriaDataViewerConfig`, - Modified `AriaDataViewer.__init__()` to call `rr.connect_grpc()` instead of `rr.spawn()` when `config.connect_to_existing` is `True`, - The change is backward compatible (default `False` preserves existing behavior) DevMate plan: {F1991375964} Reviewed By: SeaOtocinclus Differential Revision: D108909540 fbshipit-source-id: ccf3a653f0044f5e4855f90cdfc1abc4fc5dcba8
1 parent c3bd395 commit fb767a9

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

projectaria_tools/tools/aria_rerun_viewer/aria_data_plotter.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,11 @@ class AriaDataViewerConfig:
166166
# Whether to show latency plot in the blueprint (only relevant for streaming)
167167
show_latency: bool = False
168168

169+
# Whether to connect to an existing Rerun viewer via gRPC instead of spawning
170+
# a new viewer process. Used for frozen Electron builds where the viewer is
171+
# already started by the parent process via start_frozen_rerun().
172+
connect_to_existing_viewer: bool = False
173+
169174

170175
class AriaDataViewer:
171176
"""
@@ -258,6 +263,12 @@ def __init__(
258263
if rrd_output_path:
259264
rr.init("AriaDataViewer", spawn=False)
260265
rr.save(rrd_output_path)
266+
elif self.config.connect_to_existing_viewer:
267+
rr.init("AriaDataViewer")
268+
rr.connect_grpc()
269+
# If a blueprint path is configured, load it after connecting
270+
if self.config.blueprint_path:
271+
rr.log_file_from_path(self.config.blueprint_path)
261272
elif self.config.blueprint_path:
262273
self._spawn_rerun_with_blueprint(
263274
self.config.blueprint_path, self.config.rerun_memory_limit

0 commit comments

Comments
 (0)