Welcome to ROSMASTER X3 repository
21.ROS2 URDF model
21. ROS2 URDF Model
1. Introduction to URDF
The modeling method in ROS is called URDF, which stands for Unified Robot Description Format. It not only clearly describes the robot model itself, but also describes the robot's external environment. URDF model files use the XML format.
SolidWorks model to URDF plugin: sw_urdf_exporter - ROS Wiki
2. Robot Components
When modeling and describing a robot, we first need to be familiar with the robot's components and parameters. For example, a robot is generally composed of four major components: hardware structure, drive system, sensor system, and control system. Common robots on the market, whether mobile robots or robotic arms, can be broken down into these four components.

- The hardware structure refers to the tangible components, such as the chassis, housing, and motors.
- The drive system is the equipment that enables these components to function properly, such as the motor driver and power management system.
- The sensor system includes encoders on the motor, an onboard IMU, installed cameras, radar, and more, enabling the robot to sense its own state and external environment.
- The control system is the primary vehicle for our development process, typically a computing platform like a Raspberry Pi or a computer, along with its operating system and application software.
The robot modeling process follows a similar approach, using a modeling language to clearly describe each component of the robot and then assemble them.
3. URDF Syntax
3.1. Link Description
The tag is used to describe the appearance and physical properties of a robot's rigid body. Appearance includes size, color, and shape, while physical properties include mass, inertia matrix, collision parameters, and so on.

Taking this robotic arm link as an example, its link description is as follows:

The name in the link tag represents the name of the link. We can customize it, and this name will be used when connecting joints to links in the future.
The
represents the geometric shape. is used to call a pre-designed blue appearance in 3D software. This is the STL file, which looks identical to the real robot. represents the offset of the coordinate system relative to the initial position, including translation in the x, y, and z directions, and roll, pitch, and raw rotations. If no offset is required, all values are 0.
The second section,
f