ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Well, what should work is the following:
robot.launch
as it isa robot_ns.launch
with the following in it:
<arg name="my_ns"/>
<group ns="$(arg my_ns)">
<include file="$(find mypack)/launch/robot.launch">
<arg name="namespace" value="$(arg my_ns)" />
</include>
</group>
and then, in the top-level launch file, do the following:
<include file="$(find mypack)/launch/robot_ns.launch">
<arg name="my_ns" value="r1" />
</include>
<include file="$(find mypack)/launch/robot_ns.launch">
<arg name="my_ns" value="r2" />
</include>
You then don't reassign arguments (which you actually cannot) and you only have to write the namespaces out once.
I guess you could also have this in just one launch file, if your robot.launch
could handle an empty namespace
argument with the group
tags correctly.