Ask Your Question

How do I use force sensor/ bumper sensor in Gazebo

asked 2012-03-05 14:38:32 -0600

kichistays gravatar image

updated 2014-01-28 17:11:34 -0600

ngrennan gravatar image

I am designing a biped robot model in gazebo. I am trying to add force sensors on the bottom of the foot, but I don't know what parameters I need to do that.. so far this is what I have written in my urdf.xacro file. If I correct if the sensor got implemented then it should publish the sensor data, right?? .Please let me know if I am missing something or have written it wrong.

 <link name="R_leg">
  <origin xyz="0 0.0 -0.124" rpy="0 0 0 "/> 
  <mass value="0.15" />
  <inertia  ixx="1.0" ixy="0.0"  ixz="0.0"  iyy="1.0"  iyz="0.0" izz="1.0" />
  <origin xyz="0 0.0 -0.124" rpy="0 0 0 "/>
    <box size="0.1 0.12 0.25" />
  <origin xyz="0 0.0 -0.124" rpy="0 0 0 "/>
    <box size="0.1 0.12 0.20" />

</link> <gazebo reference="R_leg"> <material>Gazebo/White</material> <turngravityoff>false</turngravityoff> </gazebo>

<link name="R_foot"> <inertial> <origin xyz="0 0.0 -0.010" rpy="0 0 0"/> <mass value="0.15"/> <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/> </inertial> <visual> <origin xyz="0 0.0 -0.010" rpy="0 0 0"/> <geometry> <box size="0.2 0.12 0.02"/> </geometry> </visual> <collision> <origin xyz="0 0.0 -0.010" rpy="0 0 0"/> <geometry> <box size="0.2 0.12 0.02"/> </geometry> </collision> </link> <gazebo reference="R_foot"> <material>Gazebo/Red</material> <turngravityoff>false</turngravityoff> </gazebo>

<joint name="R_leg3_joint" type="revolute" &gt;="" <origin="" xyz="0 0.0 -0.250" rpy="0 0 0"/> <parent link="R_leg"/> <child link="R_foot"/> <axis xyz="0 1 0"/> <limit effort="30" velocity="1" lower="-1.0" upper="1.0"/>
<joint_properties damping="0.0" friction="0.0"/> </joint>

<body:empty name="R_foot_force_model_name">
      <sensor:contact name="R_foot_contact_sensor">
      <controller:gazebo_ros_bumper name="R_foot_contact_controller" plugin="">
        <interface:bumper name="dummy_bumper_iface" />

Second Question : I dont understand how gazebo_ros_f3d works.. cause i get force and torque zero all the time... should it not show gravity as one of the forces... this is what i have written

<controller:gazebo_ros_f3d name="gazebo_ros_Lf_force" plugin=""> <alwayson>true</alwayson> <steptime>0.001</steptime> <updaterate>1000.0</updaterate> <bodyname>L_foot</bodyname> <topicname>L_foot_force</topicname> <framename>map</framename> <interface:position name="p3d_L_foot_force"/> </controller:gazebo_ros_f3d>

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-03-06 03:20:43 -0600

DimitriProsser gravatar image

updated 2012-03-06 08:57:28 -0600

<sensor:contact name="contact_sensor">
  <controller:gazebo_ros_bumper name="gazebo_ros_bumper_controller" plugin="">
      <interface:bumper name="bumper_iface" />

The main thing you're missing is the <geom> tag that specifies what link will act as the bumper.


I've made my urdf example less generic. The <geom> tag is named based on the link you want to act as a bumper. This means that the name base_link_geom would make base_link a bumper. If you did front_right_wheel_geom, it would make front_right_wheel the bumper. You append "_geom" to the link name to set that link as your bumper.

edit flag offensive delete link more


Hi, i'm trying to add a contact bumper to my robot, I add a box a create a controller as you say here. Currently I had a /bumper/state topic been published but the states[] are empty all the time (even if I collide my robot with a wall). What should be the output of this topic?

jrcapriles gravatar image jrcapriles  ( 2012-04-12 06:20:04 -0600 )edit

Your robot must have collision for this to work.

DimitriProsser gravatar image DimitriProsser  ( 2012-04-13 03:36:32 -0600 )edit

hii, I added a contact sensor to my model but cannot find it in the rostopic list. I installed gazebo_ros_control package, is it enough or should I install any other.. please help me..

Mrudul gravatar image Mrudul  ( 2018-07-08 04:09:53 -0600 )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


Asked: 2012-03-05 14:38:32 -0600

Seen: 3,451 times

Last updated: Mar 07 '12