ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
That happens because gmapping has one map for every particle and the best particle's map and pose are shown in rviz. If the best particle changes, so does the estimated robot pose and the map. However, the robot pose is updated much more frequently, so you often see the pose estimate of the new best particle, while still looking at the old best map estimate. Looking at gmapping's code it seems a new map is published everytime updateMap() is called. This in turn is called every map_update_interval (which is a gmapping rosparam) seconds. So lowering this should lower the amount of time you see pose and map out of sync. OTOH, this increases computational load and updates the map more often, which can have an impact on overall mapping performance (speed and quality wise). One (pretty invasive) idea would be to optionally let gmapping publish a new map message as soon as the best particle changes.