Gazebo | Ignition | Community
Ask Your Question
1

Contact sensor error when using Gazebo 2.2.3

asked 2014-08-30 17:05:00 -0600

I have just moved my code from Ubuntu 12.04 LTS and ROS Hydro to Ubuntu 14.04 LTS and ROS Indigo. My robot is using Gazebo contact sensors with the libgazebo_ros_bumper.so plugin. The sensors worked correctly with the version of Gazebo used by Hydro (1.9.6), but with Indigo I get the following error:

***** Internal Program Error - assertion (this->customContactPublishers.count(name) > 0)
failed in std::string gazebo::physics::ContactManager::CreateFilter(const string&, const
std::vector<std::basic_string<char> >&):
/tmp/buildd/gazebo2-2.2.3/gazebo/physics/ContactManager.cc(329): Failed to create a custom
filter
Service call failed: transport error completing service call: unable to receive data from
sender, check sender's logs for details
Aborted (core dumped)

Here is a contact specification from the robot's URDF file:

<gazebo reference="gripper_fixed_jaw">
  <sensor name="fixed_jaw_contact_sensor" type="contact">
    <always_on>true</always_on>
    <update_rate>${contact_sensor_update_rate}</update_rate>
    <contact>
      <collision>collision</collision>
    </contact>
    <plugin name="fixed_jaw_bumper" filename="libgazebo_ros_bumper.so">
      <bumperTopicName>fixed_jaw_contact_sensor_state</bumperTopicName>
      <frameName>gripper_fixed_jaw</frameName>
    </plugin>
  </sensor>
</gazebo>

Is there something that needs to be changed in this specification in order to work with Gazebo 2.2.3?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
5

answered 2014-10-10 13:57:02 -0600

I was given the solution to this problem by Felix Messmer. The name within the <collision> element must be of the form <link name>_collision. Here is a contact specification that works:

<gazebo reference="gripper_fixed_jaw">
  <sensor name="fixed_jaw_contact_sensor" type="contact">
    <always_on>true</always_on>
    <update_rate>${contact_sensor_update_rate}</update_rate>
    <contact>
      <!-- When using ROS Indigo and Gazebo 2.2.3, the name specified here
           must be <link name>_collision. -->
      <collision>gripper_fixed_jaw_collision</collision>
    </contact>
    <plugin name="fixed_jaw_bumper" filename="libgazebo_ros_bumper.so">
      <bumperTopicName>fixed_jaw_contact_sensor_state</bumperTopicName>
      <frameName>gripper_fixed_jaw</frameName>
    </plugin>
  </sensor>
</gazebo>
edit flag offensive delete link more
0

answered 2014-11-06 10:41:58 -0600

marguedas gravatar image

Hi, I have exactly the same issue but the previous answer didn't solve it. I'm running Gazebo2.2.3 on ROS Indigo (Ubuntu14.04). Here is my urdf implementation:

<link name="LFootBumperLeft_frame">
  <inertial>
    <mass value="0.03">
    <origin xyz="0 0 0">
    <inertia ixx="1e-9" ixy="0" ixz="0" iyy="1e-9" iyz="0" izz="1e-9"/>
  </inertial>
<link>
<joint name="LFootBumperLeft_joint" type="fixed">
  <parent link="l_ankle"/>
  <child link="LFootBumperLeft_frame"/>
  <origin rpy="0 0 0" xyz="0.0876 0.019 -0.035"/>
</joint>

<gazebo reference="LFootBumperLeft_frame">
  <sensor name="LFootBumperLeft_frame_contact_sensor" type="contact">
    <always_on>true</always_on>
    <update_rate>100</update_rate>
    <contact>
      <collision>LFootBumperLeft_frame_collision</collision>
    </contact>
    <plugin name="fixed_jaw_bumper" filename="libgazebo_ros_bumper.so">
      <always_on>true</always_on>
      <update_rate>20</update_rate>
      <bumperTopicName>LFootBumperLeft_sensor_state</bumperTopicName>
      <frameName>LFootBumperLeft_frame</frameName>
    </plugin>
  </sensor>
</gazebo>

and I get the following error:

* Internal Program Error - assertion (this->customContactPublishers.count(name) > 0) failed in std::string gazebo::physics::ContactManager::CreateFilter(const string&, const std::vector<std::basic_string<char> >&): /tmp/buildd/gazebo2-2.2.3/gazebo/physics/ContactManager.cc(329): Failed to create a custom filter Aborted (core dumped)

I added a dummy mass and inertia element to my link hoping that this would make a difference but it didn't change anything.

Can this be a matter of masses/inertia ? Is it something to modify in my gazebo tags (in the urdf files)?

Thanks!

Mikael Arguedas

edit flag offensive delete link more

Comments

1

You need a collision block in your link. Also, in order to determine the name to put in the Gazebo contact sensor's <collision> element, you need to generate an SDF from the URDF, then search for "LFootBumperLeft_frame". There should be a collision block in the SDF that includes that text as part of its name.

Jim Rothrock gravatar imageJim Rothrock ( 2014-11-19 11:55:16 -0600 )edit

Question Tools

Stats

Asked: 2014-08-30 17:05:00 -0600

Seen: 2,712 times

Last updated: Nov 06 '14