Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dimos/core/global_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class GlobalConfig(BaseSettings):
replay: bool = False
rerun_enabled: bool = True
rerun_server_addr: str | None = None
viewer_backend: ViewerBackend = "rerun-native"
viewer_backend: ViewerBackend = "rerun-web"
n_dask_workers: int = 2
memory_limit: str = "auto"
mujoco_camera_position: str | None = None
Expand Down
23 changes: 18 additions & 5 deletions dimos/web/websocket_vis/websocket_vis_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import threading
import time
from typing import Any
import webbrowser

from dimos_lcm.std_msgs import Bool # type: ignore[import-untyped]
from reactivex.disposable import Disposable
Expand Down Expand Up @@ -57,6 +58,9 @@

logger = setup_logger()

_browser_open_lock = threading.Lock()
_browser_opened = False


class WebsocketVisModule(Module):
"""
Expand Down Expand Up @@ -149,11 +153,20 @@ def start(self) -> None:
self._uvicorn_server_thread = threading.Thread(target=self._run_uvicorn_server, daemon=True)
self._uvicorn_server_thread.start()

# Show control center link in terminal
if self._global_config.viewer_backend == "rerun-web":
logger.info(f"Command Center: http://localhost:{self.port}")
else:
logger.info(f"Command Center: http://localhost:{self.port}/command-center")
# Auto-open the appropriate landing page:
# - rerun-web: "/" serves dashboard with Rerun iframe + command center iframe
# - rerun-native: "/" redirects to "/command-center"
url = f"http://localhost:{self.port}/"
logger.info(f"Dimensional Command Center: {url}")

global _browser_opened
with _browser_open_lock:
if not _browser_opened:
try:
webbrowser.open_new_tab(url)
_browser_opened = True
except Exception as e:
logger.debug(f"Failed to open browser: {e}")

try:
unsub = self.odom.subscribe(self._on_robot_pose)
Expand Down
Loading