ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

To expand on Andy's answer, the order determines whether you're applying a global or local rotation.

q3 = quaternion_multiply(q1, q2)

Here q3 is the local rotation of q2 on q1
or
the global rotation of q1 on q2


q3 = quaternion_multiply(q2, q1)

Here q3 is the local rotation of q1 on q2
or
the global rotation of q2 on q1


In your case, you wanted to apply a global rotation of q2 on q1 -
i.e. apply the rotation q2 according to q1's parent coordinate frame (the coordinate frame on which q1 was applied initially


Further reading / maths:
https://answers.unity.com/questions/810579/quaternion-multiplication-order.html# https://math.stackexchange.com/questions/2124361/quaternions-multiplication-order-to-rotate-unrotate/2125858#2125858

To expand on Andy's answer, the order determines whether you're applying a global or local rotation.

q3 = quaternion_multiply(q1, q2)

Here q3 is the local rotation of q2 on q1
or
the global rotation of q1 on q2


q3 = quaternion_multiply(q2, q1)

Here q3 is the local rotation of q1 on q2
or
the global rotation of q2 on q1


In your case, you wanted to apply a global rotation of q2 on q1 -
i.e. apply the rotation q2 according to q1's parent coordinate frame (the coordinate frame on which q1 was applied initiallyinitially)


Further reading / maths:
https://answers.unity.com/questions/810579/quaternion-multiplication-order.html# https://math.stackexchange.com/questions/2124361/quaternions-multiplication-order-to-rotate-unrotate/2125858#2125858 https://math.stackexchange.com/questions/2124361/quaternions-multiplication-order-to-rotate-unrotate/2125858#2125858