Skip to content

URDF to XACRO

I. Project Overview

1.1 Project Background and Objectives

1.1.1 Project Background

  1. Development needs

    • With the rapid advancement of robotics technology, featuring with the increasing application of industrial and mobile robots, there is a growing needs for efficient, flexible and scalable methodologies to design and develop robot models.

    • In the process of robotics development, URDF (Unified Robot Description Format) is a standard format served as describe robot models in ROS (Robot Operating System), yet it offers limited reusability and maintainability.

  2. Xacro's advantages:

    • Xacro (XML Macros) is a tool used in ROS to generate URDF. Through macro definition and attribute encapsulation, it can significantly simplify the complexity of URDF files, improving the reusability and maintainability of code.
    • Through Xacro, complex robot models can be split into multiple modular files for easy management and maintenance. In addition, parametric configuration is supported to facilitate the rapid development of different types of robots.
  3. Application scenarios:

    • The RealMan composite lifting robot mentioned in this case is a multifunctional robot that integrates chassis, mechanical arm, lifting platform and gripper. It can be applied to various scenarios, including logistics, warehousing, automated production.
    • This type of robot requires simulation and control within the ROS framework, thus necessitating an efficient and flexible URDF model to support its development and testing.

1.1.2 Project Objectives

  • Modularity: Through modular design, independent development and testing of different components can be achieved, while supporting rapid assembly and configuration.
  • Parameterization: With Xacro's macro definition function, repeated code segments are encapsulated into reusable templates reducing redundant code and improving development efficiency.
  • Highly scalable: The development threshold is lowered with documentation and sample code, facilitating the promotion and applications of robotics technology.

1.1.3 Summary

The project aims to achieve efficient development and management of URDF models for the ReakMan compound lifting robot through Xacro technology, while supporting simulation and control within the ROS framework. Its primary goal is to improve the efficiency, flexibility and maintainability of robot development, providing technical support for robot applications in industrial and logistics scenarios.

1.2 Core Functions

1.2.1 Modular Design

  1. The robot is divided into independent modules such as chassis, mechanical arm, lifting platform and gripper. Each module has an independent Xacro file for easy management and maintenance.

  2. Independent development and testing are available to facilitate subsequent assembly and configuration.

1.2.2 Parameterized Configuration

  1. Parameterized design of robot models is enabled with Xacro's macro definition.

  2. Reduced duplicate code enables rapid development and adjustment across different robot models, such as the RM65-B and RM75-B.

1.2.3 Simulation and Control Support

  1. The Gazebo simulation environment is configured to ensure the proper operation of the robot model within the simulation .

  2. The robot supports control plug-in integration and provides a comparative simulation and complete control pipeline, including RVIZ visualization and Gazebo simulation testing, to validate the correctness and functional integrity of the robot model.

1.2.4 Efficient Development and Maintenance

  1. The robot improves the reusability and maintainability of code and lower the development threshold.

  2. We will provide detailed tutorials and documentation to help developers quickly get up to speed with Xacro and master the robot model development workflow.

1.3 Update Log

Update dateUpdate contentVersion No.
2025/02/17The initial version of the composite lifting robot URDF model splicing project was releasedv1.0.0

II. Software Environment

  • System Version
    • Ubuntu version: 20.04
    • System architecture: X86/ARM64
  • Software version
    • ROS: neotic

III. Preparation Stage

3.1 Acquisition of Package

Please refer to Appendix-Related Resource Acquisition to obtain the corresponding function package, and refer to the following description for integration and expansion. This paper takes the RM75-B as a case study for integration and expansion. The methodologies presented can also serve as a reference for implementing similar assembly and expansion with other types of robotic arms.
Currently, only the corresponding packages for RM65-B and RM75-B robotic arms are provided. For other types of robotic arms, please contact technical support to obtain them.

3.2 Package Structure

This document is mainly based on the ROS1 framework, taking the RealMan composite lifting robot as an example for explanation. The final project space directory structure is as follows:

