"get" /run_id param into an arg with roslaunch
I would like to grab the rosmaster parameter /run_id inside the launchfile that brings up a rosbag node, in order to add it to the rosbag file's name. run_id is the session id associated with this particular instance of a rosmaster, and is in fact available from the parameter server when the rosbag node comes up. I know this because I can dump the run_id parameter uuid value into a yaml file during the launch. Unfortunately, I cannot find a way in the documentation to get access to this value from within the roslaunch script.
For instance, here is the output of the rosmaster as it is being brought up by roslaunch:
PARAMETERS
* /rosdistro: indigo
NODES
auto-starting new master
process[master]: started with pid [1751]
ROS_MASTER_URI=http://Threepio:11311/
setting /run_id to c297c6dc-1c35-11e6-bff7-cc3d821b2187
process[rosout-1]: started with pid [1769]
started core service [/rosout]
The run_id uuid is set and displayed right there.
Here is my roslaunch file (used to bring up the above master) where I can grab the parameter, but have no mechanism for transferring this parameter value into an arg or param to be substituted in the launch syntax:
<launch>
<arg name="run_id" default="abc"/>
<rosparam command="dump" param="/run_id" file="/tmp/foobar.yaml"/>
<node name="record" pkg="rosbag" type="record" args="-e /rosout --bz2 --split --size=20 -o
/data/users/foobar/ros_ws/src/bag_pkg/launch/bagfile_$(arg run_id)_$(env USER)"/>
</launch>
As you can see, the rosparam dump to a file works fine:
$ cat /tmp/foobar.yaml
c297c6dc-1c35-11e6-bff7-cc3d821b2187
...
tl;dr: Is it possible to "get" the rosparam /run_id with the ROS Indigo roslaunch xml syntax?