ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

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}" />


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

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


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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


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

Seen: 529 times

Last updated: Mar 08 '15