URDF tags and plugins for Gazebo simulation

We have seen the simulated robot in Gazebo. Now, we will look in more detail at the simulation-related tags in URDF and the various plugins we have included in the URDF model.

Most of the Gazebo-specific tags are in the chefbot_description/gazebo/chefbot.gazebo.xacro file. Also, some of the tags in chefbot_description/urdf/chefbot.xacro are used in the simulation. Defining the <collision> and <inertial> tags in chefbot.xacro is very important for our simulation. The <collision> tag in URDF defines a boundary around the robot link, which is mainly used to detect the collision of that particular link, whereas the <inertial> tag encompasses the mass of the link and the moment of inertia. Here is an example of the <inertial> tag definition:

      <inertial> 
        <mass value="0.564" /> 
        <origin xyz="0 0 0" /> 
        <inertia ixx="0.003881243" ixy="0.0" ixz="0.0" 
                 iyy="0.000498940" iyz="0.0" 
                 izz="0.003879257" /> 
      </inertial> 

These parameters are part of the robot's dynamics, so in the simulation these values will have an effect on the robot model. Also, in the simulation, it will process all the links and joints, as well as its properties.

Next, we will look at the tags inside the gazebo/chefbot.gazebo.xacro file. The important Gazebo-specific tag we are using is <gazebo>, which is used to define the simulation properties of an element in the robot. We can either define a property that is applicable to all the links or one that is specific to a link. Here is a code snippet inside the xacro file that defines the coefficient of the friction of a link:

     <gazebo reference="chefbot_wheel_left_link"> 
       <mu1>1.0</mu1> 
       <mu2>1.0</mu2> 
       <kp>1000000.0</kp> 
       <kd>100.0</kd> 
       <minDepth>0.001</minDepth> 
       <maxVel>1.0</maxVel> 
 
     </gazebo>  

The reference property is used to specify a link in the robot. So, the preceding properties will only be applicable to the chefbot_wheel_left_link.

The following code snippet shows you how to set the color of a robot link. We can create custom colors, define the custom colors, or use the default colors in Gazebo. You can see that for the base_link, we are using the Gazebo/White color from Gazebo's default property:

   <material name="blue"> 
       <color rgba="0 0 0.8 1"/> 
   </material> 
 
   <gazebo reference="base_link"> 
     <material>Gazebo/White</material> 
   </gazebo> 
Refer to http://gazebosim.org/tutorials/?tut=ros_urdf to see all the tags that are used in the simulation.

That covers the main tags of the simulation. Now we will look at the Gazebo-ROS plugins that we have used in this simulation.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.136.154.103