Goal:
I want to attach contact sensor to gripper finger of robot arm, aiming to get contact feed back while gripper finger touches against other objects
Problem:
After setup, I try to echo bumper contact feedback via below command, but it echoes time increasing only without contact information
gz topic -v /gazebo/default/gripper_finger_link1/contact_sensor
Methods I have tried:
I follow this answer in question: Gazebo contact sensor added to a robot link in urdf file is not working as expected?, adding the proper suffix to make urdf converted to sdf correctly.
where I use @teps's answer which is simple version( I have also tried verbose version yet didn't work either), below is his comment:
I found that if you don't specify the collision name, you get something a lot nicer. E.g. if I specify the collision name (name="palm") I get: {link name}_fixed_joint_lump__palm_collision, but if I leave it empty I get: {link name}_collision. My recipe is then to simply leave the collision name of the link empty, and name the contact collision element as {link_name}_collision.
Here is the part of source code of ROBOT.xacro :
<!-- left gripper finger leaving collision name empty -->
<link name="gripper_finger_link1">
<visual>
<origin xyz="0.04 -0.03 0"/>
<geometry>
<box size="${left_gripper_len} ${left_gripper_width} ${left_gripper_height}" />
</geometry>
<material name="White" />
</visual>
<collision>
<origin xyz="0.04 -0.03 0"/>
<geometry>
<box size="${left_gripper_len} ${left_gripper_width} ${left_gripper_height}" />
</geometry>
</collision>
<xacro:inertial_matrix mass="1"/>
</link>
<!--////////// attach gazebo_ros_bumper sensor plugin to gripper_finger_link1 ////////////-->
<gazebo reference="gripper_finger_link1">
<sensor name="contact_sensor" type="contact">
<always_on>true</always_on>
<update_rate>30.0</update_rate>
<contact>
<collision>gripper_finger_link1_collision</collision>
</contact>
<plugin name="bumper_plugin" filename="libgazebo_ros_bumper.so">
<bumperTopicName>contact_state</bumperTopicName>
<!--<frameName>world</frameName>-->
</plugin>
</sensor>
</gazebo>
I check the SDF file converted from ROBOT.xacro, here is the part of the text, which seems fine since collision name of link matches the counterpart in sensor tag of gazebo tag, as highlighted blocks show
On the other hand, I try to attach plugin to base_link instead, it works which can echo contact information. But it didn't work when plugin attached to another link.
Question:
How to get contact information of robot arm link accept for base_link ??? What's wrong?