dorukeker / gyronorm.js

JavaScript project for accessing and normalizing the accelerometer and gyroscope data on mobile devices
MIT License
642 stars 65 forks source link

Mobile Firefox #37

Closed planUnd closed 7 years ago

planUnd commented 7 years ago

Hallo,

first of all greate project at lot of help!

I have a problem, using gyronorm on firefox mobile I get strange readings for data.do.beta when data.do.gamma > 0.

( EDIT): Chrome: gamma > 0 beta: 90-180 / -180 to -90 Chromium: gamma > 0 beta: 90-180 / -180 to -90 FireFox Mobile gamma > 0 beta: -90-0 / -180 to -90

these values are with the native settings of gyronorm.

Best Richard

dorukeker commented 7 years ago

Hello Richard,

Under the hood, Gyronorm is using the native JS devicemotion API.

Unfortunately Firefox and Chromium browsers return different range of values. It explained in the known issues section here http://caniuse.com/#feat=deviceorientation. For more details you can also check the related section in this e-book. https://leanpub.com/gyronormjs

One way to address this is to check the browser in JS and correct the values accordingly. This is not added to the library, because I did not want to insert any code that is vendor specific.

If they continue not fixing this, I might add this in the future. Since it is not gyronorm related, I will close the issue. Feel free to ask further in the thread though.

Cheers, Doruk