I'm currently trying to implement a force_torque sensor to the end-effector of a UR5. I've found examples of F/T plugins being used but i cant seem to implement them properly. I would try to check if my plugins are valid using rostopic list but the plugin i'm working on doesnt show.
I've looked at these two examples of using F/T plugins, but i'm not sure if i'm using them correctly. https://github.com/CentroEPiaggio/force-torque-sensor/blob/master/model/ft_sensor.gazebo.xacro http://docs.ros.org/jade/api/gazebo_plugins/html/group__GazeboRosFTSensor.html
I can't seem to find a tutorial for an F/T plugin specifically, nor can i find a tutorial to implement the F/T to a robot end-effector.
I'm using the UR5 model found in the ros-kinetic-universal-robot package, I'm currently modifying the ur5.urdf.xacro and ur.gazebo.xacro files since i'm still learning. later on i'd like to write a separate xacro file that contains the sensors and the plugins.
If someone can point me in the right direction, it would be greatly appreciated.
Originally posted by lr101095 on Gazebo Answers with karma: 1 on 2018-03-07
Post score: 0
Original comments
Comment by lr101095 on 2018-03-08:
@josephcoombe @sloretz
are there any methods you are aware of that can be inserted into the robot.urdf or ur.gazebo?
Comment by josephcoombe on 2018-03-09:
@ir101095 Sorry, I don't understand what you mean by "methods". Could you clarify?
Whichever force/torque plugin you end up using - I recommend testing it on a simple .urdf first, and then adding it to a more complicated robot once you've proved to yourself that it works as you expect!
Comment by lr101095 on 2018-03-11:
@josephcoombe what i meant by "methods" was instead of writing up a plugin as a separate file and in a c++ and then calling it later, do either of you know of an example that involves inserting a section of code directly into the urdf of the universal robot that sets up the plugin?
not sure if i clarified enough.
I've been trying to look for force_torque examples that have been implemented directly into the robot packages (urdf, launch and gazebo files etc)
Comment by josephcoombe on 2018-03-12:
@Ir101095 In order to get force-torque joint data, you have to use a Gazebo Plugin defined via C++. However, you do not necessary need to write that Plugin yourself because there are already 2 force/torque plugins (that I know of): http://gazebosim.org/tutorials?tut=force_torque_sensor&cat=sensors and https://github.com/ros-simulation/gazebo_ros_pkgs/blob/kinetic-devel/gazebo_plugins/src/gazebo_ros_ft_sensor.cpp
Comment by josephcoombe on 2018-03-12:
@lr101095 in my answer below, I set up the Force/Torque Sensor plugin in my .urdf - have you tried using my answer as a template in your own robot? You should have all the pieces. The Force/Torque sensor is included in Gazebo 7 - you just need to declare it in your .urdf - and I've provided the code for a gazebo_transport_to_ros node. Let me know if that answers your question or not.
Comment by lr101095 on 2018-03-13:
@josephcoombe how do i call your gazebo_transport_to_ros_topic.cpp and make sure that it' actually using that program to setup the plugin? i'm not sure which directory i should be putting the cpp in. i've already included your templates for urdf and the launch and i have edited them as needed. but the ros node still doesnt show up in rostopic list
Comment by lr101095 on 2018-03-13:
@josephcoombe I'm also not sure what to do for the pkg part in
I'm assuming this package is where the cpp may be found, but as mentioned above, i'm not sure where to put the cpp and where to call it from.
Comment by josephcoombe on 2018-03-14:
@lr101095 the gazebo_transport_to_ros_topic.cpp should be called via a .launch file as shown in my answer. My gazebo_transport_to_ros_topic.cpp node DOES NOT setup the Gazebo Force/Torque Plugin. The Gazebo Force/Torque Plugin gets set up automatically by Gazebo when the urdf is loaded via the gazebo_ros spawn_urdf node (not shown in my example). You should place the .cpp file in the src directory of a ROS Package - also amend your CMakeLists (I've updated my answer).
Comment by josephcoombe on 2018-03-14:
@lr101095 the pkg attribute should be the package where you placed the .cpp file (my_pkg_gazebo/src/gazebo_transport_to_ros_topic.cpp) - make sure you modify that package's CMakeLists.txt to properly compile a C++ node (I've amended my answer slightly).