To visualize the robot in Gazebo, we need to add <collision> tags, along with the <visual> tags we defined in the <link> tag, like we did previously. Hence, just specify the necessary visual and inertial tags on the links:
- For the arm_base link, add the following:
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh filename="package://robot_description/meshes/arm_base.stl" />
</geometry>
</collision>
<inertial>
<origin
xyz="7.7128E-09 -0.063005 -3.01969999961422E-08"
rpy="0 0 0" />
<mass
value="1.6004" />
<inertia
ixx="0.00552196561445819"
ixy="7.9550614501301E-10"
ixz="-1.34378458924839E-09"
iyy="0.00352397447953875"
iyz="-1.10071809773382E-08"
izz="0.00553739792746489" />
</inertial>
- For the other links, please have a look at the code for robot_arm.urdf.xacro at https://github.com/PacktPublishing/ROS-Robotics-Projects-SecondEdition/blob/master/chapter_3_ws/src/robot_description/urdf/robot_arm.urdf.xacro.
Now that the Gazebo properties have been created, let's create the mechanisms.