From c9f7ee2ec1fb3bd16fa1107d47f10715aa14e2e4 Mon Sep 17 00:00:00 2001 From: Jeff Hykin Date: Wed, 28 Jan 2026 11:26:37 -0800 Subject: [PATCH 1/2] make camera demo actually show up in rerun --- dimos/hardware/sensors/camera/module.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/dimos/hardware/sensors/camera/module.py b/dimos/hardware/sensors/camera/module.py index 6f51febfef..babab3ec7c 100644 --- a/dimos/hardware/sensors/camera/module.py +++ b/dimos/hardware/sensors/camera/module.py @@ -19,10 +19,12 @@ import reactivex as rx from reactivex import operators as ops +import rerun as rr from dimos.agents import Output, Reducer, Stream, skill from dimos.core import Module, ModuleConfig, Out, rpc from dimos.core.blueprints import autoconnect +from dimos.dashboard.rerun_init import connect_rerun from dimos.hardware.sensors.camera.spec import CameraHardware from dimos.hardware.sensors.camera.webcam import Webcam from dimos.msgs.geometry_msgs import Quaternion, Transform, Vector3 @@ -58,8 +60,9 @@ class CameraModule(Module[CameraModuleConfig], perception.Camera): config: CameraModuleConfig default_config = CameraModuleConfig - def __init__(self, *args: Any, **kwargs: Any) -> None: + def __init__(self, *args: Any, global_config, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.global_config = global_config @rpc def start(self) -> None: @@ -73,8 +76,17 @@ def start(self) -> None: if self.config.frequency > 0: stream = stream.pipe(sharpness_barrier(self.config.frequency)) + # Connect this worker process to Rerun if it will log sensor data. + if self.global_config.viewer_backend.startswith("rerun"): + connect_rerun(global_config=self.global_config) + + def callback(image: Image): + self.color_image.publish(image) + if self.global_config.viewer_backend.startswith("rerun"): + rr.log("world/robot/camera/rgb", image.to_rerun()) + self._disposables.add( - stream.subscribe(self.color_image.publish), + stream.subscribe(callback), ) self._disposables.add( From 6767d6138e67512827f08471cad93ec2d7bd1113 Mon Sep 17 00:00:00 2001 From: Jeff Hykin Date: Wed, 28 Jan 2026 15:03:44 -0800 Subject: [PATCH 2/2] ruff --- dimos/hardware/sensors/camera/module.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dimos/hardware/sensors/camera/module.py b/dimos/hardware/sensors/camera/module.py index babab3ec7c..a6858f339c 100644 --- a/dimos/hardware/sensors/camera/module.py +++ b/dimos/hardware/sensors/camera/module.py @@ -24,6 +24,7 @@ from dimos.agents import Output, Reducer, Stream, skill from dimos.core import Module, ModuleConfig, Out, rpc from dimos.core.blueprints import autoconnect +from dimos.core.global_config import GlobalConfig from dimos.dashboard.rerun_init import connect_rerun from dimos.hardware.sensors.camera.spec import CameraHardware from dimos.hardware.sensors.camera.webcam import Webcam @@ -60,7 +61,7 @@ class CameraModule(Module[CameraModuleConfig], perception.Camera): config: CameraModuleConfig default_config = CameraModuleConfig - def __init__(self, *args: Any, global_config, **kwargs: Any) -> None: + def __init__(self, *args: Any, global_config: GlobalConfig, **kwargs: Any) -> None: super().__init__(*args, **kwargs) self.global_config = global_config @@ -80,7 +81,7 @@ def start(self) -> None: if self.global_config.viewer_backend.startswith("rerun"): connect_rerun(global_config=self.global_config) - def callback(image: Image): + def callback(image: Image) -> None: self.color_image.publish(image) if self.global_config.viewer_backend.startswith("rerun"): rr.log("world/robot/camera/rgb", image.to_rerun())