You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically, I want to implement this myself, and would like help knowing how it would be the best way to implement it.
The idea is to implement two conversion methods into the Quaternion class:
Returning the angles in any possible sequence (XYX, XYZ, etc).
The inverse operation, returning the Quaternion from the angles.
This way, we don't have to do the extra step converting it to a Matrix, which would greatly improve the performance. As an extra, every possible sequence would be implemented.
Feature description
I recently published an article about a direct formula for the conversion between a quaternion variable to Euler angles in any sequence, which can be read here (Open Access).
Compared to either having 12 separate formulas (or 24, taking into account both intrinsic and extrinsic rotations) or using the well known quaternion-to-matrix-to-euler method, this has 3 main advantages:
Numerically, it is up to 30 times faster than the previous quaternion-to-matrix-to-euler method (used both originally in SciPy and in transforms3d, for example).
It is a lot simpler to implement, debug and maintain than both methods.
It provides the simple formulas that can be used for theorerical work.
Because of points 1 and 2, it has already been merged into Scipy. Because point 3, it has also been merged into SymPy.
I truly believe it's the best possible way to do this conversion, so I'm trying to contribute it to as many open source projects I can!
Implementation considerations
I have some questions on how to implement this:
How should the variable defining the sequence be? In Scipy, for example, a 3 letter string is used. If the string is uppercase, the sequence is Intrinsic. If the variable is lowercase, it is Extrinsic.
Should I reimplement void setEuler(angle1, angle2, angle3, sequence) as a general function, and reimplement void setEuler(yaw, pitch, roll) and void setRPY(yaw, pitch, roll) as calls to the 4 parameter version?
Should I implement a void getEuler(angle1, angle2, angle3, solution_number, sequence) and then implement two 3 parameter functions as calls to this function?
What is the difference between both solutions in the getEuler functions as defined in the Matrix class?
The text was updated successfully, but these errors were encountered:
Feature request
Basically, I want to implement this myself, and would like help knowing how it would be the best way to implement it.
The idea is to implement two conversion methods into the
Quaternion
class:This way, we don't have to do the extra step converting it to a
Matrix
, which would greatly improve the performance. As an extra, every possible sequence would be implemented.Feature description
I recently published an article about a direct formula for the conversion between a quaternion variable to Euler angles in any sequence, which can be read here (Open Access).
Compared to either having 12 separate formulas (or 24, taking into account both intrinsic and extrinsic rotations) or using the well known quaternion-to-matrix-to-euler method, this has 3 main advantages:
SciPy
and intransforms3d
, for example).Because of points 1 and 2, it has already been merged into Scipy. Because point 3, it has also been merged into SymPy.
I truly believe it's the best possible way to do this conversion, so I'm trying to contribute it to as many open source projects I can!
Implementation considerations
I have some questions on how to implement this:
sequence
be? InScipy
, for example, a 3 letter string is used. If the string is uppercase, the sequence is Intrinsic. If the variable is lowercase, it is Extrinsic.void setEuler(angle1, angle2, angle3, sequence)
as a general function, and reimplementvoid setEuler(yaw, pitch, roll)
andvoid setRPY(yaw, pitch, roll)
as calls to the 4 parameter version?void getEuler(angle1, angle2, angle3, solution_number, sequence)
and then implement two 3 parameter functions as calls to this function?getEuler
functions as defined in the Matrix class?The text was updated successfully, but these errors were encountered: