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

So to answer your first question regarding the path driven and its length: I would recommend having a look at this question or better the accepted answer. Instead of creating the path you can use it to get the euclidean distance between two robot poses and add it up. This returns you the current driven distance of the robot. If you already have a path (as it looks like on the image you posted) you could subscribe to this path and add up all positions as if you would using a subscriber. This would not make sense however, since the time to compute the distance increases with the length of the path.

Regarding the second question with the area explored by the robot, depending on the mapping algorithm, I see no other way than to analyze the map in each time-step. Assuming the robot uses gmapping for generating the map you could subscribe to the map output and see how many pixels (in int8 data[] of the OccupancyGrid) are not equal to -1. All those have been explored in some way. Each entry in data[] represents a pre defined area (default 0.05*0.05 m²) which you can find in the resolution of the MapMetaData (see here )