Calculate Offset between TCPs?

I’m having trouble calculating an offset between TCPs.

I have two probes on the end-effector, mounted 20mm apart in X and 0mm apart in Y.

My block of code looks like this:

set -->TCP to Probe1
Assignment: var1 = get_actual_tcp_pose()
set--> TCP to Probe2
Assignment: var2 = get_actual_tcp_pose()

offset = p[var1[0]-var2[0], var1[1]-var2[1], etc.]
 

However, the offset for X is larger than expected (~50mm rather than the expected 20mm).

Is this an incorrect way to calculate an offset between TCPs?

Thanks!

Hi @jpomo,
you can take into account all coordinates of TCP in this way:

tcp1 = get_actual_tcp_pose()
tcp2 = get_actual_tcp_pose()
offset = pose_trans(pose_inv(tcp1), tcp2)

1 Like

Got it! Thank you for the reply!