ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

xyz position tracking of UR10

asked 2019-08-20 05:12:52 -0600

stefvanlierop gravatar image

updated 2019-08-20 05:18:21 -0600

Hi all, I am currently working on a UR10 robot that has to do a certain contact operation on parts. i have the trajectory execution working and it executes the operation almost flawlessly aside from the start and stop of the operation. Therefore i need to be able to get the realtime position of the TCP link of the robot. I have been looking at TF2 but i am not sure if i can use it this purpose as it seems it only publishes the transform matrix. I have also been looking at the ROS navigation stack but it says it is only in 2d and it looks like it is for robots that actually move their entire base in space. I probably need something that does use TF2 but then calculates the position. Thanks in advance

edit retag flag offensive close merge delete

Comments

Can you please clarify: Do you want to control the robot or just observer its tcp position?

ct2034 gravatar image ct2034  ( 2019-08-20 05:35:21 -0600 )edit

i do not want to change the trajectory when it is running, I indeed just want to observe the robot when it is running said trajectory.

stefvanlierop gravatar image stefvanlierop  ( 2019-08-20 05:45:40 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2019-08-20 06:53:24 -0600

gvdhoorn gravatar image

Therefore i need to be able to get the realtime position of the TCP link of the robot. I have been looking at TF2, [..]

this would indeed seem like a task you could use TF for.

i am not sure if i can use it this purpose as it seems it only publishes the transform matrix.

I'm not sure what you mean by this, as "the transform matrix" would seem to be exactly what you'd need (unless you are wondering where the rotation part has gone, but that is included as well).

TF will give you the transform between any two frames in your TF tree. For your case, that would probably be some base frame (perhaps even the base frame in the UR10's urdf) and some tool frame (or the default tool0 frame).

Asking TF for that transform will immediately tell you where the tool frame is wrt the base frame.

That transform is the pose of the TCP (relative to the base you've chosen of course).

If you'd like to track this over time, then perform periodic lookups of that same transform.

A rather arbitrary -- but illustrative -- example of this may be found here: floweisshardt/atf/atf_metrics/src/atf_metrics/calculate_path_length.py.

edit flag offensive delete link more

Comments

i might have been confused by looking at the TF topic that the UR already publishes, I will get back to you when i have implemented the suggestions.

stefvanlierop gravatar image stefvanlierop  ( 2019-08-20 08:10:34 -0600 )edit

If you're using ur_modern_driver then you could use tool0_controller instead of the regular tool0. It would be the same transform though.

gvdhoorn gravatar image gvdhoorn  ( 2019-08-20 08:38:07 -0600 )edit
1

answered 2019-08-20 06:47:34 -0600

ct2034 gravatar image

updated 2019-08-20 07:12:57 -0600

You need a tf listener. Depending on your frame names, you need something like this:

transformStamped = tfBuffer.lookupTransform("base", "tool0", ros::Time(0));

You xyz are in transformStamped.transform.x and y, z respectively.

See https://docs.ros.org/kinetic/api/tf2_... or https://wiki.ros.org/tf2/Tutorials/Wr... for more info.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-08-20 05:12:52 -0600

Seen: 696 times

Last updated: Aug 20 '19