Add bumper plugin and read the state [closed]
Hello,
I'm trying to add a bumper plugin in Gazebo and read the state by the topic in ROS, but I can't ge it. All that I get is add the object and read this:
header:
seq: 16
stamp:
secs: 0
nsecs: 0
frame_id: my_box
states: []
Time doesn't change and states is empty.
The urdf file is:
<?xml version="1.0"?>
<robot name="simple_box"
xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor"
xmlns:controller="http://playerstage.sourceforge.net/gazebo/xmlschema/#controller"
xmlns:interface="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface"
xmlns:xacro="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface" >
<link name="my_box">
<inertial>
<mass value="1.0" />
<origin xyz="1 0 0" />
<inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="100.0" iyz="0.0" izz="1.0" />
</inertial>
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<box size="0.2 0.2 0.2" />
</geometry>
</visual>
<collision>
<!-- collision origin is defined w.r.t. link local coordinate system -->
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<box size="0.2 0.2 0.2" />
</geometry>
</collision>
</link>
<gazebo reference="my_box">
<sensor name="gripper_contact_sensor" type="contact">
<always_on>true</always_on>
<update_rate>10.0</update_rate>
<contact>
<collision>collision</collision>
</contact>
<plugin name="gripper_bumper" filename="libgazebo_ros_bumper.so">
<bumperTopicName>bumper</bumperTopicName>
<frameName>my_box</frameName>
</plugin>
</sensor>
</gazebo>
I saw in some answers that I need to add '<geom>my_box_geom</geom>' [link] , but it doesn't work. I also tried with 'test_bumper' in gazebo_plugins, but neither works.
I use ROS Groovy, Gazebo 1.5 and Ubuntu 12.04 (I can't update, but I tried the same in Ros Hydro and...the same result).
Could someone say how add it correctly? or if you see any mistake in the file... Thank you!