Ask Your Question

ur10 end-effector tf

asked 2019-02-25 03:01:49 -0500

raghad.husari gravatar image

updated 2019-02-27 08:15:36 -0500

gvdhoorn gravatar image


I am using ur10 ros driver to get the position of a mounted drilling pin on the end-effector of the robot. I want to do a transformation between the end-effector (tool0_controller) and the drilling pin frames. I measured the distance and orientation between them and tried to do a static transformation as the following but can't see any changes when I echo the /tf topic

  <node pkg="tf" type="static_transform_publisher" name="tool0_controller" args=" 
   0.5 0 2  
   0.707  0.707 0 0 
    /base_link/base /base_link/base/tool0_controller 500"/>

Any clue?

Edit: Simply the question is that I am trying to control a drilling pin that is mounted on the end-effctor of the ur10 robot (tool0_controller frame). I tried the static transformation above but it wasn't working

I tried to add a new frame to tool0_controller and this is the code I am using but the problem here is that: the pose published by drillingPin frame is relative to the tool0_controller not to the base.

  #include <ros/ros.h>
  #include <tf/transform_broadcaster.h>
  #include <geometry_msgs/PoseStamped.h>

  int main(int argc, char** argv){
  ros::init(argc, argv, "my_tf_broadcaster");
  ros::NodeHandle node;
  tf::TransformBroadcaster br;
  tf::Transform transform;

  ros::Rate rate(10.0);
  while (node.ok()){
    transform.setOrigin( tf::Vector3(0.0, 2.0, 0.0) );
    transform.setRotation( tf::Quaternion(0, 0, 0,1) );
    br.sendTransform(tf::StampedTransform(transform, ros::Time::now(), "tool0_controller", "drillingPin"));
  return 0;

I am pretty sure this is a common application to universal robots but can't find useful tutorials. Your help is highly appreciated!

edit retag flag offensive close merge delete


Can you clarify what you want to do exactly? You cannot "override" a TF frame being published by ur_modern_driver, so that wouldn't work.

I'm also confused by this:

/base_link/base /base_link/base/tool0_controller

which frames are these supposed to be?

Finally: 500 is the period, not ..

gvdhoorn gravatar imagegvdhoorn ( 2019-02-25 03:31:51 -0500 )edit

.. the frequency/update rate, so this is only publishing at 2 Hz. Probably not what you intended.

gvdhoorn gravatar imagegvdhoorn ( 2019-02-25 03:32:09 -0500 )edit

I mounted a drilling pin on the end-effector and want to get the position of that drilling pin from the ur driver. The position of the drilling pin is located at specific distance relative to the tool0-controller frame, let's say at x=0.5, y=0 and z=2 with no orientation.

raghad.husari gravatar imageraghad.husari ( 2019-02-25 04:39:24 -0500 )edit

the parent frame is /base_link/base and the child frame is /base_link/base/tool0_controller, I am trying to apply a static transformation to shift the child frame to the drilling pin position

raghad.husari gravatar imageraghad.husari ( 2019-02-25 04:41:00 -0500 )edit

tool0_controller is a frame that is published by ur_modern_driver, you cannot "shift it". Your publisher will conflict with the driver.

I'm still confused, but I would recommend you introduce a new frame that encodes the location of your drilling pin relative to tool0_controller.

gvdhoorn gravatar imagegvdhoorn ( 2019-02-25 05:27:25 -0500 )edit

Please see my reply below @gvdhoorn

raghad.husari gravatar imageraghad.husari ( 2019-02-27 07:30:35 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-02-27 08:27:24 -0500

gvdhoorn gravatar image

This shouldn't be so difficult and wouldn't even require writing a custom TF broadcaster.

If you have a custom frame that is relative to tool0_controller, you have two options:

  1. if it's a static frame (ie: does not include any dynamic rotation or translation): use static_transform_publisher. Something like this would add the frame you show in your edit:

    rosrun tf2_ros static_transform_publisher 0 2.0 0 0 0 0 1 tool0_controller drillingPin

    Two things to note:

    1. don't use uppercase characters in TF frame names (or any graph resource): see wiki/Names.
    2. ROS uses metres for distances, so the 2.0 you have there results in a Y-translation of 2 metres relative to tool0_controller. Most likely not what you intended.
  2. add drillingPin as a link to your composite xacro/urdf (the one that combines the UR xacro with your end-effector) and use a fixed type joint to link the two together. The robot_state_publisher will then do all the hard work for you.

Which of the two options you choose doesn't really matter I believe. The static_transform_publisher would need to run all the time, so would result in an additional node, but seeing as it's a static TF frame, won't result in too much overhead.

I tried to add a new frame to tool0_controller and this is the code I am using but the problem here is that: the pose published by drillingPin frame is relative to the tool0_controller not to the base.

re: not relative to base: well, no. You specify it as a transform relative to tool0_controller, so it's exactly as you specified.

That doesn't mean you can't query TF for the transform between base and drillingPin though.

edit flag offensive delete link more

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: 2019-02-25 03:01:49 -0500

Seen: 121 times

Last updated: Feb 27