Search code examples
rosgazebo-simu

How to create two map simultaneously using one gazebo?


As shown in the figure below, now my gazebo is running 2 slam_gmapping package. First is /turtlebot_slam_gmapping publish to the /map topic. Second is /slam_gmapping publish to the same /map topic as first. I would like to create a new /map topic which is /map2 (red) publish from the /slam_gmapping (the second one) and not publish to the /map topic (the blue one that I erased). How can I do this?

enter image description here


Solution

  • Assuming you're using a launch file like the one I suggested in one of your previous questions, you need to include a remap tag for the node telling it what topics to remap. For the above node it should look like this: <remap from="/map" to="/map2" />