标题URDF模型文件进阶—xacro模型文件
一.两种模型文件对比
1代码精简
2提供可编程接口(常量,数学计算,宏定义,宏调用)
二.模型优化
1.urdf模型
<?xml version="1.0" ?>
<robot name="mbot">
<link name="base_link">
<visual>
<origin xyz=" 0 0 0" rpy="0 0 0" />
<geometry>
<box size="0.46 0.20 0.07"/>
</geometry>
<material name="black">
<color rgba="0 0 0 0.7"/>
</material>
</visual>
</link>
<joint name="left_front_wheel_joint" type="continuous">
<origin xyz="0.2 0.11 -0.015" rpy="0 0 0"/>
<parent link="base_link"/>
<child link="left_front_wheel_link"/>
<axis xyz="0 1 0"/>
</joint>
<link name="left_front_wheel_link">
<visual>
<origin xyz="0 0 0" rpy="1.5707 0 0" />
<geometry>
<cylinder radius="0.07" length = "0.02"/>
</geometry>
<material name="white">
<color rgba="255 255 255 0.7"/>
</material>
</visual>
</link>
<joint name="right_front_wheel_joint" type="continuous">
<origin xyz="0.2 -0.11 -0.015" rpy="0 0 0"/>
<parent link="base_link"/>
<child link="right_front_wheel_link"/>
<axis xyz="0 1 0"/>
</joint>
<link name="right_front_wheel_link">
<visual>
<origin xyz="0 0 0" rpy="1.5707 0 0" />
<geometry>
<cylinder radius="0.07" length = "0.02"/>
</geometry>
<material name="white">
<color rgba="255 255 255 0.7"/>
</material>
</visual>
</link>
<joint name="left_back_wheel_joint" type="continuous">
<origin xyz="-0.2 0.11 -0.015" rpy="0 0 0"/>
<parent link="base_link"/>
<child link="left_back_wheel_link"/>
<axis xyz="0 1 0"/>
</joint>
<link name="left_back_wheel_link">
<visual>
<origin xyz="0 0 0" rpy="1.5707 0 0" />
<geometry>
<cylinder radius="0.07" length = "0.02"/>
</geometry>
<material name="white">
<color rgba="255 255 255 0.7"/>
</material>
</visual>
</link>
<joint name="right_back_wheel_joint" type="continuous"