0
$\begingroup$

Rosanswers logo

Hi all,

I'm trying to simulate a force sensor located at the tip of my robot. I'm using ros indigo with gazebo 2.2. I went through this and this tutorials and I was able to publish the contact state of a box model using libgazebo_ros_bumper.so.

What I'm interested in is to use a proper force sensor with the associated force controller. I didn't found any documentation about that in Gazebo Tutorials website and I'm asking in the case someone has had the some issue.

I also found this archive of ros_controllers in which there is a force_torque_sensor_controller but I don't know how to use it.

Thanks for your help!


Originally posted by mrslvgg on ROS Answers with karma: 191 on 2015-11-29

Post score: 5


Original comments

Comment by filipposanfilippo on 2016-05-14:
Hi, I am also interested to achieve something similar. Did you figure out how to realise it?

Comment by mrslvgg on 2016-05-14:
I answered my question

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I finally figure out how to do this. Basicly, I added the ft_sensor plugin to my urdf.

Following my code:

<gazebo reference="${name}_fixed_base_joint">
    <provideFeedback>true</provideFeedback>
</gazebo>

<!-- The ft_sensor plugin -->  
<gazebo>
    <plugin name="ft_sensor" filename="libgazebo_ros_ft_sensor.so">
        <updateRate>100.0</updateRate>
        <topicName>ft_sensor_topic</topicName>
        <jointName>schunk_wsg50_fixed_base_joint</jointName>
    </plugin>
</gazebo>

some remarks:

  • this plugin works with a joint, in my case "${name}_fixed_base_joint" is the name of the joint connecting the robot to the end-effector and it is fixed type
  • have look at the plugin implementation to figure out the reference frame in which the wrench is given

Hope this can help. :)


Originally posted by mrslvgg with karma: 191 on 2016-05-14

This answer was ACCEPTED on the original site

Post score: 3


Original comments

Comment by mizu_lily on 2016-06-17:
I always get an error that the joint I want to cope with does not exist. Did you have the same problem before? And can you tell me how you define the inertial parameters to get a right measurement? Thanks a lot!

Comment by mrslvgg on 2016-06-17:
Sounds like probably you misspelled the joint name in the URDF. Consider that in my example code the parameter name contains the string schunk_wsg50. To be sure, fill both gazebo reference, and jointName tags with the correct joint name. All the inertial parameters of my robot remained untouched.

Comment by SorinV on 2017-07-20:
What type of joint are you using?

Comment by AlanSixth on 2019-05-24:
Sometimes I get the jointName: joint does not exist error too. It's certainly not a typo and I find that it depends on which specific joint on choose for a robot arm model with a mobile base. A potential solution: http://answers.gazebosim.org/question/13109/cant-find-specific-joint-when-using-gazebo-model-plugin-libgazebo_ros_ft_sensorso/

Comment by JoshuaElliott on 2020-12-09:
This worked for me, below is the macro for the entire joint that I add the sensor to

 <xacro:macro name="fixed_joint_macro" params="xyz name parent child limit">
  <joint name="${name}" type="prismatic">
   <parent link="${parent}"/>
   <child link="${child}"/>
   <origin rpy="0 0 0" xyz="${xyz}"/>
   <axis xyz="1 0 0"/>
   <limit effort="1000" lower="-0.0001" upper="0.0001" velocity="10"/>
  </joint>

<gazebo reference="${name}">
    <provideFeedback>true</provideFeedback>
</gazebo>

<!-- The ft_sensor plugin -->  
<gazebo>
    <plugin name="ft_sensor" filename="libgazebo_ros_ft_sensor.so">
        <updateRate>100.0</updateRate>
        <topicName>sensor_${name}</topicName>
        <jointName>${name}</jointName>
    </plugin>
</gazebo>
</xacro:macro>
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.