# TCP reorientation tool?

**URL:** <https://tech-community.robotics.abb.com/t/tcp-reorientation-tool/4888>\
**Category:** Robot Controller\
**Created:** [May 24, 2012, 2:51pm UTC](https://tech-community.robotics.abb.com/t/tcp-reorientation-tool/4888 "2012-05-24T14:51:56Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![philhoward](https://avatars.discourse-cdn.com/v4/letter/p/f04885/32.png) [@philhoward](https://tech-community.robotics.abb.com/u/philhoward)\
**Post date:** [May 24, 2012, 2:51pm UTC](https://tech-community.robotics.abb.com/t/tcp-reorientation-tool/4888/1 "2012-05-24T14:51:56Z")

</div>

Hi,

I hear there is a program you can use to invert the orientation of a TCP quickly - does anyone know where I can get it from? On other robots where rotation is done through Euler angles, not Q1-4, you just invert the X, Y or Z value, depnding on which way you want to the robot to move in tool..

---

<div class="post-metadata">

**Author:** ![USLuser1](https://avatars.discourse-cdn.com/v4/letter/u/a698b9/32.png) [@USLuser1](https://tech-community.robotics.abb.com/u/USLuser1)\
**Post date:** [May 24, 2012, 11:25pm UTC](https://tech-community.robotics.abb.com/t/tcp-reorientation-tool/4888/2 "2012-05-24T23:25:58Z")

</div>

There are ways that you can mathematically invert your pose. ABB uses the quaternion method (q1,q2,q,3,q4), other robots use a homogeneous transform matrix (HTM).

Are you trying to invert the positions during execution or offline?

---

<div class="post-metadata">

**Author:** ![philhoward](https://avatars.discourse-cdn.com/v4/letter/p/f04885/32.png) [@philhoward](https://tech-community.robotics.abb.com/u/philhoward)\
**Post date:** [May 25, 2012, 7:07am UTC](https://tech-community.robotics.abb.com/t/tcp-reorientation-tool/4888/3 "2012-05-25T07:07:43Z")

</div>

Offline.

I think i’ve managed it offline with converting the pose to Euler angles, inverting the relevant one, then converting back to quaternions. A little messy, but looks like I’ll get there.

---

<div class="post-metadata">

**Author:** ![szily85](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@szily85](https://tech-community.robotics.abb.com/u/szily85)\
**Post date:** [August 13, 2012, 3:12pm UTC](https://tech-community.robotics.abb.com/t/tcp-reorientation-tool/4888/4 "2012-08-13T15:12:29Z")

</div>

Hello buddys 🙂

I faced a problem and cant resolv.  
I want to read the angles of the robot with the GetEuler but I always have a error message:  
Unexpected identifier “:=”…

my code is:

VAR num anglex;  
VAR pose object;

anglex:=GetEuler(X,object.rot);

Why is this error appears? “Object” should be some exact data in my prog or just a VAR like above? I`m stucked and can`t move on. :nauseated\_face:

Can someone help, please? It`s urgent!

Thanks

---

<div class="post-metadata">

**Author:** ![USLuser1](https://avatars.discourse-cdn.com/v4/letter/u/a698b9/32.png) [@USLuser1](https://tech-community.robotics.abb.com/u/USLuser1)\
**Post date:** [August 13, 2012, 6:08pm UTC](https://tech-community.robotics.abb.com/t/tcp-reorientation-tool/4888/5 "2012-08-13T18:08:24Z")

</div>

I think it may be a typo in the manual.

there is no instruction “GetEuler”, but there is a “EulerZYX”. Try changing “GetEuler” command to “EulerZYX”

---

<div class="post-metadata">

**Author:** ![szily85](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@szily85](https://tech-community.robotics.abb.com/u/szily85)\
**Post date:** [August 14, 2012, 8:14am UTC](https://tech-community.robotics.abb.com/t/tcp-reorientation-tool/4888/6 "2012-08-14T08:14:05Z")

</div>

The error message still appears! I tried many ways, but nothing. I have no idea what is wrong. ☹

My task is to get the actual angle of the axis 5 and compare it with on predifined angle.

This is what I want to manage.

Idea???

---

<div class="post-metadata">

**Author:** ![Steve\_Murphy](https://avatars.discourse-cdn.com/v4/letter/s/0ea827/32.png) [@Steve\_Murphy](https://tech-community.robotics.abb.com/u/Steve_Murphy)\
**Post date:** [August 14, 2012, 10:36am UTC](https://tech-community.robotics.abb.com/t/tcp-reorientation-tool/4888/7 "2012-08-14T10:36:29Z")

</div>

Hello,

While you have probably solved the problem by now, the problem was most likely in another part of the code above the line in question.

The following code has no errors and compiles:  
Proc TestProc()  
VAR num anglex;  
VAR pose object;  
anglex:=EulerZYX(X,object.rot);  
endproc

Steve

---

<div class="post-metadata">

**Author:** ![USLuser1](https://avatars.discourse-cdn.com/v4/letter/u/a698b9/32.png) [@USLuser1](https://tech-community.robotics.abb.com/u/USLuser1)\
**Post date:** [August 14, 2012, 1:34pm UTC](https://tech-community.robotics.abb.com/t/tcp-reorientation-tool/4888/8 "2012-08-14T13:34:56Z")

</div>

[QUOTE=szily85]The error message still appears! I tried many ways, but nothing. I have no idea what is wrong. ☹

My task is to get the actual angle of the axis 5 and compare it with on predifined angle.

This is what I want to manage.

Idea???  
[/QUOTE]

If all you want is the motor angle, just use the “ReadMotor” command

[code]VAR num MotorAngle\_5;  
…  
MotorAngle\_5:=ReadMotor(5);

[/code]  
It returns the motor angle in radians.

---

<div class="post-metadata">

**Author:** ![szily85](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@szily85](https://tech-community.robotics.abb.com/u/szily85)\
**Post date:** [August 14, 2012, 1:46pm UTC](https://tech-community.robotics.abb.com/t/tcp-reorientation-tool/4888/9 "2012-08-14T13:46:41Z")

</div>

Yeah, I already changed to this option, it`s more simple. I founded this also in documentation. But anyway thanks a lot guys 😉

---

<div class="post-metadata">

**Author:** ![Ramazan](https://avatars.discourse-cdn.com/v4/letter/r/e0b2c6/32.png) [@Ramazan](https://tech-community.robotics.abb.com/u/Ramazan)\
**Post date:** [January 6, 2022, 7:54pm UTC](https://tech-community.robotics.abb.com/t/tcp-reorientation-tool/4888/10 "2022-01-06T19:54:45Z")

</div>

Hello  
if u wanna know target orieantation or u wanna change it

This is my example i used

VAR robtarget object;  
VAR num anglex;  
VAR num angley;  
VAR num anglez;  
VAR orient angles;

object:=Target\_27;  
anglex := EulerZYX(\X, object.rot);  
angley := EulerZYX(\Y, object.rot);  
anglez := EulerZYX(\Z, object.rot);  
angley:=angley+45; yada ! angley:=+45;

object.rot:= OrientZYX(anglez , angley , anglex);  
target27:=object;

OR  
tool tooldata

angles:=tooldata\_1.tframe.rot;  
anglex:=EulerZYX(\X,angles);  
angley:=EulerZYX(\Y,angles);  
anglez:=EulerZYX(\Z,angles);
