octomap 1.5.0


The Octomap library implements a 3D occupancy grid mapping approach. It provides data structures and mapping algorithms. The map is implemented using an Octree. It is designed to meet the following requirements:

  • Full 3D model. The map is able to model arbitrary environments without prior assumptions about it. The representation models occupied areas as well as free space. If no information is available about an area (commonly denoted as unknown areas), this information is encoded as well. While the distinction between free and occupied space is essential for safe robot navigation, information about unknown areas is important, e.g., for autonomous exploration of an environment.
  • Updatable. It is possible to add new information or sensor readings at any time. Modeling and updating is done in a probabilistic fashion. This accounts for sensor noise or measurements which result from dynamic changes in the environment, e.g., because of dynamic objects. Furthermore, multiple robots are able to contribute to the same map and a previously recorded map is extendable when new areas are explored.

  • Flexible. The extent of the map does not have to be known in advance. Instead, the map is dynamically expanded as needed. The map is multi-resolution so that, for instance, a high-level planner is able to use a coarse map, while a local planner may operate using a fine resolution. This also allows for efficient visualizations which scale from coarse overviews to detailed close-up views.
  • Compact. The is stored efficiently, both in memory and on disk. It is possible to generate compressed files for later usage or convenient exchange between robots even under bandwidth constraints.

Octomap was developed by Kai M. Wurm and Armin Hornung, and is currently maintained by Armin Hornung. A tracker for bug reports and feature requests is available available at https://sourceforge.net/apps/trac/octomap


See the file README.txt in the main folder.


See the file CHANGELOG.txt in the main folder or the latest version online

Getting Started

Jump right in and have a look at the main class octomap::OcTree and the examples in src/octomap/simple.cpp. To integrate single measurements into the 3D map have a look at octomap::OcTree::insertRay(...), to insert full 3D scans (pointclouds) please have a look at octomap::OcTree::insertScan(...). Queries can be performed e.g. with octomap::OcTree::search(...) or octomap::OcTree::castRay(...). The preferred way to batch-access or process nodes in an Octree is with the iterators leaf_iterator, tree_iterator, or leaf_bbx_iterator.

The OcTree class is derived from OccupancyOcTreeBase, with most functionality in the parent class. Also derive from OccupancyOcTreeBase if you you want to implement your own Octree and node classes. You can have a look at the classes octomap::OcTreeStamped and octomap::OcTreeNodeStamped as examples.

Start the 3D visualization with:

You will find an example scan to load at
src/examples/scan.dat.bz2 (please bunzip2 it first)