gazebosim / sdformat

Simulation Description Format (SDFormat) parser and description files.
http://sdformat.org
Apache License 2.0
169 stars 97 forks source link

Ignores collision tags name attribute when converting URDF files #64

Open osrf-migration opened 10 years ago

osrf-migration commented 10 years ago

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

The original report had attachments: simple-robot.urdf


Converting from URDF to SDF ignores the name attribute of a link's collision tag and sets the name to _collision. This causes problems when parts of the URDF such as the contact sensor reference the collision tag by name. In the attached file, it converts leftFingerCollision to leftFinger_collision.

Conversion output:

#!xml

$ gzsdf print simple-robot.urdf 
<sdf version='1.4'>
  <model name='GearsBot'>
    <link name='leftFinger'>
      <pose>0 0 0 0 -0 0</pose>
      <inertial>
        <pose>0.013123 -1.7347e-18 0.03315 0 -0 0</pose>
        <mass>0.049208</mass>
        <inertia>
          <ixx>5.2203e-05</ixx>
          <ixy>-4.2027e-22</ixy>
          <ixz>1.0345e-05</ixz>
          <iyy>6.106e-05</iyy>
          <iyz>-2.2949e-21</iyz>
          <izz>1.018e-05</izz>
        </inertia>
      </inertial>
      <collision name='leftFinger_collision'>
        <pose>0 0 0 0 -0 0</pose>
        <geometry>
          <mesh>
            <scale>1 1 1</scale>
            <uri>model://GearsBot/meshes/collision/leftFinger.STL</uri>
          </mesh>
        </geometry>
        <surface>
          <contact>
            <ode/>
          </contact>
          <friction>
            <ode/>
          </friction>
        </surface>
      </collision>
      <visual name='leftFinger_visual'>
        <pose>0 0 0 0 -0 0</pose>
        <geometry>
          <mesh>
            <scale>1 1 1</scale>
            <uri>model://GearsBot/meshes/collision/leftFinger.STL</uri>
          </mesh>
        </geometry>
      </visual>
      <gravity>1</gravity>
      <velocity_decay>
        <linear>0</linear>
        <angular>0</angular>
      </velocity_decay>
      <self_collide>0</self_collide>
      <sensor name='leftFingerContact' type='contact'>
        <always_on>1</always_on>
        <update_rate>100</update_rate>
        <contact>
          <collision>leftFingerCollision</collision>
          <topic>__default_topic__</topic>
        </contact>
      </sensor>
    </link>
  </model>
</sdf>
osrf-migration commented 10 years ago

Original comment by adhenning (Bitbucket: adhenning).