Creating our first URDF model
After learning about URDF and its important tags, we can start some basic modeling using URDF. The first robot mechanism that we are going to design is a pan-and-tilt mechanism, as shown in the following diagram.
There are three links and two joints in this mechanism. The base link is static, and all the other links are mounted onto it. The first joint can pan on its axis; the second link is mounted on the first link, and it can tilt on its axis. The two joints in this system are of the revolute type:
Let's take a look at the URDF code of this mechanism. Navigate to the mastering_ros_robot_description_pkg/urdf
directory and open pan_tilt.urdf
.
We will start by defining the base link of the root model:
<?xml version="1.0"?> <robot name="pan_tilt"> <link name="base_link"> ...