feat: WebSocket client mode for remote DimOS connection#20
Open
jeff-hykin wants to merge 12 commits intomainfrom
Open
feat: WebSocket client mode for remote DimOS connection#20jeff-hykin wants to merge 12 commits intomainfrom
jeff-hykin wants to merge 12 commits intomainfrom
Conversation
…PC proxy When --connect is provided (with optional URL), the viewer connects to an existing gRPC proxy server instead of spawning its own. This mirrors the stock rerun binary's --connect behavior. Defaults to rerun+http://127.0.0.1:<port>/proxy.
- Remove unused `parking_lot` dependency (cargo-shear) - Add `[lints] workspace = true` to dimos/Cargo.toml (rerun lint) - Fix TOML formatting in dimos/pyproject.toml (taplo) - Rename error variables from `e` to `err` (rerun lint convention) - Fix trailing whitespace in keyboard.rs - Add blank lines before doc comments on struct fields/constants - Use Display instead of Debug for error formatting in viewer.rs - Commit updated Cargo.lock Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…econnect - WsPublisher now connects as a client to RerunWebSocketServer (Python) instead of running its own axum server - Replaced axum + broadcast with tokio-tungstenite + mpsc - Drain queued commands on reconnect to avoid sending stale velocities - Changed --ws-port to --ws-url for full URL control - Moved WS_EVENTS.md to repo root with other docs
1 task
The Python server (websockets library) sends keepalive pings every 30s and expects a pong within 30s. The old code only wrote to the stream and never read, so tungstenite never got a chance to auto-reply with pong frames. This caused the server to close the connection every ~2 minutes. Split the stream into read/write halves and spawn a reader task that consumes incoming frames (triggering tungstenite's automatic pong replies). The write loop uses tokio::select! to also detect when the reader exits (server closed), triggering immediate reconnection instead of waiting for the next send to fail.
- Delete interaction/lcm.rs (LCM publisher no longer needed) - Simplify KeyboardHandler to take WsPublisher directly - Remove dual LCM/WS code paths in viewer.rs - Always connect via WebSocket (default ws://127.0.0.1:3030/ws)
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
dimos-viewer in
--connectmode can't send click or teleop events back to DimOS when LCM multicast is unavailable across machines.Solution
Switched the WebSocket module from server (axum) to client (tokio-tungstenite) that connects to the Python
RerunWebSocketServer. Replaced--ws-portwith--ws-urlfor explicit URL control. Added automatic reconnection with buffer drain on reconnect to prevent stale velocity commands from being sent. MovedWS_EVENTS.mdprotocol doc to repo root.Breaking Changes
--ws-portCLI flag replaced by--ws-url. If previously using--ws-port 3030, now use--ws-url ws://127.0.0.1:3030/ws.How to Test
Requires the
jeff/fix/rconnectbranch ofdimosfor the server side.Click in the 3D viewport and use WASD keys — should see
[CLICK]and[TWIST]in terminal 1.Contributor License Agreement