Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replacing YPR state storaging with Hmd quaternion rotation state #8

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

pitboxx
Copy link

@pitboxx pitboxx commented Sep 14, 2024

When rotating HMD left and right, we encounter a gimbal lock situation. To avoid this, I suggest storing the HDD rotation state also in a quaternion, which rotates incrementally from the IMU sensor.

@pitboxx
Copy link
Author

pitboxx commented Sep 14, 2024

I also added moving the position offset to the direction of view of HMD

@r57zone
Copy link
Owner

r57zone commented Sep 14, 2024

Hi, thanks for your pull request, however if we reassign yprOffset we can no longer center the helmet in Euler angle mode, which is a pretty important feature

@pitboxx
Copy link
Author

pitboxx commented Sep 15, 2024

Added a reset and rotation of the HMD quaternion to current IMU readings inside SetCentering function. Now, when we press Num5, the helmet is centered.

@r57zone
Copy link
Owner

r57zone commented Sep 15, 2024

As soon as I can test it, I will accept your changes, thank you very much!

@pitboxx
Copy link
Author

pitboxx commented Sep 16, 2024

Thank you. I am glad to help you.

@r57zone
Copy link
Owner

r57zone commented Sep 25, 2024

Hi, I checked the fixes, unfortunately in "yaw, pitch, roll mode" the axes start "adding offsets" and stop working correctly.

Does everything work correctly for you?

@pitboxx
Copy link
Author

pitboxx commented Sep 25, 2024

Hello. Thank you for testing. I also just came across this effect of accumulation of rotation errors. I am currently in the process of finding a solution for this problem.

…46116.Revert "Apply reset to HMD Quaternion"This reverts commit 537d0f0.

Revert "Replacing YPR state storageing with Hmd quaternion rotation"

This reverts commit 310b73e.
@pitboxx
Copy link
Author

pitboxx commented Oct 5, 2024

Hello. I was able to eliminate the gimbal lock between the pitch and roll axes by sequentially applying separate rotation quaternions along each of the axes. Please check it with yourself.

@r57zone
Copy link
Owner

r57zone commented Oct 11, 2024

Thank you! I'll try to check it soon.

@r57zone
Copy link
Owner

r57zone commented Oct 27, 2024

Hi, I checked, it seems there is no cumulative offset now, but the axes seem to be incorrect. I will probably add something to the config for the axes settings and then implement your modifications.

@pitboxx
Copy link
Author

pitboxx commented Oct 27, 2024

Hi. I am glad to hear that the accumulation of errors has stopped. The order in which quaternions are applied is the basis of the fix to prevent Gimbal Lock. Please keep this in mind.

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.

2 participants