Getting contact sensor/bumper Gazebo plugin to work
Has anyone had success with this? That is, creating a contact sensor/ bumper in urdf and connecting it to the Gazebo plugin described here ( http://gazebosim.org/tutorials?tut=ro... ), and then receiving the messages you'd expect on the defined topic.
My Gazebo code is:
<gazebo reference="bump_sensor">
<sensor name="main_bumper" type="contact">
<selfCollide>true</selfCollide>
<alwaysOn>true</alwaysOn>
<updateRate>15.0</updateRate>
<material>Gazebo/Red</material>
<contact>
<collision>bump_sensor_collision</collision>
</contact>
<plugin name="gazebo_ros_bumper_controller" filename="libgazebo_ros_bumper.so">
<bumperTopicName>bumper_vals</bumperTopicName>
<frameName>world</frameName>
</plugin>
</sensor>
</gazebo>
The model code is
<joint name="bumper_joint" type="fixed">
<axis xyz="0 1 0" />
<origin xyz=".2 0 0" rpy="0 0 0"/>
<parent link="chassis"/>
<child link="bump_sensor"/> </joint>
<link name="bump_sensor">
<collision>
<origin xyz="0 0 0" rpy="0 0 0"/>
<geometry>
<box size="0.1 0.1 0.1"/>
</geometry>
</collision>
<visual>
<origin xyz="0 0 0" rpy="0 0 0"/>
<geometry>
<box size="0.1 0.1 0.1"/>
</geometry>
</visual>
<inertial>
<mass value="1e-5" />
<origin xyz="0 0 0" rpy="0 0 0"/>
<inertia ixx="1e-6" ixy="0" ixz="0" iyy="1e-6" iyz="0" izz="1e-6" />
</inertial>
</link>
I don't think there is anything wrong with above. The topic bumper_vals is created and I can look at the messages to it via rostopic echo. They are in the expected gazebo_msgs/ContactState format. (or is it ContactsState?)
The point is that the states[] array is always empty even on an obvious collision.
Heaps of people seem to have had problems with bumpers (especially in simulation) and I don't see any clear cut answer. Why isn't there an effort to get this to work? If you know anything about robotics, then a contact sensor is the most basic thing you need to have working. Cameras, laser sensors re great, but the contact sensor is (should be) the simple, reliable backup that gets you out of trouble. And you can do a lot with it alone - e.g investigate and test path planning algorithms in spaces with obstacles, which is my project.
Any help greatly appreciated. Rob
I'm having the exact same issue