Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Gazebo contact sensor added to a robot link in urdf file is not working as expected?

I have added a contact sensor to one of the finger links of a robot's gripper as follows:

 <link name="bh_finger_13_link">
      <mass value="0.01"/>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <inertia ixx="1" ixy="0" ixz="0" iyy="1" iyz="0" izz="1" />
      <origin xyz="0 0 0" rpy="0 0 0" />
         <mesh file
  name="package://bh262_description/meshes/bhand/finger_tip.dae" />

       <material name="Yellow" />
    <collision name="bh_finger_13_collision">
      <origin rpy="0 0 0" xyz="0.0 0.0 0.0"/>
      <geometry name="bh_finger_13_collision">
         <mesh filename="package://bh262_description/meshes/bhand/finger_tip.dae" />
        <contact_coefficients kd="1.0" kp="1000.0" mu="0"/>

<gazebo reference="bh_finger_13_link">
   <sensor name='my_contact' type='contact'>
       <plugin name="my_plugin" filename=""/>
        <update_rate> 5 </update_rate>

On lauching the urdf file, I am getting the gazebo topics /gazebo/default/wam/bh_finger_13_link/my_contact and /gazebo/default/wam/bh_finger_13_link/my_contact/contacts. However, on echoing these topics, I am not getting the collision data. In order to debug this issue, I have also added a contact sensor to a box model sdf, and made the finger link to touch this object. On echoing the topic associated with the contact sensor of the box model, I am getting the collision of the box with the finger link, but on echoing the topic associated with the finger link, I am not getting the same collision information. I am not able to figure out the reason behind this discrepancy. Any help is much appreciated.