Add the remaining Inertial Tags for the wheel_link and the caster_wheel_link given the following specifications:
Mass of the wheel_link is 1.0 kg
Mass of the caster_wheel_link is 0.5 kg
Code in the common_properties.xacro file:
The code for the cylinder_inertia:
<xacro:macro name="cylinder_inertia" params="m h r xyz rpy">
<inertial>
<origin xyz="${xyz}" rpy="${rpy}" />
<mass value="${m}" />
<inertia ixx="${(m/12) * (h*h + 3*r*r)}" ixy="0" ixz="0"
iyy="${(m/12) * (h*h + 3*r*r)}" iyz="0"
izz="${0.5*m*r*r}" />
</inertial>
</xacro:macro>
The code for the sphere_inertia:
<xacro:macro name="sphere_inertia" params="m r xyz rpy">
<inertial>
<origin xyz="${xyz}" rpy="${rpy}" />
<mass value="${m}" />
<inertia ixx="${(2*m*r*r)/5}" ixy="0" ixz="0"
iyy="${(2*m*r*r)/5}" iyz="0"
izz="${(2*m*r*r)/5}" />
</inertial>
</xacro:macro>
Code in the mobile_base.xacro file:
The code for the wheel_link:
<xacro:macro name="wheel_link" params="prefix">
<link name="${prefix}_wheel_link">
<visual>
<geometry>
<cylinder radius="${wheel_radius}" length="${wheel_length}" />
</geometry>
<origin xyz="0 0 0" rpy="${pi / 2.0} 0 0" />
<material name="grey" />
</visual>
<xacro:cylinder_inertia m="0.5" h="${wheel_length}" r="${wheel_radius}"
xyz="0 0 0" rpy="${pi / 2.0} 0 0" />
</link>
</xacro:macro>
The code for the caster_wheel_link:
<link name="caster_wheel_link">
<visual>
<geometry>
<sphere radius="${wheel_radius / 2.0}" />
</geometry>
<origin xyz="0 0 0" rpy="0 0 0" />
<material name="grey" />
</visual>
<xacro:sphere_inertia m="1.0" r="${wheel_radius / 2.0}"
xyz="0 0 0" rpy="0 0 0" />
</link>