Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>> 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.

I would say you obscure it. You can certainly calculate it from the 4 quaternion parameters.

SolveSpace (Free CAD software) can be used to design assemblies and mechanisms from a set of parts with constraints. You can certainly build a gimbal with it by constraining the pieces. If you do it correctly, it will be possible to re-orient the final 3DoF part and the constraint solver will solve for the angles (assuming you built it that way).

Internally we treat all object orientations as quaternions, so this would just be using the algebraic constraint solver to find the angles. In practice there will be closed form solutions - with problems at gimbal lock.



>I would say you obscure it. You can certainly calculate it from the 4 quaternion parameters.

No it is an actual information loss.

There are multiple valid YPR solutions like my example illustrated.

There is NO way to determine which YPR out of the multiple possibilities was the original solution.

Something like solve space can only determine the original YPR with additional assumptions or the original YPR still referenced in memory.


Nope. The only thing you need to specify is the order the YPR angles are applied (that more a convention than an assumption). In SolveSpace the assembly constraints would effectively encode the order of application.

A quick Google search even turns up a Wikipedia entry on this problem: https://en.wikipedia.org/wiki/Conversion_between_quaternions...

If you really need this problem solve I might know someone willing to do paid consulting on it.


>If you really need this problem solve I might know someone willing to do paid consulting on it.

If you really need education in math and how to properly do trigonometry I will help you solve this problem for free. Just ask me questions. I'm super nice and won't go around fraudulently espousing an expertise in math and demanding people pay me to solve trivial math problems.

Frankly you are not even qualified to solve the problem yourself or give me a recommendation.

Especially when this problem is basically impossible to solve. I'll give you 10 thousand dollars if you can give me a quaternion that doesn't have multiple yprs here on HN. Literally, give me your venmo.

>Nope. The only thing you need to specify is the order the YPR angles are applied (that more a convention than an assumption). In SolveSpace the assembly constraints would effectively encode the order of application.

The term "yaw pitch roll" ALREADY has the order of the Euler angles applied. Let me tell you that order, it's: yaw, pitch and then roll.

Ypr is different from straight up Euler angles in that ypr has order fixed; hence the term "ypr"

With the order of angles fixed you still get multiple answers for a single quaternion. Why don't you try it in 3D space in your own head. Given A rotational orientation in 3D, find at least two yprs needed to arrive there.

Here maybe this will help you: a ypr of (0,0,0) is the same as a ypr of (180, 180, 180). These two yprs can only be represented by a single quat. Think about it. Given only a quat you cannot determine which ypr was used by the physical gimbal to realize this orientation. For solve space to know it must be making assumptions or holding onto information outside of the quat.

There free education for you and I didn't even ask you for a dime.


No, no, no. Wrong again. Please study basic trigonometry and read your own sources. Your own link proves you wrong.

The formula for conversion from quat to ypr involves arctan and arcsin. These functions yield multiple answers.

Additionally your own Wikipedia link explicitly states the existence of multiple answers, and that traditionally atan and asin in programming languages yield only one answer. I quote:

"Note, however, that the arctan and arcsin functions implemented in computer languages only produce results between −π/2 and π/2, and for three rotations between −π/2 and π/2 one does not obtain all possible orientations. To generate all the orientations one needs to replace the arctan functions in computer code by atan2"

Either way you misunderstand the math behind quaternions and you lack a basic grasp of trigonometry. Assuming you read your own Wikipedia link, what I said is categorically true.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: