Passing command line argument between multiple launch-files
I'm using a launch file master.launch
that includes global_config.launch
.
In master.launch
I define a command line argument using
<arg name="config_argument" />
and then I include global_config.launch
<include file="$(find package_name)/launch/global_config.launch" />
But I will need the argument to be available in global_config.launch
. Is it possible pass the argument from the master.launch
to the global_config.launch
?
Thanks to gvdhoorn for linking that question. I changed my launchfiles as follows:
master.launch
<arg name="rosbag_name" />
<include file="$(find neuromorphic_stereo)/launch/global_config.launch">
<arg name="rosbag_name" value="$(arg rosbag_name)" />
</include>
global_config.launch
<node pkg="rosbag" type="play" name="event_publisher" args="$(find neuromorphic_stereo)/rosbag_simulator/$(arg rosbag_name)_merged.bag" required="true" />
but now ros tells me
unused args [rosbag_name] for include of global_config.launch
even though I'm actually using it. What am I still doing wrong?
I believe this is a duplicate of (at least) #q199152.
@gvdhoorn Thanks for linking the question gvdhoorn. It indeed seems to be a duplicate. Anyway I run in to problems using the suggested solution. I edited my question. Can you help me with that?