While investigating pose rotations while implementing linear export for UR in #44 i stumbled upon very strange euler angles returned by euler_angles_by_matrix, traced it to Maya returning not 0 but very small values sometimes and feeding these almost 0 values to atan2 returns wild results.
While investigating pose rotations while implementing linear export for UR in #44 i stumbled upon very strange euler angles returned by
euler_angles_by_matrix
, traced it to Maya returning not 0 but very small values sometimes and feeding these almost 0 values to atan2 returns wild results.https://github.com/AutodeskRoboticsLab/Mimic/blob/3c33ea07b29c7e11268fb99078e3afe46c097971/mimic3/scripts/robotmath/transforms.py#L153
I added a step to round down to 0 very small values to prevent that, seems to fix the issue.
Example matrix returned by Mimic/Maya:
instead of the expected
which results in
[-98.39746772339547 -90.0 -89.99999999999997]
instead of the correct[-90,0,-90]
.