Welcome to ROS Robot Expansion Board repository
6. Robot URDF Model
6、Robot URDF model
This lesson uses ROSMASTER-X3 as an example.
6.1、URDF Overview
Feature package reference path:~/driver_ws/src/yahboomcar_description
6.1.1、Introduction
URDF, the full name of Unified Robot Description Format, translated into Chinese as Unified Robot Description Format, is a robot model file described in xml format, similar to D-H parameters.
x <robot name="yahboomcar">
</robot>The first line is required for xml, which describes the version information of xml.
The second line describes the current robot name; all information about the current robot is contained in the [robot] tag.
6.1.2、Component
1)、link,The connecting rod, which can be imagined as a human arm。
2)、joint, which can be thought of as human elbows。
The relationship between link and joint: two links are connected by joints.
6.1.3、link
1)、Introduction
In the URDF descriptive language, links are used to describe physical properties.
- Describes the visual display, the
<visual>tag. - Describes collision properties, the
<collision>tag. - To describe physical inertia, the
<inertial>tag is not commonly used.
Links can also describe the link size (size)\color (color)\shape (shape)\inertial matrix (inertial matrix)\collision properties (collision properties), etc. Each Link will become a coordinate system.
2)、Sample Code:~/driver_ws/src/yahboomcar_description/urdf/yahboomcar_X3.urdf
xxxxxxxxxx <link name="front_left_wheel"> <inertial> <origin xyz="2.3728E-06 -9.4228E-07 0.00064068" rpy="0 0 0"/> <mass value="0.051543"/> <inertia ixx="1.4597E-05" ixy="-4.7945E-10" ixz="-2.4786E-10" iyy="1.4598E-05" iyz="1.7972E-09" izz="2.4267E-05"/> </inertial> <visual> <origin xyz="0 0 0" rpy="0 0 0"/> <geometry> <mesh filename="package://yahboomcar_description/meshes/mecanum/front_left_wheel.STL"/> </geometry> <material name=""> <color rgba="0.7 0.7 0.7 1"/> </material> </visual> <collision> <origin xyz="0 0 0" rpy="0 0 0"/> <geometry> <mesh filename="package://yahboomcar_description/meshes/mecanum/front_left_wheel.STL"/> </geometry> </collision> </link>3)、Introduction to labels
origin
It describes the pose information; the
xyzattribute describes the coordinate position in the large environment, and therpyattribute describes its own attitude.mess
Describes the quality of the link.
inertia
The inertial reference frame, due to the symmetry of the rotational inertia matrix, only needs 6 upper triangular elements ixx, ixy, ixz, iyy, iyz, izz as attributes.
geometry
The tag describes the shape; the main function of the
meshattribute is to load the texture file, and thefilenameattribute is the file address of the texture path. The label also includes other label descriptions:x
<box size="1 2 3"/> #The box box, through the size attribute describes the length, width and height of the box.<cylinder length="1.6" radius="0.5"/> #The cylinder is cylindrical, the height of the cylinder is described by the `length` property, and the radius of the cylinder is described by the `radius` property.<sphere radius="1"/> #sphere is spherical, and the radius of the sphere is described by the `radius` property.material
The tag describes the material; the
nameattribute is required, which can be empty or repeated. Red, green, blue, and transparency are described by thergbaattribute in the [color] tag, separated by spaces. The range of colors is [0-1].
6.1.4、joints
1)、Introduction
Describe the relationship between two joints, motion position and velocity limits, kinematic and dynamic properties.
Joint Type:
- fixed:Fixed joints. Movement is not allowed and acts as a connection.
- continuous:Rotate the joint. It can be rotated continuously, and there is no limit to the rotation angle.
- revolute:Rotate the joint. Similar to continuous, there is a limit to the rotation angle.
- prismatic:Sliding joints. Move along a certain axis, there is a position limit.
- floating:Suspended joints. With six degrees of freedom, 3T3R.
- planar:Planar joints. Allows translation or rotation above the plane orthogonal.
2)、Sample Code
xxxxxxxxxx<joint name="front_right_joint" type="continuous"> <origin xyz="0.08 -0.0845 -0.0389" rpy="-1.5703 0 3.14159"/> <parent link="base_link"/> <child link="front_right_wheel"/> <axis xyz="0 0 1" rpy="0 0 0"/> <limit effort="100" velocity="1"/> </joint>In the [joint] tag, the name attribute is required, describing the name of the joint, and it is unique.。
In the type attribute of the [joint] tag, fill in the six types of joints.
3)、Introduction to labels
origin
The child label refers to the relative position of the rotation joint in the coordinate system where the
parentis located.parent,child
The parent and child sub-labels represent two links to be connected; parent is the reference, and child rotates around the praent.
axis
The child label indicates which axis (xyz) the corresponding link of the child rotates around and the amount of rotation around the fixed axis.
limit
The child tag is mainly to limit the child. The
lowerproperty and theupperproperty limit the radian range of rotation, and theeffortproperty limits the force range during the rotation. (positive or negative value, in cattle or N), thevelocityproperty limits the speed of rotation, in m/s or m/s.mimic
Describes the relationship of this joint to existing joints.
safety_controller
Describe the safety controller parameters. Protect the movement of the robot joints.
6.2、URDF visualization
6.2.1、Run
xxxxxxxxxxcd ~/driver_ws/src/yahboomcar_description/launchroslaunch display.launch
6.2.2、Sample Image
The red axis is the X axis; the green axis is the Y axis; the blue axis is the Z axis; the coordinate system formed by the three axes is called the base coordinate system. Adjusting the [joint_state_publisher_gui] component can control the rotation of the wheel.
