.sdf <pose> and NRP Translation don't match


#1

Hi,
I am trying to move a robot arm to the position of a ball in the nrp. Now I have the ball where I want it to be (1.1 0.9 0.85 0 0 0), but when I inspect it in the NRP, it tells me the ball is at ( 0 0 0 0 0 0), and the handle (the displayed coordinate system) to move it around is at the world origin, not at the ball.
How can I set the handle to be at the ball itself, so I get the correct position to move the arm to?

Here is the code of the ball:

      <model name='cricket_ball'>
      link name='link'
        <pose frame="">1.1 0.9 0.85 0 0 0</pose>
        <inertial>
          <mass>0.1467</mass>
          <inertia>
            <ixx>8.25187e-05</ixx>
            <ixy>0</ixy>
            <ixz>0</ixz>
            <iyy>8.25187e-05</iyy>
            <iyz>0</iyz>
            <izz>8.25187e-05</izz>
          </inertia>
        </inertial>
        <collision name='collision'>
          <geometry>
            <sphere>
              <radius>0.0375</radius>
            </sphere>
          </geometry>
          <surface>
            <contact>
              <poissons_ratio>0.347</poissons_ratio>
              <elastic_modulus>8.8e+09</elastic_modulus>
              <ode>
                <kp>100000</kp>
                <kd>100</kd>
                <max_vel>100</max_vel>
                <min_depth>0.001</min_depth>
              </ode>
            </contact>
            <friction>
              <torsional>
                <coefficient>1</coefficient>
                <use_patch_radius>0</use_patch_radius>
                <surface_radius>0.01</surface_radius>
                <ode/>
              </torsional>
              <ode/>
            </friction>
            <bounce/>
          </surface>
          <max_contacts>10</max_contacts>
        </collision>
        <visual name='visual'>
          <geometry>
            <sphere>
              <radius>0.0375</radius>
            </sphere>
          </geometry>
          <material>
            <script>
              <uri>file://media/materials/scripts/gazebo.material</uri>
              <name>Gazebo/Red</name>
            </script>
          </material>
        </visual>
        <velocity_decay>
          <linear>0</linear>
          <angular>0.005</angular>
        </velocity_decay>
        <self_collide>0</self_collide>
        <kinematic>0</kinematic>
      </link>
    </model>

And in the World State:

<model name='cricket_ball'>
        <pose frame="">1.1 0.9 0.85 0 0 0</pose>
        <scale>1 1 1</scale>
        <link name='link'>
          <pose frame="">1.1 0.9 0.85 0 0 0</pose>
          <velocity>0 0 0 0 -0 0</velocity>
          <acceleration>0 0 0 0 -0 0</acceleration>
          <wrench>0 0 0 0 -0 0</wrench>
        </link>
</model>

Apparently I am not allowed to upload pictures, but I can send one if necessary.

Thank you for your Help.


#2

Dear PeerL,

I have tried to insert your sdf model into an sdf world file in order to check what the problem could be. But gazebo cannot parse your sdf snippet. There are obvious syntax errors such as link name='link' at the beginning of your excerpt and some </ode> tags without the corresponding <ode/> and maybe less obvious ones.

Could you paste the actual content of your sdf world file?

I am not sure if it is related to your issue, but there is one limitation of the object inspector that might confuse you: if an object is moving on its own while you are inspecting it, its coordinates are not updated within the inspector (close and re-open to see updated coordinates).

Best regards,
Luc


#3

Dear Luc,

after changing the poses one by one and comparing to other models I found the solution.
Apparently I was missing one pose description within the tag.
So in a minimal example, as below (not working code), there need to be 3 pose descriptions, one for the collisions, one for the link, and one for the model. The last describing the translation towards the world coordinate frame, the others describing the translation from the model frame.
Within the state, again there are two pose descriptions with all poses relative to the world frame.

So the Setup has to be:

<model name='cricket_ball'>
      <link name='link'>
        <inertial>...
        <collision name='collision'>
          <pose frame="">0 0 0 0 -0 0</pose>
          <geometry>...
          <surface>...
          <max_contacts>10</max_contacts>
        </collision>
        <visual name='visual'>...
        <velocity_decay>...
        <self_collide>0</self_collide>
        <kinematic>0</kinematic>
        <pose frame="">0 0 0 0 -0 0</pose>
      </link>
      <pose frame="">0 0.9 0.85 0 0 0</pose>
    </model>

and in

<state world_name="default">

<model name='cricket_ball'>
        <pose frame="">0 0.9 0.85 0 0 0</pose>
        <scale>1 1 1</scale>
        <link name='link'>
          <pose frame="">0 0.9 0.85 0 0 0</pose>
          <velocity>0 0 0 0 -0 0</velocity>
          <acceleration>0 0 0 0 -0 0</acceleration>
          <wrench>0 0 0 0 -0 0</wrench>
        </link>
      </model>

It seems a little over complicated though, do you know if some of those values can be left away?
For the tag I can not explain why, but it works for me.

Best
Peer