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

Not able to read data from contact sensor - gazebo 7

asked 2016-07-28 04:58:06 -0500

giovadema85 gravatar image

Hi, I have created a world in gazebo and I have added a contact sensor to it. in gazebo 2 it was working, but in gazebo 7 is not working using the same code. This is my code using ros indigo and gazebo 7.

<robot xmlns:xacro="http://ros.org/wiki/xacro"> <xacro:macro name="gazebo_fsensor_link_v0"> <gazebo reference="fsensor_link"> <mu1>0.2</mu1> <mu2>0.2</mu2> <selfcollide>true</selfcollide> <material>Gazebo/Red</material> <sensor type="contact" name="fsensor_link_contact_sensor" &gt;="" <!--="" <geom="">sensor_link_geom</geom> --> <always_on>true</always_on> <update_rate>100</update_rate> <contact> <collision>fsensor_link_collision</collision> </contact> <plugin name="fsensor_link_plugin" filename="libgazebo_ros_bumper.so"> <bumpertopicname>fsensor_link_sensor_state</bumpertopicname> <framename>fsensor_link</framename> </plugin> </sensor> </gazebo> </xacro:macro> </robot>

thank you, Giovanni

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2017-02-02 11:03:26 -0500

TTDM gravatar image

updated 2017-02-02 11:45:59 -0500

I found what I think could be considered a quick fix but this isn't pretty :

You will need to add "_collision" between the collision name which is inside the link ( without it ) and the one inside the gazebo flag ( with it ).

This may not be enough, you may have to add the link name and some other info too... So i invite you to go in the link just below to have a more detailed answer : http://answers.gazebosim.org/question...

Anyway I made it work so if you ned help just ask and i will try my best to help you

TTDM

edit flag offensive delete link more
0

answered 2016-12-13 07:01:32 -0500

neckutrek gravatar image

For neater code. (this is a direct copy of what you wrote.)

<robot xmlns:xacro="http://ros.org/wiki/xacro"> 
<xacro:macro name="gazebo_fsensor_link_v0"> 
<gazebo reference="fsensor_link"> 
  <mu1>0.2</mu1> 
  <mu2>0.2</mu2> 
  <selfcollide>true</selfcollide> 
  <material>Gazebo/Red</material> 
  <sensor type="contact" name="fsensor_link_contact_sensor" &gt;="" <!--="" <geom="">sensor_link_geom</geom> -->
    <always_on>true</always_on> 
    <update_rate>100</update_rate> 
    <contact> 
      <collision>fsensor_link_collision</collision> 
    </contact> 
    <plugin name="fsensor_link_plugin" filename="libgazebo_ros_bumper.so">
      <bumpertopicname>fsensor_link_sensor_state</bumpertopicname> 
      <framename>fsensor_link</framename> 
    </plugin> 
  </sensor> 
</gazebo> 
</xacro:macro> 
</robot>
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-07-28 04:58:06 -0500

Seen: 662 times

Last updated: Feb 02 '17