Is there a way to extract the edge with coordinates out of occupancy map in ROS?
I'm looking for a way in ROS Kinetic on Ubuntu 16.04 to extract a line (edge) out of a occupancy map made in OctoMap with 3D laser (lidar) data. I have precise imu and gps data. I need to obtain coordinates of the mapped edge to make a map of safe space for my vessel to navigate. I've already have the occupancy map in .bt or .ot format (octrees) from octomap_server package in ROS. Is there a way to detect a nearest occupied cells and extract coordinates in RViz?
Asked by KamilaMT on 2021-04-06 08:54:21 UTC
Answers
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);
Asked by mohamed ahmed on 2021-04-07 02:51:21 UTC
Comments