Skip to content

feat(web): decode generated CDR through manifest schemas - #4651

Closed
TomCC7 wants to merge 2 commits into
cc/feat/cdr-optin-transportsfrom
cc/feat/cdr-browser-viewer
Closed

TomCC7 wants to merge 2 commits into
cc/feat/cdr-optin-transportsfrom
cc/feat/cdr-browser-viewer

Conversation

@TomCC7

@TomCC7 TomCC7 commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Generated messages can cross the existing relay bridge as plain CDR with complete ROS2 schemas in the channel manifest. The browser SDK compiles those schemas with pinned Foxglove packages and shows decoded values without ROS or a separate browser message package. This is explicit opt-in; existing LCM/JSON channels and transport defaults remain unchanged.

Project: Message Encoding Refactor. Based on #4649; the recording drafts #4645/#4650 are siblings, not prerequisites.

flowchart LR
  A[Installed generated Python value] --> B[Existing relay: encode only while subscribed]
  S[Owner: full ros2msg schema closure] --> M[Channel manifest]
  B --> C[CDR frame bytes]
  M --> D[Pinned Foxglove parser and CDR reader]
  C --> D
  D --> E[SDK value and bounded preview]
Loading

Use it

from dimos.messages.geometry_msgs.msg import PoseStamped
from dimos.web.cockpit import Channel, cockpit

viewer = cockpit(channels=[Channel(
    "measured_pose", PoseStamped,
    encoding="geometry_msgs/msg/PoseStamped.cdr.v1",
)])

Compose this with the producer of measured_pose: Out[PoseStamped] and explicitly bind its CDR transport. Complete PoseStamped/Header/Time definitions come from the installed owner. Existing registered web encoders retain precedence.

Manual browser test

From this checkout with Deno installed:

cd web/sdk
deno task fixture --host 127.0.0.1

Open http://127.0.0.1:5174/demo_cdr.html. Select PoseStamped and both byte orders: fields and full embedded schemas are visible. Select image to see the actual two RGB pixels. This is a fixture viewer over actual Python-generated CDR packets, not a live robot/relay demonstration or a Rerun viewer. Walkthrough.

File changes by responsibility

Category Files Purpose
Python bridge/codecs 3 Registry-owned CDR values, schema export, explicit channel compilation; old defaults retained.
Browser decoding/subscription 4 Generic CDR reader/registry and public exports; sequence messages require a visible panel subscription.
Test fixtures and fixture generator 2 Reproducible packets/schema closure from installed owner codecs, LE/BE; no new handwritten wire generator or checked-in upstream .msg sources.
Tests/harness 5 Decoder, cockpit, relay lifecycle and type/schema checks; stop incidental RPC sockets in the existing relay fake harness.
Manual fixture page 2 Actual SDK field/schema/image display.
Dependency metadata 2 Foxglove rosmsg 5.0.5 and rosmsg2-serialization 3.1.2 with lock integrity; no unrelated upgrades.
Docs/CI 2 Embedded short examples and existing workflow coverage.

Validation and limits

At d97c1949cab182cc6f0efc994f5db5019b27dd87: 259 Python checks, 408 SDK tests, 191 cockpit tests; strict typing on four Python sources and both frontend type checks/builds passed. All applicable configured hooks passed. Actual sandboxed Chromium decoded big-endian PoseStamped/schema and verified canvas RGB bytes [0,1,2,255,253,254,255,255]; actual screenshots were saved locally. This is automated acceptance, not human review.

Malformed/truncated/trailing CDR fails decoding; conflicting manifest type identities are unsupported. A generic decoder does not implement typed map/camera/control panels. Rerun generated-type integration, image/cloud domain conversion and default blueprint cutover remain later implementation scopes. No terminal CI result, hardware acceptance or production readiness is claimed.

The current head 6752face4f50b163b6c3b8d6a3625be323208675 adds only the installed-wheel test harness correction. The main wheel was built and all 259 Python checks also passed against that installed production code in isolated Python. Actual browser screenshot provenance remains d97c1949; the screenshot was captured from that revision, with no human acceptance claim.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go2 replay realtime (arm64)

Details
Benchmark suite Current: 6752fac Previous: 17fdb6b Ratio
peak memory 1595.867 MB 1589.477 MB 1.00
peak threads 351 threads 350 threads 1.00
network (transport) 2724.728 MB 2730.079 MB 1.00
disk write 1.695 MB 1.707 MB 0.99
instructions 115.702 G 115.497 G 1.00

This comment was automatically generated by workflow using github-action-benchmark.

@codecov

codecov Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.59864% with 5 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
dimos/web/relay_bridge/gen_cdr_fixtures.py 84.37% 4 Missing and 1 partial ⚠️
@@                       Coverage Diff                       @@
##             cc/feat/cdr-optin-transports    #4651   +/-   ##
===============================================================
  Coverage                                ?   81.72%           
===============================================================
  Files                                   ?     1657           
  Lines                                   ?   155150           
  Branches                                ?    13091           
===============================================================
  Hits                                    ?   126794           
  Misses                                  ?    24711           
  Partials                                ?     3645           
Components Coverage Δ
Tests 96.47% <0.00%> (?)
Flag Coverage Δ
OS-macos-latest 75.67% <96.59%> (?)
OS-ubuntu-24.04-arm 75.45% <96.59%> (?)
Py-3.12 75.78% <96.59%> (?)
SelfHosted-Large 32.00% <38.09%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
dimos/web/cdr_codec.py 100.00% <100.00%> (ø)
dimos/web/cockpit.py 96.81% <100.00%> (ø)
dimos/web/codecs.py 100.00% <100.00%> (ø)
dimos/web/relay_bridge/module_test_support.py 99.00% <100.00%> (ø)
...os/web/relay_bridge/test_relay_bridge_authoring.py 99.57% <100.00%> (ø)
dimos/web/test_cdr_codec.py 100.00% <100.00%> (ø)
dimos/web/relay_bridge/gen_cdr_fixtures.py 84.37% <84.37%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@TomCC7 TomCC7 closed this Oct 20, 2026
@TomCC7
TomCC7 deleted the cc/feat/cdr-browser-viewer branch October 20, 2026 18:10

This branch was successfully deployed

1 active deployment
cachix — 6752face Deployed Oct 20, 2026 by TomCC7 via cachix-build-macos #13358
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