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

Slam_toolbox: Change published map topic

asked 2021-01-25 13:02:26 -0500

icheler gravatar image


i want to use slam_toolbox in a multi-robot setting. My simple question is:

Is it possible to change the topic the map is published on, since the global /map is needed for merging robot maps and i want to use slam_toolbox to compute the "local" maps of the robots, for example /robot_namespace/map?

Thank you for the answers.

System information where relevant:

  1. ubuntu 20.04 with kernel 5.8.0-38-generic
  2. ros noetic 1.15.9
  3. slam_toolbox noetic_devel 1.5.4
edit retag flag offensive close merge delete



As with any ROS package, you can remap the topic or launch the node in a namespace.

stevemacenski gravatar image stevemacenski  ( 2021-01-26 10:11:02 -0500 )edit

When launching the node in a namespace the published map is still published to /map and not to ns/map. With the remapping and namespaces the nodes start and work correctly as long as they are not started relatively close to each other time-wise. I couldn't start both nodes from the same launch file with both of them working. I could provide the necessary files to highlight my new problem, but I found a solution which works which is totally fine for me. Thanks for the comment and keep up the good work.

icheler gravatar image icheler  ( 2021-01-26 13:51:13 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2021-01-28 19:17:23 -0500

icheler gravatar image

The first answer provided a viable solution with the remapping. Launching the nodes within their own namespace alone does not fix this issue. A combination of both solutions was required.

edit flag offensive delete link more


Hi @icheler if I am trying to do the exact same thing, running multiple instances of slam_toolbox. Could you please elaborate a little more on your solution?

I remapped the "/map" topic for the second node and also ran the slam_toolbox instances in different namespaces.

Everything works good but from time to time one of the nodes crashes.

Note that I am doing it in ROS2 foxy but I still appreciate if you share your experience and I hope it is applicable to ROS2 as well.


myavari gravatar image myavari  ( 2021-06-11 16:26:37 -0500 )edit

Question Tools

1 follower


Asked: 2021-01-25 13:02:26 -0500

Seen: 510 times

Last updated: Jan 28 '21