Skip to content

feat: add Rerun split layout (Camera | 3D) to Go2 and G1 base blueprints#1525

Merged
spomichter merged 2 commits intodevfrom
feat/rerun-split-layout
Mar 11, 2026
Merged

feat: add Rerun split layout (Camera | 3D) to Go2 and G1 base blueprints#1525
spomichter merged 2 commits intodevfrom
feat/rerun-split-layout

Conversation

@spomichter
Copy link
Contributor

Adds a horizontal split view (camera feed 1/3, 3D world 2/3) to the Rerun viewer for Go2 basic and G1 primitive blueprints, matching the existing drone blueprint pattern. All downstream blueprints inherit the layout automatically.

Problem

Closes DIM-XXX

Solution

Breaking Changes

How to Test

Contributor License Agreement

  • I have read and approved the CLA.

Adds a horizontal split view (camera feed 1/3, 3D world 2/3) to the
Rerun viewer for Go2 basic and G1 primitive blueprints, matching the
existing drone blueprint pattern. All downstream blueprints inherit
the layout automatically.
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 11, 2026

Greptile Summary

This PR adds a horizontal split Rerun viewer layout (1/3 camera feed, 2/3 3D world) to the Go2 basic and G1 primitive base blueprints, matching the pattern already used by the drone blueprint. The changes are small, self-contained, and correctly implement the BlueprintFactory interface consumed by rerun_bridge (which calls self.config.blueprint() at startup via rr.send_blueprint).

Key changes:

  • Adds _go2_rerun_blueprint() to unitree_go2_basic.py and registers it under rerun_config["blueprint"]
  • Adds _g1_rerun_blueprint() to uintree_g1_primitive_no_nav.py and registers it under rerun_config["blueprint"]
  • Both functions use origin="world/color_image" for the Spatial2DView, consistent with the image_topic already set in each file's _convert_camera_info helper
  • All downstream blueprints that **rerun_config from these base files will inherit the layout automatically

Minor observations:

  • The two new blueprint functions are byte-for-byte identical; a shared layout utility would prevent future drift
  • The pre-existing filename typo uintree_g1_primitive_no_nav.py (uintreeunitree) is a good candidate to fix while the file is being touched

Confidence Score: 5/5

  • This PR is safe to merge — changes are additive, correctly typed, and follow the established drone blueprint pattern.
  • Both functions correctly satisfy the BlueprintFactory (zero-arg callable returning rrb.Blueprint) interface that RerunBridgeModule expects. The entity path world/color_image is consistent with the existing _convert_camera_info helpers in both files. No logic is altered; only the viewer layout is enriched. The only notes are a style suggestion around code duplication and a pre-existing filename typo.
  • No files require special attention.

Important Files Changed

Filename Overview
dimos/robot/unitree/g1/blueprints/primitive/uintree_g1_primitive_no_nav.py Adds _g1_rerun_blueprint() — a horizontal split (1/3 camera, 2/3 3D) using world/color_image — and registers it in rerun_config. Implementation is correct and consistent with the bridge API. Minor pre-existing filename typo (uintree vs unitree) noted.
dimos/robot/unitree/go2/blueprints/basic/unitree_go2_basic.py Adds _go2_rerun_blueprint() — identical horizontal split layout to the G1 addition — and registers it in rerun_config. Correct use of the BlueprintFactory interface expected by rerun_bridge.

Sequence Diagram

sequenceDiagram
    participant BP as Blueprint File<br/>(go2_basic / g1_primitive)
    participant RB as RerunBridgeModule
    participant RR as Rerun Viewer

    BP->>RB: rerun_bridge(**rerun_config)<br/>blueprint=_go2_rerun_blueprint (fn ref)
    Note over RB: stores config.blueprint = fn
    RB->>RB: start() / connect viewer
    RB->>BP: config.blueprint()
    BP-->>RB: rrb.Blueprint(Horizontal([Spatial2DView, Spatial3DView], column_shares=[1,2]))
    RB->>RR: rr.send_blueprint(blueprint)
    RR-->>RR: Render split layout<br/>Camera (1/3) | 3D World (2/3)
Loading

Comments Outside Diff (1)

  1. dimos/robot/unitree/g1/blueprints/primitive/uintree_g1_primitive_no_nav.py, line 1 (link)

    Filename typo: uintree should be unitree

    The file is named uintree_g1_primitive_no_nav.py (note the transposition uiui), while all other G1/Go2 files (e.g. unitree_go2_basic.py, unitree_g1_basic.py) use the correct spelling unitree. This is a pre-existing issue, but since you're already modifying this file it would be a good opportunity to rename it and update any imports referencing it.

Last reviewed commit: 26a4e3b

Comment on lines +70 to +80
def _g1_rerun_blueprint() -> Any:
"""Split layout: camera feed + 3D world view side by side."""
import rerun.blueprint as rrb

return rrb.Blueprint(
rrb.Horizontal(
rrb.Spatial2DView(origin="world/color_image", name="Camera"),
rrb.Spatial3DView(origin="world", name="3D"),
column_shares=[1, 2],
),
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Identical blueprint functions across robot configs

_g1_rerun_blueprint (here) and _go2_rerun_blueprint (unitree_go2_basic.py) are byte-for-byte identical — same origin path, same names, same column_shares. If the shared layout ever needs adjusting (e.g. different column ratio or a grid overlay like the drone blueprint has), both files must be updated in lockstep.

Consider extracting a shared factory into a common utility module (e.g. dimos.visualization.rerun.layouts) so both can import it:

# dimos/visualization/rerun/layouts.py
def color_image_3d_blueprint(camera_origin: str = "world/color_image") -> Any:
    import rerun.blueprint as rrb
    return rrb.Blueprint(
        rrb.Horizontal(
            rrb.Spatial2DView(origin=camera_origin, name="Camera"),
            rrb.Spatial3DView(origin="world", name="3D"),
            column_shares=[1, 2],
        ),
    )

Then each robot file just does from dimos.visualization.rerun.layouts import color_image_3d_blueprint and sets "blueprint": color_image_3d_blueprint. This avoids future drift between robot configs.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

…o2 values

Same fix as PR #1516 for Go2. G1 sim was using hardcoded 1280x720
Go2 real-camera intrinsics while MuJoCo renders at 320x240, causing
the projected camera image to appear tiny in Rerun.
@spomichter spomichter merged commit df986f5 into dev Mar 11, 2026
11 checks passed
@spomichter spomichter deleted the feat/rerun-split-layout branch March 11, 2026 22:39
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