# 12 ROS1-MoveIt & Gazebo Simulation ## 12.1 **URDF Model Introduction V1.0** ### 12.1.1 URDF Model * **URDF Model Introduction** The Unified Robot Description Format (URDF) is an XML file format widely used in ROS (Robot Operating System) to comprehensively describe all components of a robot. Robots are typically composed of multiple links and joints. A link is defined as a rigid object with certain physical properties, while a joint connects two links and constrains their relative motion. By connecting links with joints and imposing motion restrictions, a kinematic model is formed. The URDF file specifies the relationships between joints and links, their inertial properties, geometric characteristics, and collision models. * **Comparison between Xacro and URDF Model** The URDF model serves as a description file for simple robot models, offering a clear and easily understandable structure. However, when it comes to describing complex robot structures, using URDF alone can result in lengthy and unclear descriptions. To address this limitation, the xacro model extends the capabilities of URDF while maintaining its core features. The xacro format provides a more advanced approach to describe robot structures. It greatly improves code reusability and helps avoid excessive description length. For instance, when describing the two legs of a humanoid robot, the URDF model would require separate descriptions for each leg. On the other hand, the xacro model allows for describing a single leg and reusing that description for the other leg, resulting in a more concise and efficient representation. * **Install URDF Dependencies** > [!NOTE] > > **Note: The URDF model and Xacro model are already installed in both the robot and the virtual machine. Users do not need to reinstall them. The information provided in this section is solely for comprehension purposes.** 1. Run the command ‘**sudo apt update**’, and hit Enter key to update the installation package info. ```py sudo apt update ``` 2. Execute the command ‘**sudo apt-get install ros-melodic-urdf**’, and hit Enter to install URDF dependency. ```py sudo apt-get install ros-melodic-urdf ``` When you receive the following messages, it means the dependencies are installed successfully. 3. Type the command ‘**sudo apt-get install ros-melodic-xacro**’, and hit Enter key to install URDF model extension format: Xacro. ```py sudo apt-get install ros-melodic-xacro ``` When you receive the following messages,the installation is successful. * **Basic Syntax of URDF Model** **1. XML Basic Syntax** The URDF model is written using XML standard. **Elements**: An element can be defined as desired using the following formula: **\** **\** **Properties**: Properties are included within elements to define characteristics and parameters. Please refer to the following formula to define an element with properties: **\** **\** **Comments**: Comments have no impact on the definition of other properties and elements. Please use the following formula to define a comment: **\