Ask Your Question
0

gazebo_ros_bumper_controller not updating bumper states

asked 2017-12-02 23:28:39 -0500

Als177 gravatar image

updated 2017-12-03 03:56:33 -0500

jayess gravatar image

I have been implementing this code. I am trying to echo the Contact messages but states does not echo any value even if it undergoes collision.Can someone please tell me where I am going wrong

<gazebo reference="base">
<sensor name="main_bumper" type="contact">
<geom>base_geom</geom>
    <selfCollide>true</selfCollide>
    <alwaysOn>true</alwaysOn>
    <updateRate>100.0</updateRate>
    <material>Gazebo/Red</material>
    <contact>
       <collision name="bump_sensor_collision_collision"></collision>
    </contact>
    <plugin name="gazebo_ros_bumper_controller" filename="libgazebo_ros_bumper.so">   
        <bumperTopicName>bumper_vals</bumperTopicName>
        <frameName>world</frameName>
    </plugin>
</sensor>
</gazebo>

</robot>

This is the output that I am getting :

header: 
  seq: 89604
  stamp: 
    secs: 584
    nsecs: 451000000
  frame_id: world
states: []
edit retag flag offensive close merge delete

Comments

I edited your question to make it more readable (using the preformatted text, or 101010 button) and moved your title to the body of the question, and gave it a more meaningful (to me) title...

jayess gravatar image jayess  ( 2017-12-03 04:00:18 -0500 )edit

Feel free to edit it but please keep in mind that having a short and direct title may help you get more people reading your question.

jayess gravatar image jayess  ( 2017-12-03 04:01:44 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-03-22 01:07:58 -0500

dan gravatar image

updated 2018-03-22 01:10:16 -0500

I think the problem is that you do not have a match between the collision name in base and the collision name in contact. Generate the sdf file with

gz sdf -p <your_filename>.urdf

and see if they match. The name generated in the sdf is a strange one. I see that you already discovered that it adds an extra "_collision" at the end. In my urdf files it puts other things into the name as well.

Also, I found that this did not work for me:

<collision name="bump_sensor_collision_collision"></collision>

I had to use this format (as well as getting the name right, of course):

<collision>bump_sensor_collision_collision</collision>
edit flag offensive delete link more

Comments

Hii, can you please explain what should be typed in the collision line.

Mrudul gravatar image Mrudul  ( 2018-07-08 05:39:40 -0500 )edit

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-12-02 23:28:39 -0500

Seen: 188 times

Last updated: Mar 22 '18