shell
rm_Lifting_robot_75B_jaw_description                                # 75B robot description function package
├── CMakeLists.txt
├── config
│   └── joint_names_75_body_single_arm_Lifting_description.yaml
├── export.log
├── launch
│   ├── display.launch                                              # Launch rviz to display the robot model
│   └── gazebo.launch                                               # Launch gazebo simulation
├── meshes                                                          # Model files
│   ├── 4C2_baselink.STL
│   ├── 4C2_Link1.STL
│   ├── 4C2_Link2.STL
│   ├── 4C2_Link3.STL
│   ├── 4C2_Link4.STL
│   ├── 4C2_Link5.STL
│   ├── 4C2_Link6.STL
│   ├── arm_base_link1.STL
│   ├── arm_base_link.STL
│   ├── base_link.STL
│   ├── body_base_link1.STL
│   ├── body_base_link.STL
│   ├── l_wheel_link.STL
│   ├── medium_wheel_link2.STL
│   ├── min_wheel_link1.STL
│   ├── platform_link.STL
│   ├── r_link1.STL
│   ├── r_link2.STL
│   ├── r_link3.STL
│   ├── r_link4.STL
│   ├── r_link5.STL
│   ├── r_link6.STL
│   ├── r_link7.STL
│   ├── r_wheel_link.STL
│   ├── swivel_wheel_link1_1.STL
│   ├── swivel_wheel_link1_2.STL
│   ├── swivel_wheel_link2_1.STL
│   ├── swivel_wheel_link2_2.STL
│   ├── swivel_wheel_link3_1.STL
│   ├── swivel_wheel_link3_2.STL
│   ├── swivel_wheel_link4_1.STL
│   └── swivel_wheel_link4_2.STL
├── package.xml
└── urdf
    ├── agv.urdf.xacro                                           # Chassis URDF
    ├── common_gazebo.xacro                                      # Gazebo simulation control plugin
    ├── jaw_transmission.xacro                                   # Gripper transmission configuration
    ├── jaw.urdf.xacro                                           # Gripper URDF
    ├── joint.urdf.xacro                                         # URDF description of joints between different modules
    ├── platform.urdf.xacro                                      # URDF description of lifting platform
    ├── rm75_transmission.xacro                                  # RM75 robotic arm transmission configuration
    ├── rm75.urdf.xacro                                          # RM75 robotic arm URDF description
    ├── rm_Lifting_robot_75B_jaw_description.csv
    ├── rm_Lifting_robot_75B_jaw_description.urdf
    └── rm_Lifting_robot_75B_jaw_description.urdf.xacro          # Integrate the Xacro files of each module into a complete URDF file

Take the RM75-B robot description function package as an example:

  • In the urdf folder, we split the robot model into four independent Xacro ( agv.urdf.xacro, jaw.urdf.xacro, platform.urdf.xacro, rm75.urdf.xacro) files for chassis, robotic arm, lifting platform and gripper for easy management and configuration.
  • The four modules of chassis, robotic arm, lifting platform and gripper are integrated into a complete model in the main Xacro file (rm_Lifting_robot_75B_jaw_description.urdf.xacro).
  • Simulation plug-ins are configured in file common_gazebo.xacro for Gazebo simulation, such as plug-ins that control robot movement libgazebo_ros_control.so, to ensure that the robot can receive commands and complete corresponding actions in Gazebo.
  • Configuration transmission is introduced in each module to define the kinematic relationship between robot joints and controllers. It ensures that the controller plug-in in Gazebo can correctly calculate the input/output data of the joint, provide more accurate motion control, and simulate the actual robot drive structure.

IV. Code Interface Specification​

4.1 Xacro File Syntax Explanation

Taking agv.urdf.xacro as an example, the syntax of a complete Xacro file is as follows:

xml
<?xml version="1.0" encoding="utf-8"?>
<robot name="agv" xmlns:xacro="http://www.ros.org/wiki/xacro">
  <!-- Define constants -->
  <xacro:property name="mesh_path"                                 value="package://rm_Lifting_robot_75B_jaw_description/meshes/" />           <!-- Define property -->
  <!-- Macro to define a generic link with mass, inertia, and visual -->
  <xacro:macro name="visual_collision" params="mesh">                       <!-- Define macro -->
      <visual>
         <origin xyz="0 0 0" rpy="0 0 0" />
         <geometry>
              <mesh filename="${mesh_path}${mesh}" />
         </geometry>
         <material name="">
             <color rgba="1 1 1 1" />
         </material>
      </visual>
      <collision>
         <origin xyz="0 0 0" rpy="0 0 0" />
         <geometry>
             <mesh filename="${mesh_path}${mesh}" />
         </geometry>
       </collision>
  </xacro:macro> 
  <link name="base_link">
     <inertial>
         <origin xyz="-0.00022588 -0.029317 0.067118" rpy="0 0 0" />
         <mass value="3.652" />
         <inertia ixx="0.040658" ixy="-4.1019E-05" ixz="0.00010805"
          iyy="0.085621" iyz="-0.00031013" izz="0.10712" />
     </inertial>
     <xacro:visual_collision mesh="base_link.STL" />                          <!-- Call macro -->
  </link>
  ...
  <joint name="r_wheel_joint_1" type="continuous">
    <origin xyz="-0.151 0 -0.0109" rpy="0 0 0" />
    <parent link="base_link" />
    <child link="r_wheel_link" />
    <axis xyz="1 0 0" />
    <limit effort="100" velocity="10" />
  </joint>
  ...
