0
$\begingroup$

Rosanswers logo

Hi,

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"));
    rate.sleep();
  }
  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!


Originally posted by raghad.husari on ROS Answers with karma: 3 on 2019-02-25

Post score: 0


Original comments

Comment by gvdhoorn on 2019-02-25:
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 ..

Comment by gvdhoorn on 2019-02-25:
.. the frequency/update rate, so this is only publishing at 2 Hz. Probably not what you intended.

Comment by raghad.husari on 2019-02-25:
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.

Comment by raghad.husari on 2019-02-25:
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

Comment by gvdhoorn on 2019-02-25:
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.

Comment by raghad.husari on 2019-02-27:
Please see my reply below @gvdhoorn

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by gvdhoorn with karma: 86574 on 2019-02-27

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

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