Closed mpomarlan closed 7 years ago
Could you please add the comments from this PR as a doc string to the function? In my humble opinion that would be really useful.
I can't be bothered going into the math details, so I trust @mpomarlan on that one. But I did test if the euler->quaternion
and the proposed quaternion->euler
are an inverse of each other and they are.
Function is defined so that (except for numerical precision error)
(lambda (arg) (apply #'cl-tf:euler->quaternion (cl-tf:quaternion->euler arg)))
is equal to arg when arg is of type cl-tf:quaternion. Also
(lambda (arg) (cl-tf:quaternion->euler (apply #'cl-tf:euler->quaternion arg)))
is equal to arg, except in cases where the pitch is +/-0.5*pi. In such cases, the resulting roll is set to zero and the resulting yaw is set to the difference (pitch pi/2) or sum (pitch pi/-2) of the yaw and roll values in arg.