-
Notifications
You must be signed in to change notification settings - Fork 394
feat(viz): add RerunWebSocketServer for dimos-viewer remote mode #1643
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
Open
jeff-hykin
wants to merge
66
commits into
dev
Choose a base branch
from
jeff/fix/rconnect
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
66 commits
Select commit
Hold shift + click to select a range
957c26e
switch to websocket
jeff-hykin f5a35bb
cleanup
jeff-hykin e67ae72
improvements
jeff-hykin b7bfb40
fix: ruff formatting + consistent error handling in websocket_server
jeff-hykin 7cbe1b7
make it easy to use
jeff-hykin fa94c2e
cleanup
jeff-hykin 42f2f38
consolidate viewer usage
jeff-hykin 23d1d88
consolidate WebsocketVisModule
jeff-hykin dd5ff29
Merge branch 'dev' of github.com:dimensionalOS/dimos into jeff/fix/rc…
jeff-hykin 27e66be
fix: address PR review - server ready race, path filter, skip guard
jeff-hykin fe84b4d
fix: set explicit ping interval/timeout on WebSocket server
jeff-hykin bbffeee
switch to websocket
jeff-hykin f99b2d4
cleanup
jeff-hykin 26273d7
improvements
jeff-hykin 62fb365
fix: ruff formatting + consistent error handling in websocket_server
jeff-hykin 238b3de
make it easy to use
jeff-hykin 5c14fe2
cleanup
jeff-hykin ab4daea
consolidate viewer usage
jeff-hykin dc5f2f8
consolidate WebsocketVisModule
jeff-hykin ba14725
fix: address PR review - server ready race, path filter, skip guard
jeff-hykin f670f12
fix: set explicit ping interval/timeout on WebSocket server
jeff-hykin 7545a5a
fix(rerun-ws): log exception and unblock stop() on server startup fai…
jeff-hykin 204d8b7
docs: add changes.md with fix descriptions and revert instructions
jeff-hykin 2c39685
feat: vis_module helper + rerun bridge improvements
jeff-hykin 7f063c6
Merge branch 'jeff/fix/rconnect' of github.com:dimensionalOS/dimos in…
jeff-hykin 596d244
Merge remote-tracking branch 'origin/dev' into jeff/fix/rconnect
jeff-hykin 3ecae4b
cleanup
jeff-hykin 77e25eb
refine
jeff-hykin 0a231d0
Merge branch 'dev' of github.com:dimensionalOS/dimos into jeff/fix/rc…
jeff-hykin 3835a39
cleanup
jeff-hykin 1c77b59
cleanup
jeff-hykin b1dcf0f
misc
jeff-hykin de37b65
Merge jeff/fix/vis_module: bridge improvements + vis_module consolida…
jeff-hykin 26fa2fb
restoregraph
jeff-hykin 2a81168
change name to be more generic
jeff-hykin 85040f6
Merge branch 'dev' into jeff/fix/rconnect
jeff-hykin fb926c0
del
jeff-hykin d9007f0
Merge branch 'jeff/fix/rconnect' of github.com:dimensionalOS/dimos in…
jeff-hykin 8e227ec
fix old Agent.blueprint()'s
jeff-hykin e01cf85
Merge remote-tracking branch 'origin/dev' into jeff/fix/rconnect
jeff-hykin e382113
fix(ci): regenerate all_blueprints.py, fix test_websocket_server stop…
jeff-hykin 8e1d71a
Revered topics to cmd_vel to fix unitree go2 blueprints and fallback …
spomichter 9f9d43d
Merge branch 'jeff/fix/rconnect' of https://github.com/dimensionalOS/…
spomichter 032756e
new rerun cli options
jeff-hykin 385313d
merge
jeff-hykin bf2e94c
CI code cleanup
jeff-hykin 56a527f
add connect printout for headless
jeff-hykin af325dc
CI code cleanup
jeff-hykin 8f9e8d8
Merge branch 'dev' of github.com:dimensionalOS/dimos into jeff/fix/rc…
jeff-hykin 231d47b
restore name to tele_cmd_vel
jeff-hykin badc59d
clean _resolve_viewer_mode
jeff-hykin 53c50a5
wire in proper cmd_vel mux and cancel for go2
jeff-hykin f9ef7bc
hide startup noise
jeff-hykin a775501
get rid of warning
jeff-hykin 806acc9
fix sim on macos
jeff-hykin 71ce2a9
fix warning
jeff-hykin 0eed0b7
comment
jeff-hykin a90ac02
CI code cleanup
jeff-hykin 9d2abd8
add test
jeff-hykin 3513289
Merge branch 'jeff/fix/rconnect' of github.com:dimensionalOS/dimos in…
jeff-hykin 50dcfeb
change how stop_movement works with cmd_vel
jeff-hykin cdd11ad
fix(mypy): resolve 7 type errors across 4 files
jeff-hykin 0ee0c89
fix(ci): regenerate all_blueprints.py (add cmd-vel-mux)
jeff-hykin 24ca9d8
cleanup
jeff-hykin cb9a307
Merge dev: resolve conflicts in rerun bridge and g1 blueprint
jeff-hykin 1286606
fix: update blueprints import path in vis_module
jeff-hykin 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,9 +14,9 @@ | |
|
|
||
| from dimos.core.coordination.blueprints import autoconnect | ||
| from dimos.hardware.sensors.lidar.livox.module import Mid360 | ||
| from dimos.visualization.rerun.bridge import RerunBridgeModule | ||
| from dimos.visualization.vis_module import vis_module | ||
|
|
||
| mid360 = autoconnect( | ||
| Mid360.blueprint(), | ||
| RerunBridgeModule.blueprint(), | ||
| vis_module("rerun"), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we hard coding 'rerun' here? |
||
| ).global_config(n_workers=2, robot_model="mid360") | ||
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,122 @@ | ||
| # Copyright 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. | ||
|
|
||
| """CmdVelMux: merges nav and teleop velocity commands. | ||
|
|
||
| Teleop (tele_cmd_vel) takes priority over autonomous navigation | ||
| (nav_cmd_vel). When teleop is active, nav commands are suppressed | ||
| and a stop_movement signal is published. After a cooldown period | ||
| with no teleop input, nav commands resume. | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import threading | ||
| from typing import Any | ||
|
|
||
| from dimos_lcm.std_msgs import Bool | ||
|
|
||
| from dimos.core.core import rpc | ||
| from dimos.core.module import Module, ModuleConfig | ||
| from dimos.core.stream import In, Out | ||
| from dimos.msgs.geometry_msgs.Twist import Twist | ||
| from dimos.utils.logging_config import setup_logger | ||
|
|
||
| logger = setup_logger() | ||
|
|
||
|
|
||
| class CmdVelMuxConfig(ModuleConfig): | ||
| teleop_cooldown_sec: float = 1.0 | ||
|
|
||
|
|
||
| class CmdVelMux(Module[CmdVelMuxConfig]): | ||
| """Multiplexes nav_cmd_vel and tele_cmd_vel into a single cmd_vel output. | ||
|
|
||
| When teleop input arrives, stop_movement is published so downstream | ||
| modules (planner, explorer) can cancel their active goals. | ||
|
|
||
| Ports: | ||
| nav_cmd_vel (In[Twist]): Velocity from the autonomous planner. | ||
| tele_cmd_vel (In[Twist]): Velocity from keyboard/joystick teleop. | ||
| cmd_vel (Out[Twist]): Merged output — teleop wins when active. | ||
| stop_movement (Out[Bool]): Published when teleop begins. | ||
| """ | ||
|
|
||
| default_config = CmdVelMuxConfig | ||
|
|
||
| nav_cmd_vel: In[Twist] | ||
| tele_cmd_vel: In[Twist] | ||
| cmd_vel: Out[Twist] | ||
| stop_movement: Out[Bool] | ||
|
|
||
| def __init__(self, **kwargs: Any) -> None: | ||
| super().__init__(**kwargs) | ||
| self._teleop_active = False | ||
| self._lock = threading.Lock() | ||
| self._timer: threading.Timer | None = None | ||
|
|
||
| def __getstate__(self) -> dict[str, Any]: | ||
| state: dict[str, Any] = super().__getstate__() # type: ignore[no-untyped-call] | ||
| state.pop("_lock", None) | ||
| state.pop("_timer", None) | ||
| return state | ||
|
|
||
| def __setstate__(self, state: dict[str, Any]) -> None: | ||
| super().__setstate__(state) | ||
| self._lock = threading.Lock() | ||
| self._timer = None | ||
|
|
||
| @rpc | ||
| def start(self) -> None: | ||
| self.nav_cmd_vel.subscribe(self._on_nav) | ||
| self.tele_cmd_vel.subscribe(self._on_teleop) | ||
|
|
||
| @rpc | ||
| def stop(self) -> None: | ||
| with self._lock: | ||
| if self._timer is not None: | ||
| self._timer.cancel() | ||
| self._timer = None | ||
| super().stop() | ||
|
|
||
| def _on_nav(self, msg: Twist) -> None: | ||
| with self._lock: | ||
| if self._teleop_active: | ||
| return | ||
| self.cmd_vel.publish(msg) | ||
|
|
||
| def _on_teleop(self, msg: Twist) -> None: | ||
| was_active: bool | ||
| with self._lock: | ||
| was_active = self._teleop_active | ||
| self._teleop_active = True | ||
| if self._timer is not None: | ||
| self._timer.cancel() | ||
| self._timer = threading.Timer( | ||
| self.config.teleop_cooldown_sec, | ||
| self._end_teleop, | ||
| ) | ||
| self._timer.daemon = True | ||
| self._timer.start() | ||
|
|
||
| if not was_active: | ||
| self.stop_movement.publish(Bool(data=True)) | ||
| logger.info("Teleop active — published stop_movement") | ||
|
|
||
| self.cmd_vel.publish(msg) | ||
|
|
||
| def _end_teleop(self) -> None: | ||
| with self._lock: | ||
| self._teleop_active = False | ||
| self._timer = None |
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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here