# Angle of the pose

**URL:** <https://forum.universal-robots.com/t/angle-of-the-pose/10811>\
**Category:** URScript\
**Created:** [December 14, 2020, 8:42pm UTC](https://forum.universal-robots.com/t/angle-of-the-pose/10811 "2020-12-14T20:42:35Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon59108369](https://avatars.discourse-cdn.com/v4/letter/a/f05b48/32.png) [@anon59108369](https://forum.universal-robots.com/u/anon59108369)\
**Post date:** [December 14, 2020, 8:42pm UTC](https://forum.universal-robots.com/t/angle-of-the-pose/10811/1 "2020-12-14T20:42:35Z")

</div>

Hi,  
I am planning to do a _minimum-jerk trajectory_. In order to achieve that I need to translate the angles given by the robot pose to Euler angles, therefore I have questions related to that topic:

1. When I get tcp pose the Rx,Ry,Rz are angles in **axis-angle** representation?

2. Is there any specific Euler angle representation that is recommended for use with the UR5e? There are XYZ, ZYX and many more and I am not sure if it matters which one I choose

---

<div class="post-metadata">

**Author:** ![anon59108369](https://avatars.discourse-cdn.com/v4/letter/a/f05b48/32.png) [@anon59108369](https://forum.universal-robots.com/u/anon59108369)\
**Post date:** [December 16, 2020, 8:49am UTC](https://forum.universal-robots.com/t/angle-of-the-pose/10811/2 "2020-12-16T08:49:14Z")

</div>

@Ebbe @ajp is any of you guys able to help out with this question please?

---

<div class="post-metadata">

**Author:** ![Ebbe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/ebbe/32/1413_2.png) [@Ebbe](https://forum.universal-robots.com/u/Ebbe)\
**Post date:** [December 16, 2020, 3:17pm UTC](https://forum.universal-robots.com/t/angle-of-the-pose/10811/3 "2020-12-16T15:17:45Z")

</div>

Hi @anon59108369,

Yes, as stated in the script manual. The poses are defined in axis-angle representation ([Axis–angle representation - Wikipedia](https://en.wikipedia.org/wiki/Axis%E2%80%93angle_representation))

Ebbe

---

<div class="post-metadata">

**Author:** ![ajp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/ajp/32/471_2.png) [@ajp](https://forum.universal-robots.com/u/ajp)\
**Post date:** [December 17, 2020, 2:33am UTC](https://forum.universal-robots.com/t/angle-of-the-pose/10811/4 "2020-12-17T02:33:04Z")

</div>

> [@Robot theory and how to use it in UR robots](https://forum.universal-robots.com/t/robot-theory-and-how-to-use-it-in-ur-robots/3863):
>
> This is the theoretical explanation on general robot manipulators and how to use it for the advanced applications with UR robots. Attached the URScript sample is written for the purpose of better understanding. However, it has not been tested so that it is possible to have errors. Looking forward to your awesome development with this! [Robotics in UR Robots\_March 2019.pdf](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/d/d4588fd696b452e4b6566f4f44ada81d9f6e6fe6.pdf) (1.5 MB) [robotics.zip](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/a/ace3805217576f15b30c4f93253de3b0af5473b1.zip) (3.1 KB)

Document uploaded in this thread may be of use.

---

<div class="post-metadata">

**Author:** ![anon59108369](https://avatars.discourse-cdn.com/v4/letter/a/f05b48/32.png) [@anon59108369](https://forum.universal-robots.com/u/anon59108369)\
**Post date:** [December 17, 2020, 3:05pm UTC](https://forum.universal-robots.com/t/angle-of-the-pose/10811/5 "2020-12-17T15:05:49Z")

</div>

The issue that I have is that when looking at polyscope I see the values of Rx,Ry,Rz, then change the value of one of those angles using the rotation arrow (ex. rotate around z) and instead of Rz changing, all the values change. How does it make any sense?

If I want to create a trajecotry which the robot follows can I do it using axis angle representation or it has to be in Euler?

---

<div class="post-metadata">

**Author:** ![ajp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/ajp/32/471_2.png) [@ajp](https://forum.universal-robots.com/u/ajp)\
**Post date:** [December 18, 2020, 4:04am UTC](https://forum.universal-robots.com/t/angle-of-the-pose/10811/6 "2020-12-18T04:04:03Z")

</div>

The arrows make adjustments in RPY format, but the values are displayed as axis angles. Look at the script functions rotvec2rpy() and rpy2rotvec(). If you want to define your rotations in a human comprehensible manner do it in RPY then convert to Rotation Vector to put into the target pose.

---

<div class="post-metadata">

**Author:** ![anon59108369](https://avatars.discourse-cdn.com/v4/letter/a/f05b48/32.png) [@anon59108369](https://forum.universal-robots.com/u/anon59108369)\
**Post date:** [December 18, 2020, 10:25am UTC](https://forum.universal-robots.com/t/angle-of-the-pose/10811/7 "2020-12-18T10:25:39Z")

</div>

@ajp i underdtand thanks a lot.  
I am operating the robot via UrScrpt and RTDE. I am using a PD controller that i defined to follow the trajectory that i have also defined. The following of position is giving me great results but i still cant wrap my head about following of the orientation

Do you know if i can just calculate the difference between current and desired angle in axis angle representation and make robot follow it? Or the angles have to be represented in RPY form?  
If there is an inbuilt function that translates the orientation representation I assume it has some purpouse? In what cases its better to use RPY over axis-angle representation?

---

<div class="post-metadata">

**Author:** ![ajp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/ajp/32/471_2.png) [@ajp](https://forum.universal-robots.com/u/ajp)\
**Post date:** [December 21, 2020, 2:11am UTC](https://forum.universal-robots.com/t/angle-of-the-pose/10811/8 "2020-12-21T02:11:52Z")

</div>

Prefacing this with the fact I also find these orientation formats a bit confusing! It’s fine to calculate and execute the target orientations directly in axis angle if you have a setup that can do so. Axis angle is ok to manipulate manually if you’re only rotating about one axis, but when you start wanting to rotate about multiple axis in a single motion it’s impossible to follow. RPY is just easier to work with if you’re trying to get your head around how the tool will move by imagining a toy Aeroplane 🙂

---

<div class="post-metadata">

**Author:** ![anon59108369](https://avatars.discourse-cdn.com/v4/letter/a/f05b48/32.png) [@anon59108369](https://forum.universal-robots.com/u/anon59108369)\
**Post date:** [December 21, 2020, 6:16pm UTC](https://forum.universal-robots.com/t/angle-of-the-pose/10811/9 "2020-12-21T18:16:25Z")

</div>

Thank you very much,  
I am not sure then why my method doesnt work and the robot doesnt follow the trajectory. At least now I know that it doesnt matter whether i use euler or axis-angle, so thats good to know 🙂

---

<div class="post-metadata">

**Author:** ![ajp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/ajp/32/471_2.png) [@ajp](https://forum.universal-robots.com/u/ajp)\
**Post date:** [December 22, 2020, 1:42am UTC](https://forum.universal-robots.com/t/angle-of-the-pose/10811/10 "2020-12-22T01:42:00Z")

</div>

Hi @anon59108369, the pose you send to the robot in p[x,y,z,rx,ry,rz] format must be in axis angle format though, you know that right?

---

<div class="post-metadata">

**Author:** ![anon59108369](https://avatars.discourse-cdn.com/v4/letter/a/f05b48/32.png) [@anon59108369](https://forum.universal-robots.com/u/anon59108369)\
**Post date:** [December 22, 2020, 7:16pm UTC](https://forum.universal-robots.com/t/angle-of-the-pose/10811/11 "2020-12-22T19:16:51Z")

</div>

Hi @ajp, yes I know that.  
I am not sending the poses to the robot, instead, I calculate the difference between current and desired position, velocity, orientation, and angular velocity and after multiplying them by a PD gains I get a PD controller which suppose to bring the robot to the desired position.  
It does work well for translation but not for rotation,which was the reason why I created this question on the forum
