Ask Your Question

problem with contact sensor. Easy question

asked 2012-10-26 03:58:41 -0500

tommy gravatar image

updated 2014-01-28 17:14:04 -0500

ngrennan gravatar image

hi to everybody, I'm trying to pull out some data from the contact point of an object, so I chose to use the Gazebo Ros Bumper plug in. This is my sdf file

<?xml version="1.0"?>
  <gazebo version="1.0">
    <world name="default">
    <ambient rgba="0.0 0.0 0.0 1"/>
    <background rgba="1 1 1 1"/>
    <shadows enabled="true"/>

      <physics type="ode" update_rate="100">
    <gravity xyz="0 0 -9.8"/>
      <solver type="quick" dt="0.01" iters="100" sor="1.3"/>

    <!-- Ground Plane -->
    <include filename="ground_plane.model"/>

    <model name="cylinder1">
      <link name="link">
    <origin pose="0 0 0.5 0 0 0"/>
    <inertial mass="1.0">
      <inertia ixx="1" ixy="0" ixz="0" iyy="1" iyz="0" izz="1"/>

    <collision name="cylinder1_geom">
        <cylinder radius="0.5" length="1.0"/>

    <visual name="cylinder1_vis">
        <cylinder radius="0.5" length="1.0"/>
      <material script="Gazebo/Grey"/>

    <sensor name='contact_sensor' type='contact' always_on='1' update_rate='1.000000' visualize='1'>
      <origin pose='0 0 0.5 0 0 0'/>
        <collision name="cylinder1_geom"/>
      <plugin name="gazebo_ros_bumper" filename=""/>


      <model name="cylinder">
      <link name="link2">
    <origin pose="0 0 1.5 0 0 0"/>
    <inertial mass="1.0">
      <inertia ixx="1" ixy="0" ixz="0" iyy="1" iyz="0" izz="1"/>

    <collision name="cylinder2_geom">
        <cylinder radius="0.3" length="1.0"/>

    <visual name="cylinder2_vis">
        <cylinder radius="0.3" length="1.0"/>
      <material script="Gazebo/Grey"/>


    <light type="directional" name="sun" cast_shadows="true">
      <origin pose="0 0 10 0 0 0"/>
      <diffuse rgba="1.0 1.0 1.0 1"/>
      <specular rgba=".1 .1 .1 1"/>
      <attenuation range="10" constant="0.8" linear="0.01" quadratic="0.0"/>
      <direction xyz="0 .2 -1.0"/>


the problem is that when i type : rostopic echo bumper_states

this error appears on the roslaunch terminal :

Error [] Contact Sensor[contact_sensor] has no collision[cylinder1_geom]

one for each clock cycle. I don't really know where i'am wronging.I'm so sorry for the silliness of the question, but I'm new in this world so also simple things are not discounted for me. Thanks a lot in advance.

edit retag flag offensive close merge delete



You might find better help on the gazebo answers site:

jbohren gravatar image jbohren  ( 2012-10-26 07:34:19 -0500 )edit

if you manage to find a solution, do post.

prasanna.kumar gravatar image prasanna.kumar  ( 2012-11-02 00:07:57 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2012-11-26 18:02:01 -0500

Elizabeth C gravatar image

updated 2013-04-11 00:15:52 -0500

I don't think that message is your fault--it's because the contact sensor implementation is broken in the version of Gazebo that comes with Fuerte. At least one of the bugs causing the problem is now fixed, but the fix hasn't made it to the released version yet. It also sounds like that there might be bugs in the bumper implementation itself (based on this and this).

EDIT: Thomas Koletschka's comment has information about how to get a working version of Gazebo, which I've included and expanded below.

Installing a new version of Gazebo

  • Choose somewhere to put your new version of Gazebo. I put mine in ~/ros/simulator_gazebo, and I'll assume that's the location for the rest of the instructions.
  • $ mkdir ~/ros
  • $ svn co ~/ros/simulator_gazebo
  • In your ~/.bashrc (or wherever it is that you set your ROS_PACKAGE_PATH), add ~/ros/simulator_gazebo to ROS_PACKAGE_PATH before the original value. For example:
    export ROS_PACKAGE_PATH=~/ros/simulator_gazebo:$ROS_PACKAGE_PATH
  • $ source ~/.bashrc
  • $ rosmake -i simulator_gazebo (-i means put a ROS_NOBUILD in the directories)
    This took about 30 minutes to run successfully. The first time I tried running it, I got this:
    -- BUILD ERRORS: These must be resolved before compiling.
    -- Missing: Google Protobuf Compiler Library (libprotoc-dev)
    -- Missing: libtar
    so I did:
    $ sudo apt-get install libprotoc-dev libtar-dev
    and tried again, and it worked.

When you launch Gazebo as usual, you'll get the new version you just compiled, and it should have semi-working contact sensors (with the caveats mentioned above). Be aware though that it's possible existing models you want to use might be incompatible with this new version.

EDIT 4/9/2013: The issue seems to have been resolved as of Gazebo 1.3, which is included in the simulator-gazebo-1.7.11 tag.

edit flag offensive delete link more


I have the same error, and i'm new on ROS. Can you tell me, or give me some link to explain me how create the overlay for gazebo. or step by step how install newer version of gazebo?. thnks

monidiaz gravatar image monidiaz  ( 2012-11-28 21:56:58 -0500 )edit

Instructions are added. Unfortunately I STILL can't post any direct links (like the specific path to the tag in the svn repository) until I get enough upvotes on my questions and answers to get 30 karma. :(

Elizabeth C gravatar image Elizabeth C  ( 2012-12-03 18:58:28 -0500 )edit

answered 2012-11-26 21:57:54 -0500

joseescobar60 gravatar image

Hello, i have the same problem with the shadow hand, i'm reading about that and the problem is of the version of gazebo, we have to wait for a new version of gazebo for ros, in this link you can read what is happening...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2012-10-26 03:58:41 -0500

Seen: 1,066 times

Last updated: Apr 11 '13