cartographer_rviz¶
cartographer_rviz is the RViz integration package for Cartographer (ROS 2). It provides a visualization plugin that displays the map built by Cartographer as a collection of submaps inside RViz.
Cartographer represents the environment as a set of trajectory-local submaps. Each submap stores occupancy information that can be rendered as a grayscale intensity image with an associated alpha (opacity) channel. The plugin fetches per-submap textures from the running Cartographer node and composites them into a single “X-ray” view of the map inside the 3D scene.
Role in the system¶
This package is a consumer of the other Cartographer packages:
It depends on the
cartographercore library, which provides theSubmapIdtype, theSubmapTextures/SubmapTexturerendering data structures, and the submap painting machinery used to produce the textures.It depends on
cartographer_rosfor theFetchSubmapTextures()helper that queries the Cartographer node over theSubmapQueryservice, and oncartographer_ros_msgsfor theSubmapList,SubmapEntry, andSubmapQuerymessages and service used by that RPC.It is a plugin for
rviz_common,rviz_rendering, andrviz_ogre_vendor, which provide the RViz display infrastructure and the OGRE rendering engine.
How it works¶
The
SubmapsDisplayplugin subscribes to theSubmapListtopic published by Cartographer.For every submap in the list, it creates a
DrawableSubmapobject that owns twoOgreSliceobjects (one high-resolution and one low-resolution slice).On every render update, submaps that have a newer metadata version issue an asynchronous
SubmapQueryservice call throughFetchSubmapTextures().The returned texture is uploaded to OGRE as raw RGB pixel data and drawn as a textured quad in the scene, positioned and oriented by the submap pose.
Submaps are alpha-blended together, and submap opacity fades with the distance between the submap and the tracking frame in the z direction.
Contents¶
Overview — this page.
Quickstart — build and usage instructions.
File-by-file documentation:
Build and package metadata:
CMakeLists.txt,package.xml,rviz_plugin_description.xml.Headers under
include/cartographer_rviz/:submaps_display.h,drawable_submap.h,ogre_slice.h.Implementations under
src/:submaps_display.cpp,drawable_submap.cpp,ogre_slice.cpp.OGRE shader and material files under
ogre_media/materials/:glsl120.program,submap.vert,submap.frag,submap.material.
Cross-References¶
cartographer_ros — Main ROS 2 integration package
cartographer_ros_msgs — ROS message and service definitions
Cartographer Core Library — Underlying SLAM library (submap types, rendering)