matrix to euler: create new list and round to 0 if very small to prevent atan2 problems #46
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.Mimic/mimic3/scripts/robotmath/transforms.py
Line 153 in 3c33ea0
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]
.