ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

Specify xacro properties in launch file

asked 2013-03-28 02:45:49 -0500

prasanna.kumar gravatar image

updated 2014-04-20 14:09:31 -0500

ngrennan gravatar image

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!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-12-04 04:59:45 -0500

Fabien R gravatar image

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"/>
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2013-03-28 02:45:49 -0500

Seen: 1,194 times

Last updated: Dec 04 '13