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

How can I estimate the coverage performed by an algorithm while exploring an unknown map

asked 2015-11-26 09:24:19 -0500

robo_explorer gravatar image


I am using the nav2d exploration package to explore an unknown environment. I am using various strategies like NearestFrontier and MinPos Planner.

Is there a way through which I can estimate the area covered by these strategies?


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-11-27 04:34:08 -0500

I've not worked previously with the nav2d_exploration package, but I'm assuming that the resulting map should have three different colours: black for the sensed obstacles, white for the empty explored space and grey for the unexplored space. A not fancy way to do it, although could work, is "count" the amount of pixels with the empty explored space value.

You can do that in external tools such as MATLAB, or even inside your ROS code, that's up to you! I guess the method which provides a higher amount of "explored space" will be the one which has the highest cover ability.

edit flag offensive delete link more


Do you mean this in rviz? cause rviz only shows me that part of map which is explored and is not that much accurate. Even though do you know how can I count the pixels? Thats sounds interesting.

robo_explorer gravatar image robo_explorer  ( 2015-11-27 12:58:17 -0500 )edit

No, not in rviz. I guess you're running a map_server to publish the map that you're exploring. Map_server has the command map_saver which allows you to save the map as an image. Then, you can work on that image and "count" the pixels.

S.Prieto gravatar image S.Prieto  ( 2015-11-30 01:51:37 -0500 )edit

For the "counting", you have to read the image to get the image matrix (you can skip the whole step of getting the image if you get directly the matrix with the values from the map topic). Once you have the matrix, just look at each element (usually you do this with 2 loops, rows and columns).

S.Prieto gravatar image S.Prieto  ( 2015-11-30 01:54:13 -0500 )edit

Looking at each element you can check it's value, and count how many pixels you have for each value. You can do the counting with any programming language, that's up to you if you want to do it inside ROS or externally, which in that case I recommend you to use MATLAB.

S.Prieto gravatar image S.Prieto  ( 2015-11-30 01:56:52 -0500 )edit

Thanks a lot for this detailed answer.

robo_explorer gravatar image robo_explorer  ( 2015-12-03 20:38:38 -0500 )edit

Question Tools

1 follower


Asked: 2015-11-26 09:24:19 -0500

Seen: 194 times

Last updated: Nov 27 '15