Ask Your Question

Revision history [back]

If you want a node that does the mapping for you, have a look at octomap_server. It takes point clouds with tf and builds an octomap for you that you can request e.g. with the octomap_saver node. You can also use the API in your own code.

If you want to keep it simple and just use the OctoMap API in your code then you're right, insertPointCloud() is the correct function. You only need to convert the point clouds into the OctoMap native type by using conversions.h in the package octomap_ros.

With all this, just keep in mind that you're not actually storing the PointCloud2 in octomap, but integrate the information into the occupancy map. The actual point cloud data is discarded afterwards.