</robot>

4.1.1 Header File

xml
<?xml version="1.0" encoding="utf-8"?>
<robot name="agv" xmlns:xacro="http://www.ros.org/wiki/xacro">

Function definition:

  • <?xml version="1.0" encoding="utf-8"?>: Declare the version and encoding method of the XML file.

  • <robot>: The root element of the robot description file defined by ROS. The name attribute indicates the name of the robot and can be customized according to specific situation.

  • When generating urdf through xacro, the root tag robotmust include. xmlns:xacro="http://www.ros.org/wiki/xacro.

4.1.2 Attribute Definition

xml
<!-- Define constants -->
<xacro:property name="mesh_path"           value="package://rm_Lifting_robot_75B_jaw_description/meshes/" />

Function definition:

  • It uses <xacro:property> tag to define attributes, specifies the name of the attribute name, and specify the value of the defined attribute value.

  • It is used to encapsulate some parameters in URDF, such as PI value, size, color, model path, etc., which is convenient to debug and modify parameters.

  • Attribute call: {attribute name}, such as {mesh_path}.

4.1.3 Macro Definition

In URDF files, by encapsulating code segments with high repetition rates into macros (macro), you can significantly improve code reusability and optimize the overall code structure.

xml
 <!-- Macro to define a generic link with mass, inertia, and visual -->
  # Define macro name and parameters (separate multiple parameters with spaces)
  <xacro:macro name="visual_collision" params="mesh"> 
      <visual>
         <origin xyz="0 0 0" rpy="0 0 0" />
         <geometry>
            <mesh filename="${mesh_path}${mesh}" />   
         </geometry>
         <material name="">
            <color rgba="1 1 1 1" />
         </material>
      </visual>
      <collision>
         <origin xyz="0 0 0" rpy="0 0 0" />
         <geometry>
             <mesh filename="${mesh_path}${mesh}" />
         </geometry>
       </collision>
  </xacro:macro>

Function definition:

  • It deploys <xacro:macro> tag to define macro, name attribute to specify macro names, and params define macro parameters. When there are multiple parameters, the parameters are separated by spaces, that is <xacro:macro name="visual_collision" params="mesh color">.

  • Parameter call format: {parameter name}. Taking the above code as an example, the parameter call is {mesh}.

  • Macro call: <xacro:macro name parameter1="xxx" parameter2="xxx" /> For example, to call visual_collision macro and pass in parameter mesh , you can write it like <xacro:visual_collision mesh="base_link.STL" />.

4.1.4 Document Content

The robot consists of multiple modules. Different components may be encapsulated into separate Xacro files, and finally different files are integrated to form a complete robot. File inclusion can be used for implementation. The specific implementation code is as follows:

xml
<?xml version="1.0"?>
<robot name="rm_Lifting_robot_75B_jaw_description" xmlns:xacro="http://www.ros.org/wiki/xacro">
  <!-- Import other xacro files: chassis, gripper, lifting platform, robotic arm and joints -->
  <xacro:include filename="$(find rm_Lifting_robot_75B_jaw_description)/urdf/agv.urdf.xacro"/>
  <xacro:include filename="$(find rm_Lifting_robot_75B_jaw_description)/urdf/jaw.urdf.xacro"/>
  <xacro:include filename="$(find rm_Lifting_robot_75B_jaw_description)/urdf/platform.urdf.xacro"/>
  <xacro:include filename="$(find rm_Lifting_robot_75B_jaw_description)/urdf/rm75.urdf.xacro"/>
  <xacro:include filename="$(find rm_Lifting_robot_75B_jaw_description)/urdf/joint.urdf.xacro"/>
  <!-- Add control transmission configuration and Gazebo-specific plugins in the Gazebo simulation environment -->
  <xacro:include filename="$(find rm_Lifting_robot_75B_jaw_description)/urdf/common_gazebo.xacro"/>
  <xacro:include filename="$(find rm_Lifting_robot_75B_jaw_description)/urdf/rm75_transmission.xacro"/>
  <xacro:include filename="$(find rm_Lifting_robot_75B_jaw_description)/urdf/jaw_transmission.xacro"/>
