Skip to content

perf(rerun): render voxel maps as Points3D spheres instead of Boxes3D#1793

Merged
ruthwikdasyam merged 7 commits intodevfrom
ruthwik/rerun/points3d
Apr 17, 2026
Merged

perf(rerun): render voxel maps as Points3D spheres instead of Boxes3D#1793
ruthwikdasyam merged 7 commits intodevfrom
ruthwik/rerun/points3d

Conversation

@ruthwikdasyam
Copy link
Copy Markdown
Contributor

@ruthwikdasyam ruthwikdasyam commented Apr 16, 2026

Problem

endering each voxel as an rr.Boxes3D instance is expensive - each box is 12 line segments in the
Rerun line renderer, whereas rr.Points3D with a world-space radius is a single billboarded quad per point

Closes #1631

Solution

Flip all PointCloud2.to_rerun(mode="boxes") callers to mode="spheres". Same world-space voxel footprint, renders as spheres instead of cubes, ~10x cheaper at high point counts

  • option to switch to mode=boxes is still present
  • voxel sizes are reduced to 0.05 (from 0.1), as the rerun maintains good fps with spherical voxels
  • toggling default set to 0 hz. Can be adjusted when needed (if, boxes are used)

Breaking Changes

None

How to Test

  • Any blueprint should launch rerun - with spherical voxels
    quick test -> `dimos --replay --replay-dir=unitree_go2_bigoffice run unitree-go2'

Contributor License Agreement

  • I have read and approved the CLA.
spherevoxels

Looks good. Able to maintain good fps (~20) with 400k voxels at 0.05 radius

@ruthwikdasyam ruthwikdasyam marked this pull request as ready for review April 16, 2026 23:28
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 16, 2026

Greptile Summary

This PR replaces rr.Boxes3D voxel rendering with rr.Points3D (world-space sphere radius) across all Go2, G1, and FastLio2 blueprints, and lowers the voxel size from 0.1 to 0.05 m. The change is well-motivated — each box costs 12 line segments vs. one billboarded quad for a point — and the PR description includes measured results (~20 fps at 400k voxels).

Confidence Score: 5/5

Safe to merge — all remaining findings are P2 style/robustness suggestions with no impact on correctness or runtime behavior.

The change is a straightforward caller-side swap (mode=spheres) that uses an existing, well-tested rr.Points3D code path. No data loss, no breaking API change. The three P2 comments (stale docstring, else-fallthrough, voxel-size inconsistency in the security blueprint) do not affect the correctness of the primary render path.

dimos/msgs/sensor_msgs/PointCloud2.py (docstring and else-fallthrough); dimos/robot/unitree/go2/blueprints/agentic/unitree_go2_security.py (voxel_size still 0.1)

Important Files Changed

Filename Overview
dimos/msgs/sensor_msgs/PointCloud2.py Added "spheres" mode to to_rerun() using rr.Points3D with world-space radii; voxel_size default lowered to 0.05; stale docstring claims "boxes" is default and else-fallthrough silently accepts invalid mode strings.
dimos/hardware/sensors/lidar/fastlio2/fastlio_blueprints.py All three FastLio2 visual overrides switched from mode="boxes" to mode="spheres" with voxel_size=0.05; straightforward and consistent.
dimos/robot/unitree/go2/blueprints/basic/unitree_go2_basic.py Global map visual override switched to mode="spheres" with voxel_size=0.05; max_hz for global_map, color_image, and global_costmap set to 0 (unlimited, filtered by if hz > 0 in bridge).
dimos/robot/unitree/go2/blueprints/agentic/unitree_go2_security.py Global map override changed to mode="spheres" but retains voxel_size=0.1, inconsistent with the basic Go2 blueprint's 0.05; may be intentional but is undocumented.
dimos/robot/unitree/g1/blueprints/primitive/uintree_g1_primitive_no_nav.py Global map override switched to mode="spheres" while intentionally keeping voxel_size=0.1 for the G1 (larger robot, different scale); consistent with robot geometry.
dimos/robot/unitree/go2/blueprints/smart/unitree_go2.py VoxelGridMapper voxel_size updated from 0.1 to 0.05; no other changes.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["PointCloud2.to_rerun(voxel_size, mode, ...)"] --> B{mode?}
    B -- "points" --> C["rr.Points3D(positions)\nno radii — raw point cloud"]
    B -- "boxes" --> D["rr.Boxes3D(centers, half_sizes)\n12 line segments per voxel"]
    B -- "spheres\n(all blueprint callers)" --> E["rr.Points3D(positions, radii=voxel_size/2)\nbillboarded quad per voxel — ~10x cheaper"]
    B -- "any other string\n(silent fallthrough)" --> E
    E --> F["Rerun viewer\n~20 fps @ 400k voxels"]
    D --> G["Rerun viewer\n~2 fps @ 400k voxels"]
Loading

Comments Outside Diff (2)

  1. dimos/msgs/sensor_msgs/PointCloud2.py, line 665 (link)

    P2 Stale docstring claims "boxes" is the default mode

    The docstring says "boxes" for cubes (default), but the parameter signature has mode: str = "points". Any caller reading the docstring will form the wrong expectation about the default rendering mode.

  2. dimos/msgs/sensor_msgs/PointCloud2.py, line 705-711 (link)

    P2 Silent fallthrough on invalid mode values

    The else branch silently treats any unrecognised string (e.g. mode="sphere", mode="Spheres") as spheres. A typo will render without warning, which is hard to debug. Consider an explicit elif mode == "spheres": guard followed by a ValueError:

Reviews (1): Last reviewed commit: "voxel size to 0.05" | Re-trigger Greptile

Comment thread dimos/robot/unitree/go2/blueprints/agentic/unitree_go2_security.py Outdated
@ruthwikdasyam ruthwikdasyam enabled auto-merge (squash) April 17, 2026 00:32
Copy link
Copy Markdown
Contributor

@leshy leshy left a comment

Choose a reason for hiding this comment

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

Hey we can probably just change PointCloud2 to_rerun() function to do this by default? and we can just delete explicit overrides from all blueprints

@ruthwikdasyam ruthwikdasyam merged commit 5532e8b into dev Apr 17, 2026
4 of 5 checks passed
@ruthwikdasyam ruthwikdasyam deleted the ruthwik/rerun/points3d branch April 17, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants