After the program starts, the URDF model file of the model will be displayed in rviz and there will be a GUI debugging tool window, which can be moved by sliding the progress bar.
Taking the X3 model as an example, after entering the docker container, the location of the source code of this function is located at.
/root/yahboomcar_ros2_ws/yahboomcar_ws/src/yahboomcar_description/launch/display_X3.launch.py
where the path to the URDF model file is,
xxxxxxxxxx
/root/yahboomcar_ros2_ws/yahboomcar_ws/src/yahboomcar_description/urdf/yahboomcar_X3.urdf
After entering the docker container, according to the actual model, the terminal input,
xxxxxxxxxx
ros2 launch yahboomcar_description display_X3.launch.py
You can view TF tree, docker terminal input,
xxxxxxxxxx
ros2 run tf2_tools view_frames.py
A frame.pdf file will be generated in the terminal directory, and then we will open it with the following command,
xxxxxxxxxx
evince frames.pdf
URDF, full name Unified Robot Description Format, translated as Chinese Unified Robot Descriptive Format, is a kind of make
A robot model file described in xml format, similar to the D-H parameters.
xxxxxxxxxx
<robot name="yahboomcar">
</robot>
The first line is required for XML and describes the version information of XML.
The second line describes the current bot name; All information about the current robot is included in the [robot] tag.
Link, a connecting rod, can be imagined as a human arm
joint, joint, can be imagined as the joint of a person's elbow
The relationship between link and joint: The two links are connected by joints, imagine that the arm has a small arm (link) and a large arm (link) connected by the elbow (joint).
Introduction
In the URDF descriptive language, link is used to describe physical properties.
Describe visual displays,
Describe collision properties,
Describe physical inertia,
Links can also describe connecting rod size color shape inertial matrix collision parameters
properties), etc., each link will become a coordinate system.
Sample code (yahboomcar_X3.urdf)
xxxxxxxxxx
<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>
Label introduction
origin
Describes pose information; The xyz attribute describes the coordinate position in the larger environment, and the rpy attribute describes its own posture.
mess
Describes the quality of Link.
inertia
The inertial reference frame, due to the symmetry of the rotational inertia matrix, only 6 upper triangular elements ixx, ixy, ixz, iyy, iyz, izz are required as genera
Sex.
geometry
Labels describe shapes; The main function of the mesh attribute is to load texture files, and the filename attribute texture path file is file
Address.
x
<box size="1 2 3"/> #Box box, through the size attribute to describe the length, width and height of the box.
<cylinder length="1.6" radius="0.5"/> #Cylinder cylindrical, described by the 'length' property
The height of the column, the 'radius' property describes the radius of the cylinder.
<sphere radius="1"/> #Sphere spherical, which describes the radius of the ball through the 'radius' attribute.
material
The label describes the material; The name attribute is required, can be empty, can be repeated. Via the RGBA genus in the [color] tag
Sex describes red, green, blue, transparency, separated by spaces. The range of colors is [0-1].
Introduction
Describe the relationship between two joints, position of movement and speed limit, kinematic and kinetic properties.
Joint Type:
fixed: fix the joint. Movement is not allowed, which plays the role of connection.
continuous: rotate the joint. It can be rotated continuously without limitation of rotation angle.
Revolute: Rotate joints. Similar to continuous, there is a limitation of rotation angle.
Prismatic: sliding joints. Move along an axis with position restrictions.
Floating: Suspension joints. With six degrees of freedom, 3T3R.
Planar: Planar joints. Allows translation or rotation above plane orthogonal.
Sample code (yahboomcar_X3.urdf)
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 tab, the name attribute is required, describes the name of the joint, and is unique.
In the [joint] tab, fill in the type attribute, corresponding to the six joint types.
Label introduction
origin
A subtag that refers to the relative position of the rotating joint in the coordinate system of the parent.
parent,child
parent, the child subtag represents the two links to be connected; Parent is the reference object, and Child revolves around Praent.
axis
The sublabels indicate which axis (xyz) the corresponding link of Child rotates around and the amount of rotation around a fixed axis.
limit
Subtags are primarily restrictive for child. The lower property and the upper property limit the range of radians of rotation, and the effort property restricts it
It is the range of force during rotation. (plus or minus value, in Ox or N), the velocity property limits the speed at turning,
The unit is meters per second or m/s.
mimic
Describe the relationship of the joint to an existing joint.
safety_controller
Describes the safety controller parameters. Protect the movement of the robot's joints.