上节是建立了urdf文件,现在把urdf文件改为xacro。
mcar.xacro文件:
<robot name="arm"><xacro:include filename="$(find mcar_description)/urdf/mcar_base.xacro"/><mcar_base/></robot>
mcar_base.xacro 文件:(把一维数据改为二维,reflect)
<?xml version="1.0"?><material name="blue">
<color rgba="0 0 0.8 1"/>
</material>
<material name="black">
<color rgba="0 0 0 0.95"/>
</material>
<material name="gray">
<color rgba="0.75 0.75 0.75 1"/>
</material>
<xacro:macro name="wheel" params="prefix reflect1 reflect2">
<joint name="${prefix}_wheel_joint" type="continuous">
<origin xyz="${reflect1*wheel_joint_x} ${reflect2*wheel_joint_y} ${-wheel_joint_z}" rpy="0 0 0"/>
<parent link="base_link"/>
<child link="${prefix}_wheel_link"/>
<axis xyz="0 1 0"/>
</joint>
&l