ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can iterate over the leafs of your map and set the bounding box(which has values around your robot)

for (octomap::OcTree::leaf_bbx_iterator it = ourmap->begin_leafs_bbx(min_point, max_point); it != ourmap->end_leafs_bbx(); ++it) { if(ourmap->isNodeOccupied(*it)) //check if node is occupied or note {

}

You can iterate over the leafs of your map and set the bounding box(which has values around your robot)

for (octomap::OcTree::leaf_bbx_iterator it = ourmap->begin_leafs_bbx(min_point, max_point);
        it != ourmap->end_leafs_bbx(); ++it)
{
  if(ourmap->isNodeOccupied(*it)) //check if node is occupied or note
   {{
       it.getCoordinate();
   }
}

You can also iterate over all the map leafs not just in bounding box. I hope I understood your question in the write way. if you still have questions or doubts just ask

}Note: min_point, max_point are defined as follows:

const octomap::point3d min_point(-10, -10, 0);
octomap::point3d max_point(10, 10, 10);