RobotStudio event

About the "FillFromEulerAngles" method in the PC SDK

Options
HI everyone : I try to use EulerAngle calculation Orient by the "FillFromEulerAngles" method and I did a test. By the method of " ToEulerAngles()" convert a prepared quaternion to euler Angle. after that transform the EulerAngle into quaternion with "FillFromEulerAngles " method . It's a piece of my code: Orient ori_Base = new Orient(); Orient ori_Test = new Orient(); double x; double y; double z; ori_Base.Q1 = 0.707106781; ori_Base.Q2 = 0.707106781; ori_Base.Q3 = 0; ori_Base.Q4 = 0; ori_Base.ToEulerAngles(out x, out y, out z); ori_Test.FillFromEulerAngles(x,y,z); BUT .. "ori_Base" and " ori_Test" is not equal.... I think they should be the same Thanks for anyone's advice AND i 'm sorry for my bad english...

Comments

  • John_Verheij
    Options
    I just run your code and i got these values for "ori_Base" and "ori_Test":
    • ori_Base: [0.707106781, 0.707106781, 0, 0]
    • ori_Test: [0.707106781373095,0.707106781,7.45058059692383E-09,7.45058059692383E-09]
    The Orient type consist of four doubles (Q1, Q2, Q3, Q4). Comparing floating numbers is a bit tricky, because they are stored as binary fractions. Furthermore I do not how the "ToEulerAngles" and "FillFromEulerAngles" are implemented (rounding / normalization / etc).

    If you check the difference between both values, then you will see that is less than 1E-08 (means that are the same...)


  • monti_123
    monti_123
    edited May 2017
    Options
    Thanks buddy.   I got it。  @  John_Verheij