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

Can I define a xacro with params by another xacro?

asked 2015-03-06 03:45:43 -0500

LucianTM gravatar image

updated 2015-03-06 03:46:15 -0500

Hi I am trying to define a xacro macro with another macro. But I am getting an error about one of the internal params from the macro. Is there an escape sequence or something for that?

Currently I get the error:

raise XacroException("Property wasn't defined: %s" % str(ex)) xacro.XacroException: Property wasn't defined: u'name'

<xacro:macro name="rr_mat_gaz_color_def" params="color material">
    <xacro:macro name="rr_mat_gaz_${color}" params="name material">
       <gazebo reference="${name}_link">
        <material value="${material}" />
       </gazebo>
    </xacro:macro>
</xacro:macro>

Thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-03-08 17:20:29 -0500

David Lu gravatar image

Fairly certain you have to define the macros sequentially and not recursively.

edit flag offensive delete link more

Comments

Me too, I just wanted to ask and see if I am right.

LucianTM gravatar image LucianTM  ( 2015-03-09 04:13:03 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-03-06 03:45:43 -0500

Seen: 548 times

Last updated: Mar 08 '15