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

Revision history [back]

click to hide/show revision 1
initial version

A quaternion multiplied by any real number represents the same rotation. If they are assumed/enforced to be of unit length (pretty much always) that leaves you with two possible quaternion representations for any rotation, q and -q. If you want the result to always be the same, you can check which hemisphere the quaternions lies in and change the sign accordingly (i.e., if w < 0 then q = -q).

I think the only time the sign might be of interest is when interpolating between two quaternions (e.g., with SLERP). Depending on the respective signs of the two quaternions of interest you will get one of two interpolated paths (geodesics on the unit sphere in R4 representing all quaternions). One with be the "long" and the other the "short" path.

A quaternion multiplied by any real number represents the same rotation. If they are assumed/enforced to be of unit length (pretty much always) that leaves you with two possible quaternion representations for any rotation, q and -q. If you want the result to always be the same, you can check which hemisphere the quaternions quaternion lies in and change the sign accordingly (i.e., if w < 0 then q = -q).

I think the only time the sign might be of interest is when interpolating between two quaternions (e.g., with SLERP). Depending on the respective signs of the two quaternions of interest you will get one of two interpolated paths (geodesics on the unit sphere in R4 representing all quaternions). One with be the "long" and the other the "short" path.

A quaternion multiplied by any real number represents the same rotation. If they are assumed/enforced to be of unit length (pretty much always) that leaves you with two possible quaternion representations for any rotation, q and -q. If you want the result to always be the same, you can check which hemisphere the quaternion lies in and change the sign accordingly (i.e., if w < 0 then q = -q).

I think the only time the sign might be of interest is when interpolating between two quaternions (e.g., with SLERP). Depending on the respective signs of the two quaternions of interest you will get one of two interpolated paths (geodesics on the unit sphere in R4 representing all quaternions). One with will be the "long" and the other the "short" path.