Robot Modeling and Simulation (1)-Unified Robot Description Format-URDF

Robot Modeling and Simulation (1)-Unified Robot Description Format-URDF

Overview

URDF (Unified Robot Description Format) is a very important robot model description format in ROS. ROS also provides a C++ parser for URDF files, which can parse robot models described in XML format in URDF files.
Before using the URDF file to build the robot model, it is necessary to understand the commonly used XML tags in the URDF file.

1. <link> tag

The <link> tag is used to describe the appearance and physical properties of a rigid body part of the robot, including size, color, shape, inertial matrix, collision properties, etc.
The link structure of the robot is generally as shown in the figure, and the basic URDF description syntax is as follows:Insert picture description here

<link name="my_link">
   <inertial>
     <origin xyz="0 0 0.5" rpy="0 0 0"/>
     <mass value="1"/>
     <inertia ixx="100"  ixy="0"  ixz="0" iyy="100" iyz="0" izz="100" />
   </inertial>

   <visual>
     <origin xyz="0 0 0" rpy="0 0 0" />
     <geometry>
       <box size="1 1 1" />
     </geometry>
     <material name="Cyan">
       <color rgba="0 1.0 1.0 1.0"/>
     </material>
   </visual>

   <collision>
     <origin xyz="0 0 0" rpy="0 0 0"/>
     <geometry>
       <cylinder radius="1" length="0.5"/>
     </geometry>
   </collision>
 </link>

Including 3 sub-tags
<inertial >: describe the inertial parameters of the link, mainly used in the calculation part of the robot dynamics;
<visual >: describe the appearance parameters of the robot link part, size, color, shape and other appearance information;
<collision >: Describe the collision properties of the
link ; there is another key part of the
link , that is, the coordinate system Link origin is the starting coordinate. When the entire link is created, it is created relative to the Link origin coordinate system;

2. <joint> tag

The <join> tag is used to connect two specific link parts; it describes the kinematics and dynamics properties of the robot joint, including the position and speed limit of the joint motion. According to the motion form of joints, it can be divided into six types.
Insert picture description here
Like human joints, the main function of robot joints is to connect two rigid body links, which are called parent link and child link, respectively, as shown in the figure.
The blue joint represents an axis of motion, and the blue joint can rotate around the blue axis, that is, the child link can rotate up and down around the joint.
The joint is to connect two links, which needs to be divided into a primary and secondary relationship. The primary joint is the parent link and the child joint is the child link. In the description in xml format, these two links must exist.
Insert picture description here
The description syntax of the <join> tag is as follows:

 <joint name="my_joint" type="floating">
    <origin xyz="0 0 1" rpy="0 0 3.1416"/>
    <parent link="link1"/>
    <child link="link2"/>

    <calibration rising="0.0"/>
    <dynamics damping="0.0" friction="0.0"/>
    <limit effort="30" velocity="1.0" lower="-2.2" upper="0.7" />
    <safety_controller k_velocity="10" k_position="15" soft_lower_limit="-2.0" soft_upper_limit="0.5" />
 </joint>

The parent link and child link of the joint must be specified, and other attributes of the joint can also be set. Subtags
:
<calibration>: the reference position of the joint, used to calibrate the absolute position of the joint;
<dynamics>: describe the physical properties of the joint, such as damping value, physical static friction, etc., which are often used in dynamic simulation;
<limit >: describe some limit values ​​of motion, including the upper and lower limit positions of joint motion, speed limit, torque limit, etc.;
<mimic>: describe the relationship between the joint and existing joints;
<safety_controller>: describe the safety controller parameters. Protect the movement of robot joints;

3. <robot> tag

<robot> is the topmost tag of the complete robot model. Both <link> and <joint> tags must be included in the <robot> tag. As shown in the figure, a complete robot model consists of a series of <link> and <joint >.
Insert picture description here

The name of the robot can be set in the <robot> tag, and its basic syntax is as follows:

<robot name="pr2">
  <link> ... </link>
  <link> ... </link>
  <link> ... </link>

  <joint>  ....  </joint>
  <joint>  ....  </joint>
  <joint>  ....  </joint>
</robot>

4. The <gazebo> tag

The <gazebo> tag is used to describe the parameters required for the simulation of the robot model in Gazebo, including the properties of the robot material, the gazebo plug-in, and so on. This tag is not a necessary part of the robot model, and only needs to be added during Gazebo simulation.
The basic syntax of the tag is as follows:

<gazebo reference="link_1">
    <material>Gz=azebo/Black</material>
</gazebo>

Guess you like

Origin blog.csdn.net/weixin_45661757/article/details/113201514