Ask Your Question
1

Can I use the same map for multiple robots running move_base

asked 2018-11-06 12:48:30 -0600

benabruzzo gravatar image

For some experiments, I am trying to use two ground vehicles which would share the same map. Right now I am working on my configurations using gazebo. What I am trying to do is use the move_base package and launch a node for each vehicle. the issue I am running into is the mapping of topics and parameters. If I add a namespace to the launch file, then the map topic is also remapped. For example:

<launch>
  <group ns="vehicle1">
    <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
    </node>
  </group>
  <group ns="vehicle2">
    <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
    </node>
  </group>
</launch>

This code will publish the maps on the topics '/vehicle1/map' and '/vehicle2/map'. How can I launch this concept where both vehicles will just use '/map'?

(This is a significantly reduced example, it currently won't actually publish a map, it is just for an idea of what I am trying to do)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-11-06 13:40:34 -0600

Delb gravatar image

updated 2018-11-06 13:42:18 -0600

the issue I am running into is the mapping of topics and parameters

If you have an issue with the mapping then you can use the tag remap in your launch file, see the wiki. It works for topics and params.

Your example will look like :

<launch>
  <group ns="vehicle1">
    <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
      <remap from="vehicle1/map" to="/map"/>
     </node>
  </group>
  <group ns="vehicle2">
    <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
      <remap from="vehicle2/map" to="/map"/>
    </node>
  </group>
</launch>

NB : The / in the remapping is really important because it defines a global namespace and avoid the remapping of the grouptag. You have a detailled explanation here.

edit flag offensive delete link more

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: 2018-11-06 12:48:30 -0600

Seen: 98 times

Last updated: Nov 06 '18