avoid /map topic replacement
I am running ROS Melodic on Ubuntu 18.04.
I have been mapping an environment using Rviz and gmapping with Gazebo as simulator and saved the map in a folder.
Now I want to load it back, so I run rosrun map_server map_server mymap.yaml
, then I launch (in order) Gazebo and Rviz. If I don't launch gmapping, Rviz notifies me with an error, which is understandable, that says "Missing transform between /map and /odom". That is telling me that I didn't provide it (through gmapping, because in this case I haven't launched it).
The problem is that, if I do launch gmapping, the map gets updated with the new laserscan readings and I lose the previously-uploaded map.
How can I do in order to
- Have the transform /map -> /odom
- Render the map in Rviz correctely
- Avoid /map updates through gmapping