</robot>

4.2 Xacro File for Transmission Configuration

4.2.1 Transmission Profile of Gripper

xml
<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">
  <xacro:macro name="rm75_jaw_transmission" params="joint_name">
    <transmission name="${joint_name}_trans">
      <type>transmission_interface/SimpleTransmission</type>
      <joint name="${joint_name}">
        <hardwareInterface>PositionJointInterface</hardwareInterface>
      </joint>
      <actuator name="${joint_name}_motor">
        <mechanicalReduction>1</mechanicalReduction>
      </actuator>
    </transmission>
  </xacro:macro>

  <xacro:rm75_jaw_transmission joint_name="jaw_Joint1" />
  <xacro:rm75_jaw_transmission joint_name="jaw_Joint2" />
  <xacro:rm75_jaw_transmission joint_name="jaw_Joint3" />
  <xacro:rm75_jaw_transmission joint_name="jaw_Joint4" />
  <xacro:rm75_jaw_transmission joint_name="jaw_Joint5" />
  <xacro:rm75_jaw_transmission joint_name="jaw_Joint6" />
</robot>

4.2.2 Transmission Configuration File of the Robotic Arm

xml
<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">
  <xacro:macro name="rm75_transmission" params="joint_name">
    <transmission name="${joint_name}_trans">
      <type>transmission_interface/SimpleTransmission</type>
      <joint name="${joint_name}">
        <hardwareInterface>PositionJointInterface</hardwareInterface>
      </joint>
      <actuator name="${joint_name}_motor">
        <mechanicalReduction>1</mechanicalReduction>
      </actuator>
    </transmission>
  </xacro:macro>
  <xacro:rm75_transmission joint_name="joint1" />
  <xacro:rm75_transmission joint_name="joint2" />
  <xacro:rm75_transmission joint_name="joint3" />
  <xacro:rm75_transmission joint_name="joint4" />
  <xacro:rm75_transmission joint_name="joint5" />
  <xacro:rm75_transmission joint_name="joint6" />
  <xacro:rm75_transmission joint_name="joint7" />
  <xacro:rm75_transmission joint_name="platform_joint" />
</robot>

4.3 Gazebo Simulation Control Plug-in Xacro File

xml
<?xml version="1.0" ?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">
  <gazebo>
    <plugin name="control" filename="libgazebo_ros_control.so">
      <robotNamespace>/</robotNamespace>
      <robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType>
      <legacyModeNS>true</legacyModeNS>
    </plugin>
  </gazebo>
</robot>

4.4 Dismantle the URDF File into Xacro files

Taking the creation of a file rm75.urdf.xacro as an example, here are the detailed steps to convert a URDF file to a Xacro file.

4.4.1 Copying URDF Content

Copy the relevant parts of the robotic arm rm_Lifting_robot_75B_jaw_description.urdf to a new file and name it as rm75.urdf.xacro.

