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

Revision history [back]

click to hide/show revision 1
initial version

With the args you can specify the output directory yes but you have to specify a full path and a base name. in your question you would overwrite the first map when saving the second one because they would have the same name (the default one). Also you have to use the tag remap because map_saver subscribe to a topic (/map by default) to get the map.

Here is a launch file that do what you want :

<launch>
    <arg name="map_1" default="/topic_map_1"/>
    <arg name="map_2" default="/topic_map_2"/>
  <node name="map_saver1" pkg="map_server" type="map_saver" args="-f $(find your_pkg)/map_1">
        <remap from="/map" to="$(arg map_1)"/>
  </node>
  <node name="map_saver2" pkg="map_server" type="map_saver" args="-f $(find your_pkg)/map_2">
    <remap from="/map" to="$(arg map_2)"/>
  </node>
</launch>

With the args you can specify the output directory yes but you have to specify a full path and a base name. in In your question you would overwrite the first map when saving the second one because they would have the same name (the default one). Also you have to use the tag remap because map_saver subscribe subscribes to a topic (/map by default) to get the map.

Here is a launch file that do what you want :

<launch>
    <arg name="map_1" default="/topic_map_1"/>
    <arg name="map_2" default="/topic_map_2"/>
  <node name="map_saver1" pkg="map_server" type="map_saver" args="-f $(find your_pkg)/map_1">
        <remap from="/map" to="$(arg map_1)"/>
  </node>
  <node name="map_saver2" pkg="map_server" type="map_saver" args="-f $(find your_pkg)/map_2">
    <remap from="/map" to="$(arg map_2)"/>
  </node>
</launch>