Gazebo | Ignition | Community
Ask Your Question

Adding ros integrated contact sensors

asked 2014-01-30 06:19:21 -0500

EricSidorov gravatar image

Hello everyone!

I'm building a biped model and I want to add a sensor that detects a collision between its foot and the ground and sends a message to a ROS topic.

The 'Bumper controller' described here sounds pretty much like what I want. But when I try to put the following tag in the .gazebo file:

  <plugin name="gazebo_ros_bumper_controller" filename="">

As suggested in the tutorial, I get the following error:

Error [] Model[bumperbot] is attempting to load a plugin, but detected an incorrect plugin type. Plugin filename[] name[gazeborosbumpercontroller]

I ftought it was because I did not specify any link for the sensor, so I tried using:

<gazebo reference='base_link'>

This time I got the message:

Error [] XML Element[plugin], child of element[link] not defined in SDF. Ignoring.[link]
Error [] Error reading element <link>
Error [] Error reading element <model>
Error [] Unable to read element <sdf>
Error [] parse as old deprecated model file failed.
Error [] Unable to read sdf string

I also tried to follow this answer, which suggested using a tag like this:

<sensor:contact name="contact_sensor">
  <controller:gazebo_ros_bumper name="gazebo_ros_bumper_controller" plugin="">
      <interface:bumper name="bumper_iface" />

This time the xml couldn't even be parsed.

I did manage to add the gazebo contact sensor

<gazebo reference="base_link">
  <sensor type="contact" name="contact">
    <plugin name='gazebo_contact' filename=''/>

But it publishes to a gazebo topic, not a ROS topic.

Does anyone know what am I doing wrong? I'm using gazebo 1.9.3 and ros-hydro.

P.S: I've noticed the turtlebot has a sensor that does exactly what I want, but I couldn't figure out where to find the plugin which is used there or how to add it to my model.

Thanks in advance!

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2014-01-31 13:25:49 -0500

Here is an example:

<gazebo reference="gripper">
  <sensor name="gripper_contact_sensor" type="contact">
    <plugin name="gripper_bumper" filename="">
edit flag offensive delete link more

answered 2014-04-03 08:30:17 -0500

Gxav gravatar image

So did you get it worked? I am trying to do the same but always get an empty topic when using and no topic is generated when using my own plugin. How you create collision name using urdf description? Thank you in advance

edit flag offensive delete link more


I got the same problem, empty topic, though I have tried to work around by following the above link I leave

shawnysh gravatar imageshawnysh ( 2017-06-12 04:36:15 -0500 )edit

Did you get it done by the way? Thanks!

shawnysh gravatar imageshawnysh ( 2017-06-12 04:37:36 -0500 )edit

answered 2017-06-12 04:31:16 -0500

shawnysh gravatar image

updated 2017-06-12 04:36:53 -0500

collision tag in contact tag of gazebo tag is very tricky, to which one should pay more attention.

Here is the link to work around: gazebo-contact-sensor-added-to-a-robot-link-in-urdf-file-is-not-working-as-expected

edit flag offensive delete link more

Question Tools


Asked: 2014-01-30 06:19:21 -0500

Seen: 9,117 times

Last updated: Jun 12 '17