# Quaternion orientation

**URL:** <https://tech-community.robotics.abb.com/t/quaternion-orientation/6871>\
**Category:** RobotStudio\
**Created:** [November 3, 2015, 12:04am UTC](https://tech-community.robotics.abb.com/t/quaternion-orientation/6871 "2015-11-03T00:04:20Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![c63amg](https://avatars.discourse-cdn.com/v4/letter/c/7bcc69/32.png) [@c63amg](https://tech-community.robotics.abb.com/u/c63amg)\
**Post date:** [November 3, 2015, 12:04am UTC](https://tech-community.robotics.abb.com/t/quaternion-orientation/6871/1 "2015-11-03T00:04:20Z")

</div>

CONST robtarget X:=[[10,5,7],[0.006563,0.695311,0.718618,-0.009363],[-2,0,1,0],[-2,1,2,0,9E9,9E9]];

CONST robtarget X:=[[x,y,z position],[Quaternion orientation],[configuration],[extended axis]];

Does anyone have a good resource on “Quaternion orientation”

What is this? What does it describe? Do I need to really start developing my knowledge of it to program better?

---

<div class="post-metadata">

**Author:** ![msalminen](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@msalminen](https://tech-community.robotics.abb.com/u/msalminen)\
**Post date:** [November 4, 2015, 6:27am UTC](https://tech-community.robotics.abb.com/t/quaternion-orientation/6871/2 "2015-11-04T06:27:18Z")

</div>

Hi,

You don’t need to know everything about quaternions to program robots, but it’s good to know the basics of it and in general about rotation and different ways to represent rotation (Rotation Matrix, Euler, Quaternion, Axis Angle, etc.)

In a nutshell:

1. Euler angles are very difficult to use mathematically. They are ambiguous (there are 12 different formulations) and become singular at certain attitudes (Gimbal lock). Their only positive aspect is that people are somewhat familiar with roll, pitch and yaw angles, so eulers are more human understandable.

2. The DCM (Direction Cosine matrix) is complex to use but is stable.

3. Quaternions are easy to compute, are efficient, have no singularities and don’t suffer ambiguity. The only downside is that quaternions are regarded as mysterious, almost magical, and impossible to be understood.

You can start here:

> **[Quaternion](https://en.wikipedia.org/wiki/Quaternion)**
>
> In mathematics, the quaternion number system extends the complex numbers. Quaternions were first described by the Irish mathematician William Rowan Hamilton in 1843 and applied to mechanics in three-dimensional space. The set of all quaternions is conventionally denoted by 
>   
>     
>       
>  
>         
> H
>         
>  
>       
>     
> {\\displaystyle \\ \\mathbb {H} \\ }
>   
> ('H' for Hamilton) or by 
> H. Quaternions are not a field because multiplication of quaternions is not  
>   
> ...

> **[QuaternionReport1.pdf](https://web.mit.edu/2.998/www/QuaternionReport1.pdf)**
>
> 846.32 KB

[http://www.mth.kcl.ac.uk/~salamon/AGT23.pdf](http://www.mth.kcl.ac.uk/~salamon/AGT23.pdf)

Regards,

Mika

---

<div class="post-metadata">

**Author:** ![msalminen](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@msalminen](https://tech-community.robotics.abb.com/u/msalminen)\
**Post date:** [November 4, 2015, 6:36am UTC](https://tech-community.robotics.abb.com/t/quaternion-orientation/6871/3 "2015-11-04T06:36:44Z")

</div>

This is also good place to start

[http://noelhughes.net/uploads/quaternion\_training.pdf](http://noelhughes.net/uploads/quaternion_training.pdf)

Mika

---

<div class="post-metadata">

**Author:** ![c63amg](https://avatars.discourse-cdn.com/v4/letter/c/7bcc69/32.png) [@c63amg](https://tech-community.robotics.abb.com/u/c63amg)\
**Post date:** [November 4, 2015, 6:07pm UTC](https://tech-community.robotics.abb.com/t/quaternion-orientation/6871/4 "2015-11-04T18:07:23Z")

</div>

Thanks Mika. My name is Micah, nice to meet you.

I am mirroring targets/paths/robot across my world y-z, and the quanternion units are the only ones I don’t fully understand. I am running into some weird validation errors where the mirrored path will auto configure and be reachable everywhere, but it will then error during simulation and I run into coupling errors, out of position errors…  
I would just like to be confident my robot wires don’t tangle because of weird rotation.

Actual:  
CONST robtarget p1060Sec1\_10:=[[-39338.6,877.738,2644.25],[0.04491202,0.697822308,0.713224314,-0.048353021],[1,-3,2,-1],[-34164,135,2400,0,9E9,9E9]];  
Mirror:  
CONST robtarget mirror\_Sec1\_10:=[[39338.6,877.738,2644.25],[0.048353,0.713224,0.697822,-0.044912],[1,-3,2,-1],[34164,45,2400,0,9E9,9E9]];

---

<div class="post-metadata">

**Author:** ![PerSvensson](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/persvensson/32/1040_2.png) [@PerSvensson](https://tech-community.robotics.abb.com/u/PerSvensson)\
**Post date:** [November 5, 2015, 5:22pm UTC](https://tech-community.robotics.abb.com/t/quaternion-orientation/6871/5 "2015-11-05T17:22:42Z")

</div>

The values in x axis of the target looks very strange (39000 mm!!!) have you moved the robot in RS?

---

<div class="post-metadata">

**Author:** ![c63amg](https://avatars.discourse-cdn.com/v4/letter/c/7bcc69/32.png) [@c63amg](https://tech-community.robotics.abb.com/u/c63amg)\
**Post date:** [November 5, 2015, 5:40pm UTC](https://tech-community.robotics.abb.com/t/quaternion-orientation/6871/6 "2015-11-05T17:40:48Z")

</div>

target located in world coordinates.

---

<div class="post-metadata">

**Author:** ![Knud\_E\_Lindberg](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/knud_e_lindberg/32/4450_2.png) [@Knud\_E\_Lindberg](https://tech-community.robotics.abb.com/u/Knud_E_Lindberg)\
**Post date:** [November 6, 2015, 9:37am UTC](https://tech-community.robotics.abb.com/t/quaternion-orientation/6871/7 "2015-11-06T09:37:42Z")

</div>

Are you using a track ?

It looks like the path i is mirroed over the y axis. x=-39000 to x=39000

---

<div class="post-metadata">

**Author:** ![Muthukumar](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@Muthukumar](https://tech-community.robotics.abb.com/u/Muthukumar)\
**Post date:** [November 10, 2015, 7:08am UTC](https://tech-community.robotics.abb.com/t/quaternion-orientation/6871/8 "2015-11-10T07:08:49Z")

</div>

And If you add all 4 quatraneon angles, it shoould be equal to 1.

---

<div class="post-metadata">

**Author:** ![hmilton](https://avatars.discourse-cdn.com/v4/letter/h/d07c76/32.png) [@hmilton](https://tech-community.robotics.abb.com/u/hmilton)\
**Post date:** [November 10, 2015, 7:08am UTC](https://tech-community.robotics.abb.com/t/quaternion-orientation/6871/9 "2015-11-10T07:08:59Z")

</div>

Attaching a tool I made for converting to/from quaternions. It also has an overview, in text, of the different types of expressing a frame rotation.  
The tool runs under the free Wolfram CDF Player. Can be downloaded here:  
[http://www.wolfram.com/cdf-player/](http://www.wolfram.com/cdf-player/)  
Once installed the CDF Player will take ~2.7 GB of disc space.

I use this tool regularly in my work. Its fast and accurate.

---

<div class="post-metadata">

**Author:** ![hmilton](https://avatars.discourse-cdn.com/v4/letter/h/d07c76/32.png) [@hmilton](https://tech-community.robotics.abb.com/u/hmilton)\
**Post date:** [December 1, 2015, 9:16am UTC](https://tech-community.robotics.abb.com/t/quaternion-orientation/6871/10 "2015-12-01T09:16:19Z")

</div>

The attachment!
