RobotStudio event

Calculate quaternions

 Hi,
 

Does anyone know how the quaternions are calculated in robotstudio ?

Because if I use the code below to add the quaternions (to make a new target), the values that I gave (0,0.86,0) aren't the same of the quaternions of my new target.

I just have to give the quaternions a value that I can choose.

 

Where can I find functions that calculate euler angles to quaternions ? (C#)

 

Can someone help me with this problem ?

 

 

myTarget.Transform.RX = 0;

myTarget.Transform.RY = 0.86;

myTarget.Transform.RZ = 0;

Comments

  • Hi,

    RX/RY/RZ aren't quaternions, they are Euler angles. The Matrix4 class contains methods and properties for setting and getting the orientation in various formats.

    regards,
    Johannes

    Johannes Weiman
    Software Engineer
    ABB Robotics
  • Ok I can use this function, cause I have to use euler angles.

    Can you give me an example how I should convert this euler angles to correct quaternions, cause I'm not very familiar with these functions.

     

    If I use the code below the euler angles are incorrect converted to quaternions.

    (As you can see in the convertor and in the new targets in robotstudio.)

    How can I solve this problem ?

     

    myTarget.Transform.RX = 50;
    myTarget.Transform.RY = 60;
    myTarget.Transform.RZ = 110;
     
    image
     



     
     
     

  • RobotStudio uses the ZYX convention for Euler angles (in the GUI; the API also supports XYZ). So I think you need to change the "Rotation Order" in the converter (to 321 probably).

    regards,
    Johannes

    Johannes Weiman
    Software Engineer
    ABB Robotics
  • Hi,
     

    Thanks for your help! It works like you said.

     

    My only problem now is that my axes configuration as you can see in the image below is incorrect. Target_10 (1) is just the same as My_target_8 (2) but the axes configuration is not the same.

     

    How can I automatically change these axes configuration in C# ?

    Can you give me an example ?

     

    image

     

    Regards,

     

     
  • Hi
    This may give you some hints regarding how to modify configuration data

     

    image
    Per Svensson
    Robotics and Vision Specialist
    Consat Engineering
  • alternatively you can turn confl or confj off in the robot. But you then have to be carefull that you dont force the robot to a strange configuration.