March 2018
Intermediate to advanced
1396 pages
42h 14m
English
One of the main features of xacro is that it supports macros. We can reduce the length complex definition using xacro to a great extent. Here is a xacro definition we used in our code for inertial:
<xacro:macro name="inertial_matrix" params="mass">
<inertial>
<mass value="${mass}" />
<inertia ixx="0.5" ixy="0.0" ixz="0.0"
iyy="0.5" iyz="0.0" izz="0.5" />
</inertial>
</xacro:macro>
Here, the macro is named inertial_matrix, and its parameter is mass. The mass parameter can be used inside the inertial definition using ${mass}. We can replace each inertial code with a single line as given here:
<xacro:inertial_matrix mass="1"/>
The xacro definition improved the code readability and reduced the number of lines ...