Convert the coordinates from one TCP to another one

Greetings URCommunity,
I have an issue I was hoping you could help me with.
I have two TCPs, TCP1 and TCP2. I have the coordinates of TCP1 at the point 1 and when the robot is in this position, I want to know the coordinates of the TCP2. Manually, it is easy to do this. You only need to change the active TCP and check the new coordinate on the Move Tab. But how can this be done programmatically and, more importantly, mathematically because I need to know how to do this without running a program.
Best regards,
Pedro Monforte

Programming wise, it’s basically the same as doing it manually. After the UR stops at Point 1, set the TCP to number 2 and record the current position as a variable. I think the command is get_target_tcp_pose()

Mathematically will be more difficult. There is probably an easier way, but you could just do what the robot does. Look up (or measure/calculate) the offset from joint to joint, and use the angle for each joint the robot gives and trigonometry to calculate the current TCP location. I’m sure you can find examples online. Then use the physical robot or the robot model in a CAD program to check your work in different poses.

Hi,
Thank you for replying. By running a program, it is easy to do it. My issue was truly concerned with how to do it mathematically because I must be able to do this without running any program. I believe in the meantime to have found a solution.

Your Tool Center Points (TCPs) are defined as 6D poses relative to the robot base frame. Mathematically, you can treat these as vectors and apply standard vector operations for transformations and comparisons.

From a URScript perspective, it’s recommended to define TCPs using two variables and utilize the built-in pose_trans() and pose_inv() functions for pose composition and inversion, respectively.

Is offset between TCPs fixed in your case?