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

Gimbal lock #2

Open
JCJutson opened this issue Jan 16, 2019 · 4 comments
Open

Gimbal lock #2

JCJutson opened this issue Jan 16, 2019 · 4 comments
Labels
bug Something isn't working

Comments

@JCJutson
Copy link

Seems like gimbal lock is an issue when testing out on my phone.
https://en.wikipedia.org/wiki/Gimbal_lock

@rikschennink
Copy link
Owner

If it wasn't for Gimbal Lock I would've released it a week ago. It's really tricky to wrap my non-math brain around. Any ideas on fixing it are more than welcome.

All we need is to map the relative beta and gamma rotation to the x and y-axis.

@JCJutson
Copy link
Author

The code here can compute the quaternion from the alpha, beta, gamma values:
https://www.w3.org/TR/2016/CR-orientation-event-20160818/#worked-example-2
Then tracking the changes from the quaternion instead of from alpha, beta, gamma should fix it?

@rikschennink
Copy link
Owner

I believe I tried this earlier but will give it another go.

@rikschennink rikschennink added the bug Something isn't working label Jan 16, 2019
@DanielJoyce
Copy link

DanielJoyce commented Jan 17, 2019

You can also prevent the angles from going to exactly zero/max to prevent gimble lock. No one will notice if an angel never goes to less than 0.0001 degrees.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants