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

Revision history [back]

I explored this same question a while ago, see https://github.com/ros-planning/navigation/issues/279

As you point out, to load a new map with the current map_server implementation, you need to kill the node and reload it.

A possible solution, that doesn't require any changes in map_server (as proposed by @david-lu), would be to load all your different maps in separate map_server instances renaming appropriately the /map topic on each instance (for example /map_1, /map_2, etc...) and use a multiplexer that subscribes to all your maps and publishes the topic /map depending on which map you want the multiplexer to select.

The other solution would be to modify the source code of map_server and add a service to change the map on demand. Some work has been done, but it hasn't been released yet. If you read through navigation issue #279 you will find the code.

I hope this helps