Skip to content

Move DimSim browser and Deno message payloads to canonical CDR - #4720

Closed
TomCC7 wants to merge 2 commits into
cc/feat/cdr-lerobot-boundariesfrom
cc/feat/cdr-dimsim-streams
Closed

TomCC7 wants to merge 2 commits into
cc/feat/cdr-lerobot-boundariesfrom
cc/feat/cdr-dimsim-streams

Conversation

@TomCC7

@TomCC7 TomCC7 commented Oct 20, 2026

Copy link
Copy Markdown
Member

DimSim's browser and Deno physics/lidar producers now publish canonical CDR Image, PoseStamped and PointCloud2 values and consume canonical Twist commands. Raw LCM/LC02 WebSocket framing, relay fragmentation, coordinate transforms, physics integration and command deadman remain. The Python connection uses matching generated odom/TF transports and closes its owned TF endpoint on shutdown.

The browser publishes original RGBA canvas pixels in an rgba8 Image; the existing eval/sidebar JPEG stays separate. Depth keeps the existing uint16 millimeter/clamping behavior. The CLI invalidates a cached frontend when CDR sources, schemas or manifests change, so a previously-built legacy browser cannot silently remain paired with a new server.

Project: https://linear.app/dimensional/project/message-encoding-refactor-05a3ddb4af3e/overview

Parent: #4719 (91847472a2bfb0641a01d487436986906c39e693). This proposal's remaining platform graphs, historical fixtures, final cleanup and logical PR organization are still open.

flowchart LR
  PythonTwist[Python generated Twist] --> RawLCM[Raw LCM / CDR payload]
  RawLCM --> Physics[Deno / Rapier physics]
  Physics --> Pose[CDR PoseStamped]
  Pose --> TF[Python canonical TF]
  Canvas[Browser canvas RGBA / depth] --> WS[CDR Image in LC02 WebSocket frame]
  WS --> Relay[Existing raw LCM relay]
  Lidar[Rapier lidar] --> Cloud[CDR PointCloud2]
  Cloud --> Relay
  Relay --> PythonSensors[Python generated sensor values]
Loading

File change summary

Category Files Added Deleted Review focus
Runtime/producer/cache adapters 8 182 130 Matching CDR channels; raw pixel rows; same physics/lidar math; odom-to-TF ownership; old-dist invalidation
Behavior tests 2 403 0 Independent Python/Deno codecs; actual browser methods; actual bounded CPU Rapier/deadman/lidar; real memq TF and cleanup
Generated schema artifact 1 6 0 Four complete schemas exported from canonical installed messages; exact registry-equality test; no independent .msg source definitions
Existing docs / CI 2 44 0 Embedded offline command and installed-package acceptance
Package manifests 2 5 2 Fixed Foxglove rosmsg5.0.5 / rosmsg2-serialization3.1.2; old message-codec import removed
Dependency locks 2 binary binary Existing LFS-tracked Deno/NPM locks updated

Verification

  • 27 source tests and the same 27 against an independently installed main wheel, using isolated Python and site-packages assertions. These include three real Deno test cases run with cached dependencies and no network permission.
  • Python big/little-endian generated payloads round-trip through Foxglove with exact canonical bytes. Invalid encapsulation/trailing bytes fail without a legacy fallback.
  • Actual browser publishing methods preserve RGBA pixels, shared clock, depth units/clamping and WS frames larger than UDP's limit.
  • Actual CPU Rapier runs two bounded physics frames and one lidar scan: positive command movement, deadman-to-zero, ROS coordinates, real floor intersections and cloud layout are independently decoded/asserted in Python. The external UDP boundary is fake; no benchmark/throughput measurement ran.
  • Actual memq generated odom -> connection -> TF, exact source nanoseconds, mount values, independent headers and endpoint cleanup. Existing Go2/DimSim process regressions pass.
  • Scoped Python strict typing and five Deno files pass. Both NPM Vite and the actual Deno CLI build path pass; an old cached dist rebuilds, then the matching artifact is reused. Configured scoped hooks pass except unavailable Nix lint.
  • Wheel SHA-256: dc5657681dd2dbfb6f94e36452bea42ee7d220d3eaebb6c44bae00f5b7a9b91f.

Manual offline test

With development dependencies and Deno available:

cd misc/DimSim
deno install --no-lock
deno run --allow-all --unstable-net cli/cli.ts build
cd ../..
DIMOS_DIMSIM_DENO="$(command -v deno)" DIMOS_TRANSPORT=lcm LCM_DEFAULT_URL=memq:// \
  uv run pytest -o addopts='' --import-mode=importlib -q \
  dimos/robot/unitree/test_dimsim_connection.py \
  dimos/simulation/dimsim/test_dimsim_process.py \
  dimos/robot/unitree/go2/test_connection.py

The first preparation may download declared dependencies; no checkpoint, hardware, rendered scene, host-network change, real multicast acceptance or human visual acceptance is claimed. DimSim continues to require its source/assets checkout; this does not claim the full simulator is bundled in a main wheel. No CI result is claimed or polled. Rich numerical driver helper types remain behind boundaries; legacy dependency retirement is separate.

@TomCC7 TomCC7 closed this Oct 20, 2026
@TomCC7
TomCC7 deleted the cc/feat/cdr-dimsim-streams branch October 20, 2026 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant