Robotics StackExchange | Archived questions

Frames in SDF robot model: how to define relative links?

I just started writing an SDF model for a robot arm and I would like to define the pose of a link relative to another link, as opposed to the model frame. The SDF spec mentions both a frame tag (http://www.sdformat.org/spec?ver=1.5&elem=link#link_frame) and a frame attribute of the pose tag (http://www.sdformat.org/spec?ver=1.5&elem=link#pose_frame), but I can't find any documentation or examples of how to properly use it.

Here's a simple example of what I'm trying to do that isn't working:

<?xml version="1.0"?>
<sdf version="1.6">
  <model name="example">

    <link name="base">
      <pose>0 0 0 0 0 0</pose>
      <visual name="visual">
        <geometry>
          <cylinder>
            <radius>0.1</radius>
            <length>0.025</length>
          </cylinder>
        </geometry>
      </visual>
    </link>

    <link name="link1">
      <pose>0 0 0.1 0 0 0</pose>
      <visual name="visual">
        <geometry>
          <box>
            <size>0.2 0.05 0.1</size>
          </box>
        </geometry>
      </visual>
    </link>

    <link name="link2">
      <!-- Want this to be relative to link1 -->
      <pose frame="link1">0.2 0 0 0 0 0</pose>
      <visual name="visual">
        <geometry>
          <box>
            <size>0.2 0.05 0.1</size>
          </box>
        </geometry>
      </visual>
    </link>

  </model>
</sdf>

However, this is the output (I'd like link2 to be at same z-height as link1): image description

Given that the frame information isn't exposed in the Gazebo Model Editor GUI, I suspect frame isn't completely supported?

Asked by mrjogo on 2016-02-29 15:15:36 UTC

Comments

Answers

Hi, not long ago we added the frame tag to the sdformat spec as the first step towards allowing entities to have different reference frames. We still need to add support for it in gazebo.. it's in the todo list.

Asked by iche033 on 2016-03-04 14:26:19 UTC

Comments

Hi iche033! Thanks for the answer ... how is it possibile to check whatever or not a tag has been implemented ? I mean, if I see it in the sdformat I assume it is already implemented if in its description it is not stated otherwise

Asked by Marco on 2016-03-05 11:11:45 UTC

There's an issue now: https://bitbucket.org/osrf/gazebo/issues/1982/parse-sdf-frame-elements-and-attributes

Asked by AL on 2016-08-02 04:12:26 UTC

Is this still an open issue? I'm running gazebo 9 in ubuntu 20.04 and I still can't specify relative link poses. Can't imagine it's so hard to add support for relative poses, which is simple forward computation.

Asked by sven on 2020-06-02 06:22:27 UTC