Welcome to ROSMASTER R2 repository
10.8 Robot URDF model
8 Robot URDF model
8 Robot URDF model 8.1 URDF overview 8.1.1 Introduction 8.1.2 Components 8.1.3 links 8.1.4 joints 8.2 URDF visualization
According to different models, you only need to set the purchased model in [.bashrc], X1(ordinary four-wheel drive) X3(Mike wheel) X3plus(Mike wheel mechanical arm) R2(Ackerman differential) and so on. Section takes X3 as an example:
xxxxxxxxxx#Raspberry Pi 5 master needs to enter docker first, please perform this step#If running the script into docker fails, please refer to ROS/07, Docker tutorial~/run_docker.shxxxxxxxxxxsudo vim .bashrc
Find the [ROBOT_TYPE] parameter and modify the corresponding model
xxxxxxxxxxexport ROBOT_TYPE=X3 # ROBOT_TYPE: X1 X3 X3plus R2 X78.1 URDF overview
Function package reference path: ~/yahboomcar_ws/src/yahboomcar_description
8.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 DH parameters.
xxxxxxxxxx < 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.
8.1.2 Components
1) link, connecting rod, can be imagined as a human arm.
2) joint, joint, can be imagined as a human elbow.
The relationship between link and joint: two links are connected by joints.
8.1.3 links
1 Introduction
In the URDF descriptive language, links are used to describe physical properties.
- describe the visual display,
<visual>Label. - describe collision properties,
<collision>Label. - describe physical inertia,
<inertial>Labels are 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: ~/yahboomcar_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 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) label introduction
origin
Describes the pose information;
xyzThe attribute describes the coordinate position in the environment,rpyAttributes describe their own posture.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 label describes the shape;
meshThe main function of the attribute is to load the texture file,filenameThe file address of the attribute texture path. The label also includes other label descriptions:xxxxxxxxxx<box size="1 2 3"/> #box box, describe the length, width and height of the box through the size attribute.<cylinder length="1.6" radius="0.5"/> #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` attribute.material
The label describes the material;
nameAttributes are required, can be empty, and can be repeated. Through the [color] tag inrgbaAttributes to describe red, green, blue, and transparency, separated by spaces. The range of colors is [0-1].
8.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: floating 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, which describes the name of the joint and is unique.
In the type attribute of the [joint] tag, fill in the corresponding six joint types.
3) label introduction
origin
subtab, referring to the rotation joint in
parentThe relative position of the coordinate system.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.
lowerproperties andupperThe property limits the radian range of rotation,effortThe property limits the force range during rotation. (positive and negative value, the unit is cattle or N)velocityThe property limits the speed at which it turns, in meters/second 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.
8.2 URDF visualization
8.2.1. Start
xxxxxxxxxxroslaunch yahboomcar_description display.launch
8.2.2. Sample pictures
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.
