# Calibrate TCP\_2 Offset From TCP\_1

**URL:** <https://forum.universal-robots.com/t/calibrate-tcp-2-offset-from-tcp-1/22798>\
**Category:** General Application Help: How do I?\
**Created:** [July 20, 2022, 2:59pm UTC](https://forum.universal-robots.com/t/calibrate-tcp-2-offset-from-tcp-1/22798 "2022-07-20T14:59:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![scott.bruins](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/scott.bruins/32/2680_2.png) [@scott.bruins](https://forum.universal-robots.com/u/scott.bruins)\
**Post date:** [July 20, 2022, 2:59pm UTC](https://forum.universal-robots.com/t/calibrate-tcp-2-offset-from-tcp-1/22798/1 "2022-07-20T14:59:39Z")

</div>

We have two grippers mounted at opposing 45° angles from the tool flange. When commanded to move the the same spot gripper 2 is slightly off from gripper 1. I want to calibrate the gripper 2 TCP (TCP\_2) based on a fixed point set by the first gripper (TCP\_1). Here is basically what I have so far.

set\_tcp(p[0.14701,0.0,0.14701,0.0,0.7854,0.0])  
_move TCP\_1 to calibration point_  
TCP\_1\_Point1=get\_actual\_tcp\_pose()  
set\_tcp(p[-0.14701,0.0,0.14701,0.0,-0.7854,0.0])  
_move TCP\_2 to calibration point_  
TCP\_2\_Point1=get\_actual\_tcp\_pose()  
TCP\_Offset=pose\_sub(TCP\_1\_Point1, TCP\_2\_Point1)

Where I am getting stuck is the TCP\_Offset is in relation to the Base coordinate system but I need to translate it in relation to TCP\_1\_Point1 and apply it to the TCP\_2 so it moves to the same position (For Example: if the Y was off +2mm the TCP would need a -2mm Y value to compensate).

Edit: I was doing my math wrong, I needed to do TCP\_Offset=pose\_trans(pose\_inv(TCP\_2\_Point1), TCP\_1\_Point1).
