Home | Tutorials | Wiki | Issues
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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:

  • /gazebo/default/robot/left_foot_link/left_foot_sensor/contacts
  • /robot/left_foot_sensor

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
  }
  ...

This used to work properly in gazebo 2.2, what did it change in gazebo6?

Thanks!

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:

  • /gazebo/default/robot/left_foot_link/left_foot_sensor/contacts
  • /robot/left_foot_sensor

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
  }
  ...

This used to work properly in gazebo 2.2, what did it change in gazebo6?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/collision_blobs-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 "left_foot_link", the child links "left_foot_fsr1_link", ..., "left_foot_fsr4_link".

<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!