Ask Your Question

Revision history [back]

The following for your macro works on my system:

  <xacro:macro name="cuboid_inertial" params="mass length width height">
    <inertial>
      <mass value="${mass}"/>
      <inertia 
                ixx="${0.83*mass*(width+height)}" 
                ixy="0.0" 
                ixz="0.0" 
                iyy="${0.83*mass*(length+height)}" 
                iyz="0.0" 
                izz="${0.83*mass*(width+length)}" />
    </inertial>
  </xacro:macro>

Notice that I've changed the location of the ${} sets in your calculations.

The following for your macro works on my system:

  <xacro:macro name="cuboid_inertial" params="mass length width height">
    <inertial>
      <mass value="${mass}"/>
      <inertia 
                ixx="${0.83*mass*(width+height)}" 
                ixy="0.0" 
                ixz="0.0" 
                iyy="${0.83*mass*(length+height)}" 
                iyz="0.0" 
                izz="${0.83*mass*(width+length)}" />
    </inertial>
  </xacro:macro>

I also changed the property block:

<xacro:property name="base_link_length" value="0.50"/>
<xacro:property name="base_link_width" value="0.30"/>
<xacro:property name="base_link_height" value="0.35"/>
<xacro:property name="base_link_length_sqrd" value="${base_link_length*base_link_length}"/>
<xacro:property name="base_link_width_sqrd" value="${base_link_width*base_link_width}"/>
<xacro:property name="base_link_height_sqrd" value="${base_link_height*base_link_height}"/>

Notice that I've changed the location of the ${} sets in your calculations.