Ask Your Question
0

how to change map in map_server?

asked 2017-09-03 20:46:06 -0600

marine0131 gravatar image

now if i want to change a map , i need kill the map_server node now running, then start it again with other map name.

is there another way to change map without restart the node?

so thankyou if anything help !

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-09-03 21:43:59 -0600

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

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

edit flag offensive delete link more

Comments

thankyou so much , i will try the topic_tools/mux, then paste the result.

marine0131 gravatar imagemarine0131 ( 2017-09-04 00:05:43 -0600 )edit

This is a good solution. I like the idea of multiplexing the map topic for different maps.

jayess gravatar imagejayess ( 2017-09-04 17:47:35 -0600 )edit

@marine0131 did you go for this option, how did you fare? can you share your solution

uffe gravatar imageuffe ( 2018-11-24 13:50:57 -0600 )edit

Anyone tried this approach?

I've tried it, but although the map server is latched, when I select the topic with the mux there is no map. Only when I restart the map server...

Any thoughts on this? Thank you

EFernandes gravatar imageEFernandes ( 2019-02-13 10:00:42 -0600 )edit

You are right, the map server is latched, but since the multiplexer subscribes only once to each topic (when you launch the multiplexer) the map will not be resent through the multiplexer when you select the topic you want to listen to.

Martin Peris gravatar imageMartin Peris ( 2019-02-27 17:57:52 -0600 )edit

Anyway, there seems to be progress on this, check out this PR: https://github.com/ros-planning/navig...

Martin Peris gravatar imageMartin Peris ( 2019-02-27 17:58:18 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2017-09-03 20:46:06 -0600

Seen: 1,218 times

Last updated: Sep 03 '17