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

How do you calculate the tcp with an urdf file?

asked 2022-07-05 02:51:35 -0500

Qilos gravatar image

Hello,

im currently parsing an URDF file of an serial robot in c++ and was wondering how i calculate the transformation from the base to the TCP of the robot.

How would i need to do that, since there are joints and links. How would i need to code the transformation of that?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-07-05 14:31:27 -0500

pac48 gravatar image

You can calculate the transform of a robot link n relative to its base link with the following equation: T_base_to_n = T_base_to_1T_1_to_2...T_n-1_to_n. The T_k-1_to_k is determined with the values in the joint tag from the URDF file. The xyz value specified corresponds to the last column and first three rows of the transformation matrix, e.g. T_k-1_to_k(0:2, 3) = [x_k, y_k, z_k]. The rpy values are used to calculate the 3x3 rotation martrix R_k = RYaw(y_k)RPitch(p_k)RRoll(r_k), which corresponds to the first three rows and columns of T_k-1_to_k, e.g. T_k-1_to_k(0:2, 0:2) = R_k.

If you want to see an example, you can checkout this repo: https://github.com/pac48/robot_kinema...

edit flag offensive delete link more

Comments

@Qilos The discussion in #q193916 may also help.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-07-17 07:48:47 -0500 )edit

@pac48

Thanks for your answer it worked. Im just wondering what i would need to change if I want to change the angles of my joints?

I have my urdf file and i can read in the transformation matrices between the joints like you explained. And then multiplicate them to get the transformation from base to tcp. So how would i need to change the transformation matrices change the current angle of each joint?

Qilos gravatar image Qilos  ( 2022-07-26 05:15:48 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2022-07-05 02:51:35 -0500

Seen: 286 times

Last updated: Jul 05 '22