ANYbotics/grid_map

Universal grid map library for mobile robotic mapping

What it solves

Mobile robots navigating rough terrain need to store and update spatial data like elevation, friction, or traversability across a 2D area. This library provides a data structure for multi-layered grid maps, letting robots keep this information efficiently even as the map moves with the robot.

How it works

The map is a 2D grid with multiple layers, each holding a separate data type (e.g., height, color). Data is stored as Eigen matrices, so users can apply linear algebra operations directly. A two-dimensional circular buffer allows shifting the map's position without copying memory. Iterators let you access cells in rectangles, circles, polygons, and lines safely. The library also includes conversions to and from ROS messages (like PointCloud2, OccupancyGrid) and OpenCV images, plus a filter chain for processing and an RViz plugin for 3D visualization.

Who it's for

Developers building mobile robotic systems, especially those using ROS for navigation and terrain mapping. It is the foundation for packages like Robot-Centric Elevation Mapping and is suited for research or production in rough-terrain robots.

Highlights

  • Multi-layered: supports any number of data layers, e.g., elevation, friction, normal vectors.
  • Efficient repositioning: circular buffer allows map movement without copying all data.
  • Eigen-based: data stored as Eigen types, enabling fast operations and algorithms.
  • Convenience iterators: built-in loops for rectangular, circular, polygonal, and line regions.
  • ROS integration: direct conversion to/from PointCloud2, OccupancyGrid, GridCells, and custom GridMap messages.
  • OpenCV interface: convert maps to/from OpenCV images for image processing tools.
  • Visualization: RViz plugin renders maps as 3D surface plots; also supports point clouds, occupancy grids, and more.
  • Filters: configurable chain of filters (thresholding, inpainting, smoothing, math expressions) for map processing.

Related

  • Project
  • Project
  • Project
  • Project