Robotics StackExchange | Archived questions

gazebo6 sensor contact

I have a problem since I changed from gazebo2 to gazebo6

I have in my URDF this:

<gazebo reference="left_foot_link">
  <sensor name="left_foot_sensor" type="contact">
    <always_on>true</always_on>
    <update_rate>100.0</update_rate>
    <contact>
      <collision>left_foot_fsr1_link_collision</collision>
      <collision>left_foot_fsr2_link_collision</collision>
      <collision>left_foot_fsr3_link_collision</collision>
      <collision>left_foot_fsr4_link_collision</collision>
  <topic>/robot/left_foot_sensor</topic>
    </contact>
  </sensor>
</gazebo>

The links fsr1, fsr2, fsr3, fsr4 are fixed to the parent. Using gz topic I can see the two topics:

But messages in both of this topics are empty (only timestamp). While in the topic /gazebo/default/physics/contacts, I can see:

contact {
  collision1: "robot::left_foot_link::left_foot_link_lump::left_foot_fsr1_link_collision_1"
  collision2: "ground_plane::link::collision"
  position {
    x: 0.038235972692059896
    y: 0.016852892204142138
    z: -8.2373648911671e-05
  }
  ...

EDIT

I found that because the sdf parser, the basename for grouped links includes a "lump" postfix (see https://bitbucket.org/osrf/sdformat/pull-requests/235/collisionblobs-for-sdf3-branch for details). I managed to get the contacts working by setting explicitly the collision name in the sensor like is shown below. The parent link is called "leftfootlink", the child links "leftfootfsr1link", ..., "leftfootfsr4link".

<gazebo reference="left_foot_link">
  <sensor name="left_foot_sensor" type="contact">
    <always_on>true</always_on>
    <update_rate>100.0</update_rate>
    <contact>
      <collision>left_foot_link_lump::left_foot_fsr1_link_collision_1</collision>
      <collision>left_foot_link_lump::left_foot_fsr2_link_collision_2</collision>
      <collision>left_foot_link_lump::left_foot_fsr3_link_collision_3</collision>
      <collision>left_foot_link_lump::left_foot_fsr4_link_collision_4</collision>
  <topic>/robot/left_foot_sensor</topic>
    </contact>
  </sensor>
</gazebo>

I couldn't understand why the postfix _1 _2 _3 _4 are attached to the child links. Anyone would suggest a better way to remove the hard-coded prefix/postfix in the names? In which version the pull request #235 will be reflected?

Thanks!

Asked by gecastro on 2016-01-21 01:39:55 UTC

Comments

I had the same problem but not with the same postfix. Thanks you for this post.

Asked by Brosseau.F on 2016-04-29 08:04:43 UTC

Answers