Read launch file arguments "<arg>" from another launch file
My understanding of the use of the <arg>
tag in launch files is that args must be visible at a higher launch file layers and passed down to lower launch file layers like this:
<launch>
<arg name="robot_height" value="0.5"/>
<include file="$(find package)/launch/robot.launch" >
<arg name="robot_height" value="$(arg robot_height)" />
</include>
</launch>
What I would really like to do is read arguments from lower layers and use them in higher layers. That would make it quite a bit more flexible and useful. I could have a global configs file for instance and read it from several launch files. Is something like this possible?
An alternative I attempted was to have a launch file set a parameters on the parameter server but as far as I could tell a launch file is unable to retrieve those parameters from the parameter server. I guess that makes sense based on the fact that a launch file is processed as a whole so the timing may not coordinate very well but wouldn't that be sweet!?!?
I guess what I'm really looking for is a way to have globally accessible variables between my launch files to make configuration a breeze. Is this possible?