ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Please help me understand origin in URDF

asked 2018-03-26 23:29:04 -0600

roy gravatar image

Hi folks,

I have been following the book Programming Robots with ROS and have been struggling with how the origin tag means in URDF files.

In the chapter 18, there is a snippet of URDF as the following:

  <link name="base_link">
        <cylinder length="0.05" radius="0.1"/>
      <material name="silver">
        <color rgba="0.75 0.75 0.75 1"/>
      <origin rpy="0 0 0" xyz="0 0 0.025"/>

The origin tag xyz = 0 0 0.025 puzzles me. The books says the 0.025 is meant to "... offset in z the point of reference for the base link from its default in the cylinder's center to its bottom." What I don't understand is that if we need to push the origin to the bottom, shouldn't we use -0.25? Why would increase the z value make the origin go down instead of going up?

What's more perplexing is that, later in the joint, it seems using a positive z value in origin actually makes the origin go up:

  <joint name="hip" type="continuous">
    <axis xyz="0 0 1"/>
    <parent link="base_link"/>
    <child link="torso"/>
    <origin rpy="0 0 0" xyz="0.0 0.0 0.05"/>

Here my understanding is that the z value 0.05 is meant to push the origin of the joint to be top of the base link so the next link can start there.

Why does positive value in link's origin push origin downward but push origin upward in joints?

edit retag flag offensive close merge delete


It seems that saying "offset in z the point of reference for the base link from its default in the cylinder's center to its bottom" means that the point of reference should be the origin (0;0;0) and if you put a postive offset in z then your cylinder goes up so the origin will be at its bottom...

Delb gravatar image Delb  ( 2018-03-27 01:42:16 -0600 )edit

...Maybe have a look at #q285055

Delb gravatar image Delb  ( 2018-03-27 01:42:48 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-03-27 00:10:42 -0600

ahendrix gravatar image

Both of these are positive offsets, but it's all about perspective.

In the first case, the origin of the visual mesh is offset upwards with respect to base_link.

In the second case, the origin of the torso link is offset upwards with respect to base_link.

edit flag offensive delete link more


The second snippet is a joint "hip" that connects base_link and torso. It's not the torso link itself.

I don't quite get your answer. If they are both with respect to base_link, why are they going the opposite directions?

roy gravatar image roy  ( 2018-03-27 00:42:08 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-03-26 23:29:04 -0600

Seen: 708 times

Last updated: Mar 27 '18