Skip to content

Conversation

kcamroccm
Copy link

Fixes: #
Issue with to_eularian_angles() method where quaternions with pitches of -90 or 90 would not return the correct values. These pitches need to be handled differently

About

Handling the singularity that occurs when when the pitch is -90 or 90, to have to_eularian_angles() work for all rotations.

How Has This Been Tested?

I wrote several test scripts in another branch called to_euler_tests in my fork https://github.com/kcamroccm/Colosseum/tree/to_euler_tests/PythonClient/TMM

There is a pytest unit test in file test_to_euler.py that goes through random orientations with the singularity exactly, near the singularity, and fully random orientations, converts them back and forth using the utils.to_quaternion() and to_eularian_angles() and verifies that they are still equal within a threshold.

There is also a script called vision_pawn_rotation.py that I used to verify the conversion visually while connected to an to unreal. This also works with random orientation of the same types used the pytest script

Screenshots (if appropriate):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant