RobotStudio event

Quaternion orientation

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?


  • msalminen


    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:



  • msalminen

    This is also good place to start


  • c63amg
    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.

    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]];
    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]];

  • PerSvensson
    The values in x axis of the target looks very strange (39000 mm!!!) have you moved the robot in RS? 
    Per Svensson
    Robotics and Vision Specialist
    Consat Engineering
  • c63amg
    target located in world coordinates.
  • Are you using a track ?

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

    Knud Erik Lindberg
    Jorgensen Engineering
  • And If you add all 4 quatraneon angles, it shoould be equal to 1.

  • hmilton
    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:
    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.

  • hmilton
    The attachment!