When the program starts, it will show the URDF model file of the vehicle in rviz, and there will also be a GUI debugging tool window, by sliding the progress bar, you can make the model file move.
Take the X3 model for example, after entering the docker container, the location of the source code of this function is located at.
xxxxxxxxxx
/root/yahboomcar_ros2_ws/yahboomcar_ws/src/yahboomcar_description/launch/display_R2.launch.py
where the path to the URDF model file is.
xxxxxxxxxx
/root/yahboomcar_ros2_ws/yahboomcar_ws/src/yahboomcar_description/urdf/yahboomcar_R2.urdf
After entering the docker container, depending on the actual model, the terminal input, the
xxxxxxxxxx
ros2 launch yahboomcar_description display_R2.launch.py
You can view the TF tree, docker terminal by typing.
xxxxxxxxxx
ros2 run tf2_tools view_frames.py
will generate a frame.pdf file in the terminal directory, and then we open the following command to view the
xxxxxxxxxx
evince frames.pdf
URDF, which is called Unified Robot Description Format, translated into Chinese as Unified Robot Descriptive Format, is a way to use the xml format to describe robot model files, similar to D-H parameters.
robot model file in xml format, similar to the D-H parameter.
xxxxxxxxxx
<robot name="yahboomcar">
</robot>
The first line is a mandatory xml field that describes the version information of the xml.
The second line describes the current robot name; all information about the current robot is contained in the [robot] tag.
The relationship between link and joint: two links are connected by a joint, imagine an arm with a small arm (link) and a big arm (link) connected by an elbow joint (joint).
1), Introduction
In the URDF descriptive language, link is used to describe the physical properties that
Links can also describe link size, color, shape, inertial matrix, collision properties, and so on.
Properties) and so on, each Link will become a coordinate system.
2), sample code (yahboomcar_R2.urdf)
xxxxxxxxxx
<link
name="base_link">
<inertial>
<origin
xyz="-0.014025 -0.00011707 0.082168"
rpy="0 0 0" />
<mass
value="0.52447" />
<inertia
ixx="0.00066245"
ixy="-3.1852E-08"
ixz="-4.6503E-05"
iyy="0.0012486"
iyz="-3.356E-08"
izz="0.0018052" />
</inertial>
<visual>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://yahboomcar_description/meshes/base_link.STL" />
</geometry>
<material
name="">
<color
rgba="0 0.62745 0.23529 1" />
</material>
</visual>
<collision>
<origin
xyz="0 0 0"
rpy="0 0 0" />
<geometry>
<mesh
filename="package://yahboomcar_description/meshes/base_link.STL" />
</geometry>
</collision>
</link>
3) Introduction of Tags
origin
describes the position information; the xyz attribute describes the position in the general environment, and the rpy attribute describes its own attitude.
mess
describes the quality of the link.
inertia
The inertia reference system, due to the symmetry of the rotational inertia matrix, requires only 6 upper triangular elements ixx, ixy, ixz, iyy, iyz, izz as attributes.
attributes.
geometry
tag describes the shape; the mesh attribute's main function is to load the texture file, the filename attribute is the file address of the texture path.
address of the texture path.
xxxxxxxxxx
<box size="1 2 3"/> #box箱体,通过size属性描述盒装的长宽高。#box box, describes the length, width and height of the box via the size attribute.
<cylinder length="1.6" radius="0.5"/> #cylinder圆柱状,通过`length`属性描述圆
柱的高度,`radius`属性描述圆柱的的半径。
#cylinder cylindrical, describes the length and height of the cylinder by the `length` attribute, and the radius of the cylinder by the `radius` attribute. The height of the cylinder is described by the `length` attribute, and the radius of the cylinder is described by the `radius` attribute.
<sphere radius="1"/> #sphere球状,通过`radius`属性描述球的半径。
#sphere sphere, describe the radius of the sphere by `radius` attribute.
material
tag describes the material; the name attribute is required, can be empty, can be repeated. The rgba attribute in the [color] tag describes the red, green, blue, and transparency attributes, separated by spaces. attribute in the [color] tag to describe red, green, blue, and transparency, separated by spaces. The range of the color is [0-1].
(1), Introduction
Describes the relationship between two joints, motion position and velocity constraints, kinematic and kinetic properties.
Joint type:
2), 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>
The name attribute in the [joint] tag is required and describes the name of the joint and is unique.
The type attribute in the [joint] tag corresponds to the six joint types.
3) Label introduction
origin
sub-label, refers to the relative position of the rotary joint in the coordinate system where the parent is located.
parent, child
The parent, child sub-label represents the two links to be connected; parent is the reference, child rotates around the praent.
axis
The child sub-label represents which axis (xyz) the corresponding link rotates around and the amount of rotation around the fixed axis.
limit
The sub-tags are mainly for limiting the child. The lower and upper attributes limit the radian range of the rotation, and the effort attribute limits the force applied during the rotation.
is the amount of force applied during the rotation. (positive and negative values in Nm or N), and the velocity attribute limits the speed of the rotation in meters per second or m/sec.
(positive or negative value in N or N), and velocity restricts the speed of the rotation in meters per second or m/s.
mimic
Describes the relationship of the joint to existing joints.
safety_controller
Describes the safety controller parameters. Protects the motion of the robot joints.