Welcome to ROS Robot Expansion Board repository
6. URDF model
6、URDF model
1、Program Running Example
After successfully installing the Rosmaster library and compiling the workspace, we can enter the following command to start rviz to display the URDF model. Taking our company's Rosmaster-X3 McNum wheel as an example, terminal input,
ros2 launch yahboomcar_descriptio display_X3.launch.py

2、View TF Tree
Enter the command at the terminal,
xxxxxxxxxxros2 run tf2_tools view_frames.py
It will generate a frame.pdf file in the terminal directory, and then we will open and view it with the following command,
xxxxxxxxxxevince frames.pdf

3、Introduction to URDF
URDF, also known as Unified Robot Description Format, is a robot model file described in XML format, similar to D-H parameters.。
xxxxxxxxxx <robot name="yahboomcar"></robot>The first line is required for XML, which describes the version information of the XML.
The second line describes the current robot name; All information of the current robot is included in the robot tag。
3.1、Components
link,The connecting rod can be imagined as a human arm
joint,It can be imagined as a human elbow joint
The relationship between links and joints: Two links are connected through joints, imagining an arm with a forearm (link) and a forearm (link) connected through an elbow joint.。
3.1.1、link
1)、brief introduction
In URDF descriptive language, link is used to describe physical properties,
Describe visual display,
label Describe collision attributes,
label Describe physical inertia,
Tags are not commonly used
Links can also describe link size, color, shape, inertial matrix, collision properties, etc. Each link becomes a coordinate system.
2)、示例代码(yahboomcar_X3.urdf)
<link name="base_link"> <inertial> <origin xyz="0.00498197982182523 5.70233829969297E-05 -0.0121008098068578" rpy="0 0 0"/> <mass value="0.486218814966626"/> <inertia ixx="0.00196277727666921" ixy="2.50447049446755E-07" ixz="0.000140534767811098" iyy="0.00457256033711368" iyz="2.68618064993882E-07" izz="0.00493927269870476"/> </inertial> <visual> <origin xyz="0 0 0" rpy="0 0 0"/> <geometry> <mesh filename="package://yahboomcar_description/meshes/base_link_X3.STL"/> </geometry> <material name=""> <color rgba="0 0.7 0 1"/> </material> </visual> <collision> <origin xyz="0 0 0" rpy="0 0 0"/> <geometry> <mesh filename="package://yahboomcar_description/meshes/base_link_X3.STL"/> </geometry> </collision> </link>3)Label Introduction
origin
Describing pose information; The xyz attribute describes the coordinate position in the overall environment, while the rpy attribute describes one's own posture.
mess
Describe the quality of the link
inertia
Due to the symmetry of the rotational inertia matrix, the Inertial frame of reference only needs six upper triangular elements ixx, ixy, ixz, iyy, iyz, izz as attributes.
geometry
The label describes the shape; The main function of the mesh attribute is to load texture files, and the filename attribute is the file address of the texture path.
xxxxxxxxxx<box size="1 2 3"/> #Box box, describing the length, width, and height of the box through the size attribute.<cylinder length="1.6" radius="0.5"/> #The cylinder is cylindrical, with the 'length' attribute describing the height of the cylinder and the 'radius' attribute describing the radius of the cylinder.<sphere radius="1"/> #Spherical shape, describing the radius of the ball through the 'radius' attribute.material
The label describes the material; The name attribute is a required item and can be blank or duplicate. Describe red, green, blue, and transparency using the rgba attribute in the [color] tag, separated by a space. The range of colors is [0-1].
3.1.2、joints
1)、简介
Describe the relationship between two joints, motion position and speed limits, Kinematics and dynamics attributes.
joint type:
fixed:fix joints. No movement allowed, serving as a connection.
continuous:rotate the joint. It can rotate continuously without any restrictions on rotation angle.
revolute:rotate the joint. Similar to continuous, there is a limitation on the rotation angle.
prismatic:sliding joint. Moving along a certain axis with positional limitations.
floating:suspended joint. Equipped with six degrees of freedom, 3T3R.
planar:Plane joint. Allow translation or rotation above plane orthogonality
2)、sample code(yahboomcar_X3.urdf)
x
<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 a * * mandatory * *, which describes the name of the joint and is unique.
Fill in the type attribute in the [joint] tab, corresponding to the six major joint types.
3)、Label Introduction
origin
Sub labels refer to the relative position of the rotating joint in the coordinate system of the parent.
parent,child
The parent and child sub tags represent two links to be connected; The parent is the reference object, and the child rotates around the parent.
axis
The sub tag represents the axis (xyz) around which the link corresponding to the child rotates and the amount of rotation around a fixed axis.
limit
Sub tags mainly restrict child . The lower and upper attributes limit the range of rotation in radians, while the efort attribute limits the range of force applied during the rotation process. (Positive and negative value values, in Newton or N), the velocity attribute limits the speed during rotation, in meters/second or m/s.
mimic
Describe the relationship between this joint and existing joints.
safety_controller
Describe the safety controller parameters. Protect the movement of robot joints.