Hello Armin,
I am starting to use the octomap. My goal is to compute the unknown space using an octree representation.
I have tried to implement your second suggestion but without any good results.
Do you have any suggestion as to what I am doing wrong? Here is my code:
//msg comes from a ros message ...
AbstractOcTree* tree = msgToMap(*msg);
OcTree* octree = dynamic_cast<OcTree*>(tree);
//Define a bouding box
point3d min; min.x() = -1; min.y() = -1; min.z() = -1;
point3d max; max.x() = 1; max.y() = 1; max.z() = 1;
for(OcTree::leaf_bbx_iterator it = octree->begin_leafs_bbx(min,max), end=octree->end_leafs_bbx(); it!= end; ++it)
{
//if (octree->search(it.getX(), it.getY(), it.getZ()) == NULL)
if (octree->search(it.getKey()) == NULL)
{
cout << "Found an unknown" << endl;
}
}
So my problem is that I never get a print saying "Found unknown".
Thanks for the help.
Miguel