0
$\begingroup$

Rosanswers logo

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.


Originally posted by thebyohazard on ROS Answers with karma: 3562 on 2015-08-07

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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"/>
<xacro:property name="dictionary" value="${load_yaml(filename)}"/>

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.


Originally posted by thebyohazard with karma: 3562 on 2015-08-19

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.