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

Angle Z shifted after rotating many times ,although X & Y were perfect ? #33

Open
Elkhawaga opened this issue May 30, 2019 · 2 comments

Comments

@Elkhawaga
Copy link

Angle Z shifted after rotating many times by -40 or 20 or -11 ,...
but X & Y angles didn't effected even when moving fast

you are using coff of Gyro & Acc in Angle X ,Angle Y
but in Z angle you didn't made that , Why?

angleX = (gyroCoef * (angleX + gyroX * interval)) + (accCoef * angleAccX);
angleY = (gyroCoef * (angleY + gyroY * interval)) + (accCoef * angleAccY);
angleZ = angleGyroZ;

thanks alot for your wonderful effort :)

@tockn
Copy link
Owner

tockn commented Jun 3, 2019

Because we cannot calculate angleZ by using accelerometer, so I use only gyro sensor in calculating angleZ.
If you want to more accurate angleZ, you can use other sensor together. (ex: geomagnetic sensor)

@nhphuong91
Copy link

You can find detailed explanation as well as many more useful information here:
https://www.w3.org/TR/motion-sensors/#relative-orientation-sensor

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

No branches or pull requests

3 participants