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

problem with contact sensor. Easy question

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

tommy gravatar image

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

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">
      <scene>
    <ambient rgba="0.0 0.0 0.0 1"/>
    <background rgba="1 1 1 1"/>
    <shadows enabled="true"/>
      </scene>

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

    <!-- 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"/>
    </inertial>

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

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

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

    </link>
      </model>

      <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"/>
    </inertial>

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

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


    </link>
    </model>

    <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"/>
    </light>

  </world>
</gazebo>

the problem is that when i type : rostopic echo bumper_states

this error appears on the roslaunch terminal :

Error [ContactSensor.cc:237] 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

Comments

1

You might find better help on the gazebo answers site: http://answers.gazebosim.org/questions/

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

if you manage to find a solution, do post.

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

2 Answers

Sort by ยป oldest newest most voted
1

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

Elizabeth C gravatar image

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

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 https://code.ros.org/svn/ros-pkg/stacks/simulator_gazebo/tags/simulator_gazebo-1.7.11/ ~/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

Comments

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 -0600 )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 -0600 )edit
0

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

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

Question Tools

3 followers

Stats

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

Seen: 1,291 times

Last updated: Apr 11 '13