1 Introduction

URDF is the Unified Robot Description Format for specifying robot geometry and organization in ROS.

2 Grammar

2.1 Introduction to Syntax

material    color

link
    geometry

    origin

    material

joint
    parent

    child

    origin

    limit

    axis

2.2 Complete syntax

<robot>
    # describe:
    # Parameters: name=""
    #  Child node:
        <link>
            # Description:
            # Parameters:name=""
            # Child node:
                <visual>
                    # describe:
                    # Parameters:
                    # child nodes: 
                        <geometry>
                            # description
                            # parameters
                            # Child node: 
                                <cylinder />
                                    # Description:
                                    # Parameters:
                                        # length="0.6"
                                        # radius="0.2"
                                <box />
                                    # description
                                    # Parameters:size="0.6 0.1 0.2"
                                <mesh />
                                    #  Description
                                    #Parameters: filename="package://urdf_tutorial/meshes/l_finger_tip.dae"
                        <collision>
                            # Description: collision element, prioritized
                            # parameters
                            # child node 
                                <geometry>
                        <inertial>
                            # description
                            # parameters
                            # Child nodes: 
                                <mass />
                                    # description: mass
                                    # Parameters: value=10
                                <inertia />
                                    # Description: Inertia
                                    # Parameters: i+"Cartesian product of xyz" (9 in total)="0.4"
                        <origin />
                            # Description:
                            # Parameters:
                                # rpy="0 1.5 0"
                                # xyz="0 0 -0.3"
                        <material />
                            # Description
                            # Parameters:name="blue"
        <joint>
            # Description
            # Parameters:
                # name=""
                # type=""
                    # fixed
                    # prismatic
            # child node
                <parent />
                    # Description
                    # Parameters:link=""
                <child />
                    # Description:
                    # Parameters:link=""
                <origin />
                    # Description:
                    # Parameters:xyz="0 -0.2 0.25"
                <limit />
                    # Description
                    # Parameters:
                        # effort="1000.0"    maximum effort
                        # lower="-0.38"      Joint upper limit (radians)
                        # upper="0"          Joint lower limit (radians)
                        # velocity="0.5"     Maximum velocity 
                <axis />
                    # Description: Press ? axis rotation
                    # Parameters:xyz="0 0 1",along the Z axis
        <material>
            # Description:
            # Parameters:name="blue"
            # child node:
                <color />
                    # description:
                    # Parameters:rgba="0 0 0.8 1"

3 Example

3.1 Install dependent libraries

sudo apt install ros-foxy-joint-state-publisher-gui ros-foxy-joint-state-publisher
sudo apt install ros-foxy-xacro

3.2 Download the source code

cd ~/dev_ws
git clone -b ros2 https://github.com/ros/urdf_tutorial.git src/urdf_tutorial

3.3 Compiling the source code

colcon build --packages-select urdf_tutorial

3.4 Running the example

ros2 launch urdf_tutorial display.launch.py model:=urdf/01-myfirst.urdf

results matching ""

    No results matching ""