xml
<!-- RM75-B Robotic Arm --> 
  <link
    name="r_link1">
    <inertial>
      <origin
        xyz="2.8966E-07 0.025188 -0.021107"
        rpy="0 0 0" />
      <mass
        value="0.59353" />
      <inertia
        ixx="0.0012661"
        ixy="-2.0397E-09"
        ixz="-5.3423E-09"
        iyy="0.00056131"
        iyz="-0.00021118"
        izz="0.0011816" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://rm_Lifting_robot_75B_jaw_description/meshes/r_link1.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0.79216 0.81961 0.93333 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://rm_Lifting_robot_75B_jaw_description/meshes/r_link1.STL" />
      </geometry>
    </collision>
  </link>
  <joint
    name="joint1"
    type="revolute">
    <origin
      xyz="0 0 0.2405"
      rpy="-1.5708 0 3.1416" />
    <parent
      link="arm_base_link1" />
    <child
      link="r_link1" />
    <axis
      xyz="0 -1 0" />
    <limit
      lower="-3.11"
      upper="3.11"
      effort="60"
      velocity="3.14" />
  </joint>
  <link
    name="r_link2">
    <inertial>
      <origin
        xyz="3.7069E-07 0.011077 0.07613"
        rpy="0 0 0" />
      <mass
        value="0.43285" />
      <inertia
        ixx="0.0012584"
        ixy="7.782E-10"
        ixz="3.39E-09"
        iyy="0.0012224"
        iyz="0.00027899"
        izz="0.00031747" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://rm_Lifting_robot_75B_jaw_description/meshes/r_link2.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0.79216 0.81961 0.93333 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://rm_Lifting_robot_75B_jaw_description/meshes/r_link2.STL" />
      </geometry>
    </collision>
  </link>
  <joint
    name="joint2"
    type="revolute">
    <origin
      xyz="0 0 0"
      rpy="1.5708 0 0" />
    <parent
      link="r_link1" />
    <child
      link="r_link2" />
    <axis
      xyz="0 1 0" />
    <limit
      lower="-2.27"
      upper="2.27"
      effort="60"
      velocity="3.14" />
  </joint>
  ...
  <link
    name="r_link7">
    <inertial>
      <origin
        xyz="-0.028764 5.1464E-06 0.023085"
        rpy="0 0 0" />
      <mass
        value="0.22147" />
      <inertia
        ixx="0.0001376"
        ixy="-5.7488E-08"
        ixz="1.6634E-05"
        iyy="0.00026855"
        iyz="-1.7799E-08"
        izz="0.00035277" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://rm_Lifting_robot_75B_jaw_description/meshes/r_link7.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0.79216 0.81961 0.93333 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://rm_Lifting_robot_75B_jaw_description/meshes/r_link7.STL" />
      </geometry>
    </collision>
  </link>
  <joint
    name="joint7"
    type="revolute">
    <origin
      xyz="0 -0.00028182 0.117"
      rpy="-0.00015298 0 0" />
    <parent
      link="r_link6" />
    <child
      link="r_link7" />
    <axis
      xyz="0 0 1" />
    <limit
      lower="-6.28"
      upper="6.28"
      effort="10"
      velocity="3.925" />
  </joint>

4.4.2 Analysis of Disassembly Process

  1. Add a Xacro-specific header file at the top of the newly created file rm75.urdf.xacro.

    xml
    <?xml version="1.0"?>
    <robot name="rm75" xmlns:xacro="http://www.ros.org/wiki/xacro">  <!--Define the robot name as rm75-->
  2. Define attributes (usually including size, color, model path, PI value, etc.).

    xml
    <!-- Define constants -->
    <xacro:property name="mesh_path" value="package://rm_Lifting_robot_75B_jaw_description/meshes/" />
  3. Take a close look at the URDF model code and find the code segments with high repetition rates.

    xml
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://rm_Lifting_robot_75B_jaw_description/meshes/r_link4.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0.79216 0.81961 0.93333 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://rm_Lifting_robot_75B_jaw_description/meshes/r_link4.STL" />
      </geometry>
    </collision>
  4. Convert the identified duplicate code segments into Xacro macros. Xacro macros allow you to define reusable templates that can be called multiple times in a file to reduce duplicate code and improve maintainability.

    xml
    <!-- Macro to define a generic link with mass, inertia, and visual -->
    <xacro:macro name="visual_collision" params="mesh">           # Define macro name and parameters
      <visual>
        <origin xyz="0 0 0" rpy="0 0 0" />
        <geometry>
          <mesh filename="${mesh_path}${mesh}" />
        </geometry>
        <material name="">
          <color rgba="0.79216 0.81961 0.93333 1" />
        </material>
      </visual>
      <collision>
        <origin xyz="0 0 0" rpy="0 0 0" />
        <geometry>
          <mesh filename="${mesh_path}${mesh}" />
        </geometry>
      </collision>
    </xacro:macro>
  5. In the file rm75.urdf.xacro, replace the original duplicate codes with defined Xacro macros. Ensure that the structure remains unchanged after replacement, and only change the implementation method of repeated parts.

    xml
    <link name="arm_base_link1">
      <inertial>
        <origin xyz="0.00033281 2.206E-05 0.060153" rpy="0 0 0" />
        <mass value="0.83984" />
        <inertia ixx="0.0017115" ixy="4.0276E-06" ixz="4.7032E-05" 
        iyy="0.0016829" iyz="-1.8665E-06" izz="0.00089154" />
      </inertial>
      <xacro:visual_collision mesh="arm_base_link1.STL" />                 #Macro call
    </link>
    <link name="r_link1">
      <inertial>
        <origin xyz="2.8966E-07 0.025188 -0.021107" rpy="0 0 0" />
        <mass value="0.59353" />
        <inertia ixx="0.0012661" ixy="-2.0397E-09" ixz="-5.3423E-09"
          iyy="0.00056131" iyz="-0.00021118" izz="0.0011816" />           
      </inertial>
      <xacro:visual_collision mesh="r_link1.STL" />                         #Macro call
    </link>
    ...  
    <joint name="joint1" type="revolute">                                  #The joint part remains unchanged
      <origin xyz="0 0 0.2405" rpy="-1.5708 0 3.1416" />
      <parent link="arm_base_link1" />
      <child link="r_link1" />
      <axis xyz="0 -1 0" />
      <limit lower="-3.11" upper="3.11" effort="60" velocity="3.14" />
    </joint>
    <joint name="joint2" type="revolute">
      <origin xyz="0 0 0" rpy="1.5708 0 0" />
      <parent link="r_link1" />
      <child link="r_link2" />
      <axis xyz="0 1 0" />
      <limit lower="-2.27" upper="2.27" effort="60" velocity="3.14" />
    </joint>
    ...

