merging of launch files
I have 2 launch files which are launching same node but one launches with namespace and other with no namespace. how do I combine both of them? is it possible to make namespace argument optional ?
launch_file1 :
<node pkg="node_pkg" type="node_type" name="node_name" >
launch_file2:
<node pkg="node_pkg" type="node_type" name="node_name" args="load pkg_name/classname" ns="$(arg namespace)">
so i am launching same node with no_namespace and with namespace.
<node pkg="node_pkg" type="node_type" name="node_name" if="$(arg use_namespace)" ns="$(arg namespace)">
so i combined both launch files with above line in one single launch file. and i am using use_namespace to specify whether i want to launch node with namespace or not. but now it is launching nodes with onyl namespace my understanding from above line is just use ns if, "if" condition is satisfied and launch it with <node pkg="node_pkg" type="node_type" name="node_name"
It is not clear what you want to achieve. Do you want your nodes to be in the same namespace/no namespace? Namespace is an optional attribute. If @gvdhoorn 's answer is what you were looking for accept it, otherwise elaborate on "combine".