0
$\begingroup$

Rosanswers logo

Is there a way to specify the values for <xacro:property> tags in launch file ? I want to use a single *.urdf.xacro file using different values for the same property. Is it possible ?

For eg.: In door.urdf.xacro

<xacro:property name = room value = "workroom" />
<link name = "${room}_door">
....

I would like to specify the value "workroom" for the property room in the launch file so that I can use the same *.urdf.xacro file for all the rooms in my gazebo world (kitchen, bedroom etc..). I know I can use TinyXML but it will be easier and simpler if I can specify the properties in launch file. Or is there any other way out ?

Thanks!


Originally posted by prasanna.kumar on ROS Answers with karma: 1363 on 2013-03-28

Post score: 2

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

You have to use a macro. You may use something like this:

<xacro:macro name="whatever" params="room">
<link name = "${room}_door">
 ...
</link>
</xacro:macro>
<xacro:whatever room="workroom"/>

Originally posted by Fabien R with karma: 90 on 2013-12-04

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

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