scpeters-test / sdformat

Simulation Description Format (SDF) parser and description files.
http://sdformat.org
Other
1 stars 0 forks source link

Pose tag in sensors ignored with fixed links #67

Open scpeters-test opened 10 years ago

scpeters-test commented 10 years ago

Original report (archived issue) by adhenning (Bitbucket: adhenning).

The original report had attachments: GearsBot.URDF


When a sensor (or at least camera's in this case) is attached to a fixed link, it's pose tag is ignored and overwritten with the computed pose for the fixed link when the pose tag should be transformed by the computed pose. I've attach the file to reproduce this issue. The following cases show the error. The pose should change, but doesn't.

No pose (0, 0, 0, 0, 0, 0):

<sensor name="robotCamera" type="camera">
  <visualize>true</visualize>
  <!-- <pose>1 1 1 1.570796 1.570796 1.570796</pose> -->
  <camera></camera>
</sensor>

Output:

$ gz sdf -p /usr/share/frcsim/models/GearsBot/robots/GearsBot.URDF | awk "/<sensor name='robotCamera/,/<\/sensor>/"
  <sensor name='robotCamera' type='camera'>
    <visualize>1</visualize>
    <camera name='__default__'>
      <horizontal_fov>1.047</horizontal_fov>
      <image>
        <width>320</width>
        <height>240</height>
      </image>
      <clip>
        <near>0.1</near>
        <far>100</far>
      </clip>
    </camera>
    <pose>-0.20115 0.42488 0.30943 1.5708 -0.89012 1.5708</pose>
  </sensor>

Pose:

<sensor name="robotCamera" type="camera">
  <visualize>true</visualize>
  <pose>1 1 1 1.570796 1.570796 1.570796</pose>
  <camera></camera>
</sensor>

Output:

  $ gz sdf -p /usr/share/frcsim/models/GearsBot/robots/GearsBot.URDF | awk "/<sensor name='robotCamera/,/<\/sensor>/"
  <sensor name='robotCamera' type='camera'>
    <visualize>1</visualize>
    <camera name='__default__'>
      <horizontal_fov>1.047</horizontal_fov>
      <image>
        <width>320</width>
        <height>240</height>
      </image>
      <clip>
        <near>0.1</near>
        <far>100</far>
      </clip>
    </camera>
    <pose>-0.20115 0.42488 0.30943 1.5708 -0.89012 1.5708</pose>
  </sensor>
scpeters-test commented 10 years ago

Original comment by Steve Peters (Bitbucket: Steven Peters).


We should add a test for this to fixed_joint_reduction.cc (see also fixed_joint_reduction.urdf).