-
Notifications
You must be signed in to change notification settings - Fork 159
Feat/rerun latency panels #925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
91811a6
fix: Make path visualization thicker and elevated above floor
Nabla7 6f69518
feat:some rerun visualization improvements
Nabla7 76df3b6
fix: Use Foxglove-style colors for costmap (blue-purple free, black o…
Nabla7 00c5cd5
fix: Remove autolog_to_rerun from A* planner, use manual logging
Nabla7 71bf75a
fix: Subscribe to internal planner path, not module Out stream
Nabla7 4e22048
style: Apply pre-commit formatting and linting fixes
Nabla7 1df04af
fix: correct stream.py
Nabla7 2897a1c
refactor: Remove all Rerun code from stream.py
Nabla7 2b9a999
style: Apply linter formatting
Nabla7 717768b
fix: Address mypy errors from Rerun changes
Nabla7 d8f6187
fix: Correct camera image format from BGR to RGB
Nabla7 8d82163
fix: Camera RGB color swap and additional cleanup
Nabla7 18c75bd
CI code cleanup
Nabla7 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| # Copyright 2025-2026 Dimensional Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| """TF Rerun Module - Automatically visualize all transforms in Rerun. | ||
|
|
||
| This module subscribes to the /tf LCM topic and logs ALL transforms | ||
| to Rerun, providing automatic visualization of the robot's TF tree. | ||
|
|
||
| Usage: | ||
| # In blueprints: | ||
| from dimos.dashboard.tf_rerun_module import tf_rerun | ||
|
|
||
| def my_robot(): | ||
| return ( | ||
| robot_connection() | ||
| + tf_rerun() # Add TF visualization | ||
| + other_modules() | ||
| ) | ||
| """ | ||
|
|
||
| from typing import Any | ||
|
|
||
| import rerun as rr | ||
|
|
||
| from dimos.core import Module, rpc | ||
| from dimos.core.global_config import GlobalConfig | ||
| from dimos.dashboard.rerun_init import connect_rerun | ||
| from dimos.msgs.tf2_msgs import TFMessage | ||
| from dimos.protocol.pubsub.lcmpubsub import LCM, Topic | ||
| from dimos.utils.logging_config import setup_logger | ||
|
|
||
| logger = setup_logger() | ||
|
|
||
|
|
||
| class TFRerunModule(Module): | ||
| """Subscribes to /tf LCM topic and logs all transforms to Rerun. | ||
|
|
||
| This module automatically visualizes the TF tree in Rerun by: | ||
| - Subscribing to the /tf LCM topic (captures ALL transforms in the system) | ||
| - Logging each transform to its derived entity path (world/{child_frame_id}) | ||
| """ | ||
|
|
||
| _global_config: GlobalConfig | ||
| _lcm: LCM | None = None | ||
| _unsubscribe: Any = None | ||
|
|
||
| def __init__( | ||
| self, | ||
| global_config: GlobalConfig | None = None, | ||
| **kwargs: Any, | ||
| ) -> None: | ||
| """Initialize TFRerunModule. | ||
|
|
||
| Args: | ||
| global_config: Optional global configuration for viewer backend settings | ||
| **kwargs: Additional arguments passed to parent Module | ||
| """ | ||
| super().__init__(**kwargs) | ||
| self._global_config = global_config or GlobalConfig() | ||
|
|
||
| @rpc | ||
| def start(self) -> None: | ||
| """Start the TF visualization module.""" | ||
| super().start() | ||
|
|
||
| # Only connect if Rerun backend is selected | ||
| if self._global_config.viewer_backend.startswith("rerun"): | ||
| connect_rerun(global_config=self._global_config) | ||
|
|
||
| # Subscribe directly to LCM /tf topic (captures ALL transforms) | ||
| self._lcm = LCM() | ||
| self._lcm.start() | ||
| topic = Topic("/tf", TFMessage) | ||
| self._unsubscribe = self._lcm.subscribe(topic, self._on_tf_message) | ||
| logger.info("TFRerunModule: subscribed to /tf, logging all transforms to Rerun") | ||
|
|
||
| def _on_tf_message(self, msg: TFMessage, topic: Topic) -> None: | ||
| """Log all transforms in TFMessage to Rerun. | ||
|
|
||
| Args: | ||
| msg: TFMessage containing transforms to visualize | ||
| topic: The LCM topic (unused but required by callback signature) | ||
| """ | ||
| for entity_path, transform in msg.to_rerun(): # type: ignore[no-untyped-call] | ||
| rr.log(entity_path, transform) | ||
|
|
||
| @rpc | ||
| def stop(self) -> None: | ||
| """Stop the TF visualization module and cleanup LCM subscription.""" | ||
| if self._unsubscribe: | ||
| self._unsubscribe() | ||
| self._unsubscribe = None | ||
|
|
||
| if self._lcm: | ||
| self._lcm.stop() | ||
| self._lcm = None | ||
|
|
||
| super().stop() | ||
|
|
||
|
|
||
| tf_rerun = TFRerunModule.blueprint | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.