Rotations with quaternions
Guys I work at a company that uses Quaternions for rotations of physical objects. PTUs we call them (Pan Tilt Units).<p>I am telling you Quaternions have HUGE issues. These issues become much more apparent when you deal with physical objects.<p>Here&#x27;s the thing Quaternions don&#x27;t exist in reality. It represents an orientation of rotation but it completely masks the path took to achieve that orientation.<p>For every gimbal in reality there is an actual YawPitchRoll (YPR) that was executed to achieve that orientation. AS soon as you convert that real YPR into a Quaternion you lose the YPR that was needed to achieve that orienation.<p>So let&#x27;s say I need to have one gimbal imitate the position of another gimbal. I take the YPR given to me by gimbal &quot;A&quot; convert the YPR to a Quat, send that Quat over the wire to Gimbal &quot;B&quot; and convert that Quat back to YPR to feed to the gimbal so it can rotate itself to imitate the orientation of gimbal A.<p>The quat is a higher entropy form of information. Now when converting back to YPR there are MULTIPLE YPRs that yield the same orientation. You can derive a YPR that is out of bounds of the physical gimbal.<p>Literally you can get a YPR that tells your gimbal to Yaw 190 and pitch all the way back past 90 to 170 degrees and roll 180 degrees until it&#x27;s right side up. This YPR is identical to a yaw of 10, a pitch of 20 and 0 roll. Quaternions hide the original YPR, you lose information so when you receive a Quaternion it&#x27;s hard to translate it into a physical realization of the orientation.<p>The company I work for doesn&#x27;t realize this. They used Quaternions from day one and we have all kinds of headaches like this when we try to extract the YPR and use these orientations in the real world. Actually I should say only I have these headaches. A lot of people haven&#x27;t figured out this problem yet.<p>The only time you should use Quats are if you need to transform an orientation or you&#x27;re dealing with virtual objects that have no rotational limits. Everybody thinks quats are magic and better. They are not. They have huge downsides. Huge.