Skip to content

refactor: merge octomap examples into a camera-synced 2x2 viewer - #75

Merged
wkentaro merged 2 commits into
mainfrom
examples/synced-2x2-viewer
Jun 20, 2026
Merged

refactor: merge octomap examples into a camera-synced 2x2 viewer#75
wkentaro merged 2 commits into
mainfrom
examples/synced-2x2-viewer

Conversation

@wkentaro

Copy link
Copy Markdown
Owner

Summary

  • Replace insertPointCloud.py and insertPointCloudColor.py with a single examples/pointcloud_to_octree.py that builds an OcTree and a ColorOcTree from one scan and renders pointcloud / occupied / occupied (color) / empty in a 2x2 window.
  • The four panes share one trackball, so dragging, zooming, or panning any pane moves all four cameras together.
  • Extract the rendering machinery (the synced widget and the grid window) into examples/viewer.py, leaving the example as a concise walk through the octomap API.

Test plan

  • ruff check examples/ and ruff format --check examples/
  • Drove the example headlessly: a drag on one pane moves the camera and all four panes sync to the same pose (single shared trackball), confirmed by a rendered screenshot of the 2x2 grid.

wkentaro added 2 commits June 21, 2026 00:40
Combine insertPointCloud.py and insertPointCloudColor.py into a single
pointcloud_to_octree.py that builds an OcTree and a ColorOcTree from one
scan and shows pointcloud / occupied / occupied (color) / empty in a 2x2
window. The four panes share one trackball, so dragging any pane rotates
all four together.

Move the rendering machinery (the synced widget and the grid window) into
examples/viewer.py so the example reads as a concise walk through the
octomap API.
@wkentaro wkentaro self-assigned this Jun 20, 2026
@wkentaro

Copy link
Copy Markdown
Owner Author

This was generated by AI during PR processing.

Verdict: `recommend-merge`

Own PR, full-finalize pipeline. main gained 0 commits since the merge-base, so no rebase was needed and the existing green CI (9/9 checks) reflects the merged result; no push happened this tick.

Review (report-only /code-review, no meaningful findings):

  • The _extract_colored_voxels index rewrite (np.indices(...).reshape(3,-1).T) is provably equivalent to the old np.column_stack(np.nonzero(np.ones(...))) (verified numerically).
  • SyncedSceneWidget is sound: trimesh SceneWidget.__init__ calls reset_view(), so view["ball"] exists before sync(), and reset_view is not called on resize, so the shared trackball persists for the window lifetime.
  • The OcTree (nonnan) vs ColorOcTree (z < 2) mask split is intentional and documented inline.

/recommit: the two commits (refactor(examples) then docs) are already a clean, logical sequence; no reshaping needed. /verify: skipped (GUI viewer, not headlessly smoke-testable).

No follow-up or idea issues warranted.

@wkentaro wkentaro added the recommend-merge pr: Agent finalized and endorses it: review and merge label Jun 20, 2026
@wkentaro
wkentaro merged commit fc212dd into main Jun 20, 2026
9 checks passed
@wkentaro
wkentaro deleted the examples/synced-2x2-viewer branch June 20, 2026 16:26
@wkentaro wkentaro added this to the next milestone Jun 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

recommend-merge pr: Agent finalized and endorses it: review and merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant