Use rerun GridMap archetype for grid visualisation#14
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrate Rerun visualisation from hand-textured
Mesh3Dplanes to the nativeGridMaparchetype (rerun 0.29 → 0.33).Changes
log_costmap/log_occupancy_gridnow log single-channel L/U8 grids coloured by rerun's built-inRvizCostmap/RvizMapcolormaps. 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-deadlog_textured_plane_mesh3dhelper.costmap_2dcosts (253/254/255) are translated to nav2's published convention (free 0, inscribed 99, lethal 100, unknown 255, gradient 1-98) soRvizCostmaprenders correctly instead of producing spurious green/magenta artifacts.log_costmap_static/log_occupancy_grid_static(backed byrec.log_static); the unchanging global map inlocal_costmap_lidaruses it so it stays visible across the timeline (newer rerun no longer latches pre-timeline data).opacity = 0.85, which forces rerun's transparent draw phase (soRvizCostmap's transparent free cells work instead of rendering black) and gives the classic RViz costmap-over-map overlay.Maintainer decisions (intentionally NOT done here)
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.rerunfeature now requires rustc 1.92 (recorded viarust-version); the default build still works on 1.90. CI does not compile thererunfeature.Testing
cargo test(default),cargo +1.92 test --features rerun, clippy, fmt, and all fourrerunexamples build clean.🤖 Generated with Claude Code