Adapting the URDF for Gazebo
We could try to spawn our robot directly into Gazebo, but it won’t work, as the URDF is missing two key elements—inertial and collision properties. Gazebo needs those to correctly simulate a robot.
Thus, before we do anything with Gazebo, we need to come back to our URDF and add those properties. For each link of the robot that represents a physical part, we will add an <inertial>
tag and a <collision>
tag. In this section, you will learn how to properly configure those.
We will modify the URDF we created in the my_robot_description
package. As a quick recap, this package contains the URDF, a launch file to display the robot model in RViz, and an RViz configuration. The most important thing in this package is the URDF. The launch file will help us validate that the values we set in the URDF are correct.
Let’s start with the inertial properties and then add the collision ones.
Inertial tags
A URDF without inertial...