Skip to content

feat(pj_base): add VoxelGrid canonical builtin object (SDK 0.10.0)#130

Merged
facontidavide merged 2 commits into
mainfrom
feat/voxel-grid-builtin
Jun 19, 2026
Merged

feat(pj_base): add VoxelGrid canonical builtin object (SDK 0.10.0)#130
facontidavide merged 2 commits into
mainfrom
feat/voxel-grid-builtin

Conversation

@facontidavide

Copy link
Copy Markdown
Contributor

Summary

Adds sdk::VoxelGrid — a new canonical builtin object for dense 3D voxel grids (3D occupancy maps, costmaps, ESDFs, semantic grids). It is the volumetric sibling of OccupancyGrid, reusing PointCloud's PointField channel model.

The struct mirrors foxglove.VoxelGrid's byte layout (depth-major Z-Y-X order + three strides). Because PJ parses messages lazily (the store keeps the original serialized bytes), this fidelity lets a producer expose data as a zero-copy Span<const uint8_t> + BufferAnchor instead of transcoding millions of cells. The per-voxel value is generic (occupancy byte / RGBA / float cost / class id via fields); which voxels are drawn — and any colormap — stays a viewer-side decision (unlike the 2D OccupancyGrid, which fixes -1/0..100).

Why Foxglove's shape and not Rerun's: Foxglove is the only ecosystem with a dedicated VoxelGrid schema; Rerun has no voxel type (it expands to Boxes3D at render time). So this is the canonical storage schema; sparse/instanced GPU expansion is a downstream pj_scene3D renderer concern, not part of the SDK.

Changes

  • pj_base/builtin/voxel_grid.hpp — the struct (zero-copy data + BufferAnchor, PointField reuse)
  • pj_base/builtin/voxel_grid_codec.{hpp,cpp} — canonical wire codec (hand-rolled protobuf_wire, no protobuf runtime)
  • pj_base/proto/pj/VoxelGrid.proto — wire contract (imports Geometry.proto + PointCloud.proto)
  • kVoxelGrid = 18 appended to both BuiltinObjectType (builtin_object.hpp) and PJ_builtin_object_type_t (builtin_object_abi.h) — append-only; type 2 stays reserved
  • Tests: voxel_grid_codec_test.cpp (round-trip + empty-buffer + schema-name); builtin_object_test enumerations extended
  • Docs: builtin_type.md (table row, per-type section, conversion row), proto README, builtin-count bumps + corrected 3-source version mechanics in CLAUDE.md

Versioning

Bumps to 0.10.0 — a MINOR (backward-compatible addition: tail-appended enum value + two new exported symbols). abi/baseline.abi is unchanged (it only moves on a MAJOR; abidiff should show additions only). All three version sources (conanfile.py, CMakeLists.txt, recipe.yaml) are aligned so the conda-release guard passes — recipe.yaml had drifted to 0.8.1, which is why the conda/pixi 0.9.0 publish failed.

Plugins/PJ4 adopt plotjuggler_sdk/[>=0.10.0 <1.0.0] once released.

Test plan

  • ./build.sh --debug && ./test.sh — Debug+ASAN green; voxel_grid_codec_test 4/4, builtin_object_test 6/6
  • pre-commit run clean (clang-format pinned v22.1.0)

Follow-ups (separate work, not in this PR)

  • foxglove.VoxelGrid → sdk::VoxelGrid parser in pj-official-plugins (the zero-copy producer)
  • pj_scene3D GPU-expansion renderer (dense buffer → compute-shader compaction → instanced cubes)

🤖 Generated with Claude Code

facontidavide and others added 2 commits June 19, 2026 15:39
Add sdk::VoxelGrid, the dense 3D voxel-grid builtin — the volumetric
sibling of OccupancyGrid, reusing PointCloud's PointField channel model.
The struct mirrors foxglove.VoxelGrid's byte layout (Z-Y-X order, three
strides) so a lazily-parsing producer exposes `data` as a zero-copy
Span<const uint8_t> + BufferAnchor rather than transcoding cells. The
per-voxel value is generic (occupancy/cost/ESDF/semantic via `fields`);
which voxels are drawn stays a viewer-side decision.

- voxel_grid.hpp / voxel_grid_codec.{hpp,cpp} + proto/pj/VoxelGrid.proto
- kVoxelGrid = 18 appended to BuiltinObjectType and PJ_builtin_object_type_t
  (append-only; type 2 stays reserved)
- round-trip + empty-buffer tests; builtin_object_test enumerations extended
- docs: builtin_type.md (type row, section, conversion), proto README,
  builtin-count bumps + 3-source version mechanics in CLAUDE.md

Build Debug+ASAN green; voxel_grid_codec_test 4/4, builtin_object_test 6/6.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
VoxelGrid is a backward-compatible addition (tail-appended enum value +
two new exported symbols), so this is a MINOR bump and abi/baseline.abi
is unchanged.

Aligns all three version sources — conanfile.py, CMakeLists.txt
(PJ_PACKAGE_VERSION), and recipe.yaml (context.version) — so a v0.10.0
tag passes the conda-release guard. recipe.yaml had drifted to 0.8.1 at
the v0.9.0 tag, which is why the conda/pixi 0.9.0 publish failed while the
Conan/GitHub release succeeded.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@facontidavide facontidavide merged commit dd126ed into main Jun 19, 2026
6 of 7 checks passed
@facontidavide facontidavide deleted the feat/voxel-grid-builtin branch June 19, 2026 13:46
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