ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Not able to read data from contact sensor - gazebo

asked 2013-01-09 21:07:56 -0500

gordon gravatar image

updated 2014-04-20 14:06:44 -0500

ngrennan gravatar image

Hi, I am new to ROS and gazebo. I have created a world in gazebo and I have added a contact sensor to it. I created the sensor going through this tutorial This is the code I used

<?xml version="1.0"?>
<robot xmlns:sensor=""

<link name="sensor">
      <origin xyz="-1 -1 0.5" rpy="0 0 0" /> 
      <mass value="10.0" />
      <inertia  ixx="1.0" ixy="0.0"  ixz="0.0"  iyy="100.0"  iyz="0.0"  izz="1.0" />
      <origin xyz="-1 -1 0.5" rpy="0 0 0" /> 
        <box size="1 1 1" />
     <origin xyz="-1 -1 0.5" rpy="0 0 0" /> 
       <box size="1 1 1" />
  <gazebo reference="sensor">

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

And I run the turtlebot simulator and dash the turtlebot against the "sensor". Now I run rostopic echo /contact_bumper/state I get this

  seq: 31066
    secs: 458
    nsecs: 186000000
  frame_id: world
states: []

I don't get why I am not getting the contact information i.e force and body name. Is there a mistake I am doing ?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-01-09 21:21:17 -0500

prasanna.kumar gravatar image

updated 2013-01-09 21:23:34 -0500

I tried your code. There is an error in your xml. The shell that runs the gazebo says this when I spawn the sensor.

Unable to find geom[sensor_link_geom] inbody[sensor]
Body geoms: 

So, sensor_geom is the only available geom. Replace your geom tag with <geom>sensor_geom</geom> and it will work.

Hope this helps!

edit flag offensive delete link more


@prasanna.kumar Thanks, it worked. How silly of me!

gordon gravatar image gordon  ( 2013-01-11 07:59:40 -0500 )edit

Question Tools


Asked: 2013-01-09 21:07:56 -0500

Seen: 1,934 times

Last updated: Jan 09 '13