Skip to content

Use rerun GridMap archetype for grid visualisation#14

Merged
MJohnson459 merged 4 commits into
mainfrom
feat/rerun-gridmap
Jun 16, 2026
Merged

Use rerun GridMap archetype for grid visualisation#14
MJohnson459 merged 4 commits into
mainfrom
feat/rerun-gridmap

Conversation

@MJohnson459

Copy link
Copy Markdown
Owner

Migrate Rerun visualisation from hand-textured Mesh3D planes to the native GridMap archetype (rerun 0.29 → 0.33).

Changes

  • GridMap migration: log_costmap / log_occupancy_grid now log single-channel L/U8 grids coloured by rerun's built-in RvizCostmap / RvizMap colormaps. Orientation matches the GridMap renderer (image row 0 = north, origin at the lower-left corner); the prior vertical flip is preserved so geometry is unchanged. Removed the now-dead log_textured_plane_mesh3d helper.
  • Cost translation: raw costmap_2d costs (253/254/255) are translated to nav2's published convention (free 0, inscribed 99, lethal 100, unknown 255, gradient 1-98) so RvizCostmap renders correctly instead of producing spurious green/magenta artifacts.
  • Static global map: added log_costmap_static / log_occupancy_grid_static (backed by rec.log_static); the unchanging global map in local_costmap_lidar uses it so it stays visible across the timeline (newer rerun no longer latches pre-timeline data).
  • Transparency / overlay: costmaps log at opacity = 0.85, which forces rerun's transparent draw phase (so RvizCostmap's transparent free cells work instead of rendering black) and gives the classic RViz costmap-over-map overlay.

Maintainer decisions (intentionally NOT done here)

  • Version: this is API-breaking (removed public log_textured_plane_mesh3d; rerun types are in the public API), so a release should bump 0.2.0 → 0.3.0. Left unbumped per request.
  • MSRV: the rerun feature now requires rustc 1.92 (recorded via rust-version); the default build still works on 1.90. CI does not compile the rerun feature.

Testing

  • cargo test (default), cargo +1.92 test --features rerun, clippy, fmt, and all four rerun examples build clean.

🤖 Generated with Claude Code

MJohnson459 and others added 4 commits June 16, 2026 14:55
Bump rerun 0.29 -> 0.33 and migrate log_costmap / log_occupancy_grid
from hand-textured Mesh3D planes to the native GridMap archetype.
Grids are now logged as single-channel L/U8 buffers coloured by Rerun's
built-in RvizCostmap / RvizMap colormaps, removing the local RGB byte
builders and the log_textured_plane_mesh3d helper.

Orientation matches the GridMap renderer (image row 0 = north, the
GridMap origin at the lower-left corner), so the existing vertical flip
is preserved and grid geometry is unchanged.

The rerun feature now requires rustc 1.92, recorded via rust-version.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Rerun's RvizCostmap colormap is a port of the RViz costmap palette, which
is indexed by nav2's *published* cost values (free 0, inscribed 99, lethal
100, unknown 255, gradient 1-98), not raw costmap_2d costs (253/254/255).

Feeding raw costs sent lethal/inscribed and the inflation gradient onto the
colormap's 99/100/101-127 special bands, producing spurious cyan/magenta/
green artifacts. Translate raw costs via nav2's cost translation table
before logging so RvizCostmap renders correctly. Occupancy/RvizMap already
matches our 0-100 + unknown convention, so it is unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The local_costmap_lidar example logged the global map once before the
frame timeline existed, so on newer rerun it only latched before frame 0
and vanished during playback. Add log_costmap_static /
log_occupancy_grid_static (backed by rec.log_static) alongside the
per-frame log_costmap / log_occupancy_grid, and use the static variant for
the unchanging global map so it stays visible across the whole recording.

GridMap construction is factored into a shared helper so each entry point
just chooses rec.log vs rec.log_static.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
RvizCostmap makes free cells (cost 0) transparent, but that alpha comes
from the colormap in the shader; the source texture is single-channel L/U8
with no alpha channel. Rerun's rectangle renderer only uses the blended
(transparent) draw phase when the texture has an alpha channel or opacity
tint < 1.0 -- at exactly 1.0 it takes the opaque path, ignoring the
colormap's per-texel alpha, so free space rendered as solid black and hid
the map beneath it.

Log costmaps at opacity 0.85: this both forces the transparent phase and
gives the classic RViz costmap-over-map overlay, where the coloured cells
are slightly translucent so an underlying map shows through them too.
Occupancy/RvizMap has no transparent class, so it stays fully opaque.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@MJohnson459 MJohnson459 merged commit db66b78 into main Jun 16, 2026
4 checks passed
@MJohnson459 MJohnson459 deleted the feat/rerun-gridmap branch June 16, 2026 14:50
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