ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org

# xacro load yaml file with rospack

I'm using xacro's new ability to load a yaml file into a property in order to update a URDF with new calibration data.

The file in the example is local. Is there any way to hook this up to rospack so I can include this xacro file in another one? I tried an inner $( ) but it didn't work. edit retag close merge delete ## 1 Answer Sort by » oldest newest most voted You apparently only need one set of ${} per property. So rather than trying to double up with

<xacro:property name="filename" value="$(find package)/file.yaml"/> <xacro:property name="dictionary" value="${load_yaml(${filename})}"/>  or <xacro:property name="dictionary" value="${load_yaml($(find package)/filename.yaml)}"/> like I tried to do, use two different properties, like so: <xacro:property name="filename" value="$(find package)/file.yaml"/>


The filename will be substituted already since it's already in curly brackets. You don't need two sets.

Thanks to [Robert Haschke] for this answer.

more