Ask Your Question

Revision history [back]

That's quite easy if I understand it correctly and you want to compute the volume occupied by all occupied voxels. Just use a leaf_iterator in OctoMap to iterate over all leaf nodes. Then check whether the node is occupied (tree.isNodeOccupied(*it)), get the side length of the current voxel (it.getSize()) and compute the volume from it.

I'm not sure what you mean with "some voxels overlap". Leaf nodes in the octree cannot overlap.