URDF Model Files

Overview

URDF (Unified Robot Description Format) is a robot model notation using XML. It is used by many platforms in recent years, including ROS (Robot Operating System). Note that the current official specification only supports the kinematic structure of robots, and sensors etc. are not supported.

Model file conventions

This page is based on the official URDF documentation and summarizes information necessary for robot simulation.

Points to note when creating URDF models are as follows:

  • Describe one robot or environment model per model file.

  • One robot must have a single tree structure for links. That is, it must be possible to reach any link from a certain link via joints, and the path to reach it must be unique. Therefore, closed mechanisms such as parallel link mechanisms cannot be expressed in URDF.

  • All numerical values are in SI base units and derived units without prefixes. For example, meters or radians must be used for position units, and kilograms must be used for mass units.

Node and attribute list

In URDF, robot models are described by hierarchical node structures. Nodes with the same name have the same notation and role regardless of location.

Below is a list of nodes necessary for loading robot models in Choreonoid and performing simulations. It is based on the actual hierarchical structure of nodes. Not all URDF nodes are introduced, and explanations of nodes related to actual robots and operations described under joint nodes are omitted.

  • robot node (attribute: name)

    • link node (attribute: name)

      • inertial node

        • origin node (attributes: xyz, rpy)

        • mass node (attribute: value)

        • inertia node (attributes: ixx, iyy, izz, ixy, iyz, ixz)

      • visual node

        • origin node (attributes: xyz, rpy)

        • geometry node

          • box node (attribute: size)

          • cylinder node (attributes: radius, length)

          • sphere node (attribute: radius)

          • mesh node (attributes: filename, scale)

        • material node (attribute: name)

          • color node (attribute: rgba)

          • texture node (attribute: filename)

      • collision node

        • origin node (attributes: xyz, rpy)

        • geometry node

          • box node (attribute: size)

          • cylinder node (attributes: radius, length)

          • sphere node (attribute: radius)

          • mesh node (attributes: filename, scale)

    • joint node (attributes: name, type)

      • origin node (attributes: xyz, rpy)

      • parent node (attribute: link)

      • child node (attribute: link)

      • axis node (attribute: xyz)

      • limit node (attributes: lower, upper, velocity, effort)

The role and notation of each node are detailed below.

robot node

The robot node defines one robot. The robot definition must be completed entirely within the robot tag.

Attributes of robot node

Attribute name

Content

name (required)

Robot name. Any string that does not duplicate within the model can be specified.

When loading in Choreonoid, a separate display name can be assigned, so even when loading multiple identical robots simultaneously, one model file is sufficient.

joint node

The joint node defines the relationship between two links.

Attributes of joint node

Attribute name

Content

name (required)

Joint name. Any string that does not duplicate within the model can be specified.

type (required)

Joint type. Specify one of the following: revolute joint with range of motion: revolute, joint that rotates infinitely like wheels: continuous, linear joint: prismatic, fixed relationship fixed, or completely unconstrained floating. (There is also planar that moves on a plane, but since Choreonoid does not support it, the explanation is omitted.)

To further define joints, it is necessary to specify parent-child relationships between links, relative positions, range of motion, etc. Therefore, this information is described in the child nodes shown in the table below.

Child nodes that joint nodes can have

Node name

Content

origin node (optional)

Defines the relative position and orientation between two links. The xyz attribute gives the relative position of the child link origin when joint displacement is zero, as seen from the parent link origin. The rpy gives the relative orientation of the child link coordinate system as seen from the parent link coordinate system in roll-pitch-yaw representation. Each attribute can be omitted, and if omitted, it is set to zero. If the node itself is omitted, both xyz and rpy are zero, meaning the origin positions and orientations of the parent and child links coincide.

parent node (required)

Defines the parent link by specifying the link name in the link attribute.

child node (required)

Defines the child link by specifying the link name in the link attribute.

axis node (optional)

Specifies the joint axis. Specify a 3D vector representing the direction of the joint axis as seen from the parent link coordinate system in the xyz attribute. This is valid only when the type attribute of the joint node is revolute, continuous, or prismatic. For revolute joints, it specifies the rotation axis, and for linear joints, it specifies the direction of motion. Note that the direction determines the sign of joint displacement. If there is no node, the default value is xyz=”1 0 0”, that is, the x-axis direction in the parent link coordinate system.

limit node (conditionally required)

Defines the range of motion, velocity, and actuator output of the joint. Required when the type attribute of the joint node is revolute or prismatic. The lower attribute specifies the negative motion limit, and the upper attribute specifies the positive motion limit. Both attributes representing the range of motion have a default value of 0, and if both are not specified, the joint becomes immobile. Additionally, the velocity attribute gives the upper limit of joint velocity (units are [m/s] or [rad/s]), and the effort attribute gives the upper limit of actuator output (units are [N] or [Nm]). Both velocity upper limit and output upper limit must be positive values, and there are no default values for these.

Example:

<joint name="sample_joint" type="revolute">
  <origin xyz="0 0 1" rpy="0 0 3.1416"/>
  <parent link="link1"/>
  <child link="link2"/>
  <axis xyz="1 0 0"/>
  <limit lower="-3.14" upper="3.14" velocity="1.0" effort="30"/>
</joint>

Sample model

Choreonoid provides a URDF version of the SR1, which is a sample model of a humanoid robot. You can understand the correspondence by comparing it with the Body file version.