V. Case Verification

Method 1:

Use xacro command-line tools to verify that the newly created Xacro file is correct. For example, you can convert the Xacro file back to URDF format for verification with the following command.

sh
cd <Your workspace name>/src/rm_description/rm_Lifting_robot_75B_jaw_description/urdf    # Enter the urdf folder

xacro --inorder rm75.urdf.xacro    # xacro --inorder <xacro file name>

Check whether the generated URDF file is consistent with the original URDF file in function and structure.

Method 2:

sh
# Build the workspace
mkdir -p <Your workspace name>/src
# Enter the workspace directory
cd <Your workspace name>
# Compile
catkin build
# Add workspace environment variables
source ./devel/setup.bash
# Launch the configured package
roslaunch rm_Lifting_robot_75B_jaw_description display.launch

After entering the RVIZ page, first set Fixed Frame to base_link, click Add, find RobotModel, and finally click OK.

Rviz displays configuration

The model display results are shown in the figure below.

Rviz shows the results

The status of each joint of the robotic arm can be tested in RViz by joint_state_publisher_gui. All functions are operational.

Test

sh
# Build the workspace
mkdir -p <Your workspace name>/src
# Enter the workspace directory
cd <Your workspace name>
# Compile
catkin build
# Add workspace environment variables
source ./devel/setup.bash
# Test whether the model can be displayed in Gazebo
roslaunch rm_Lifting_robot_75B_jaw_description gazebo.launch

The function of the file gazebo.launch is to read the content robot_description in the parameter server and generate a robot model through the node urdf_spawner. The content is as follows.

xml
<launch>
   <arg name="paused" default="false" /> 
   <arg name="use_sim_time" default="true" />
   <arg name="gui" default="true" />
   <arg name="headless" default="false" /> 
   <arg name="debug" default="false" /> 
   <include file="$(find gazebo_ros)/launch/empty_world.launch">
      <arg name="debug" value="$(arg debug)" />
      <arg name="gui" value="$(arg gui)" />
      <arg name="paused" value="$(arg paused)" />
      <arg name="use_sim_time" value="$(arg use_sim_time)" /> 
   </include>
   <param name="robot_description" command="$(find xacro)/xacro '$(find rm_Lifting_robot_75B_jaw_description)/urdf/rm_Lifting_robot_75B_jaw_description.urdf.xacro'" />
  <!--<param name="robot_description" textfile="$(find rm_Lifting_robot_75B_jaw_description)/urdf/rm_Lifting_robot_75B_jaw_description.urdf" />-->
   <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model" respawn="false" output="screen" args="-urdf -model rm_Lifting_robot_75B_jaw_description -param robot_description -x 0 -y 0 -z 0.1" />
</launch>

Gazebo shows results

So far, the robot model has been successfully loaded into gazebo.

VI. Video Demonstration

RM75 arm model function configuration package compressed file

RM65 arm model function configuration package compressed file