-
Notifications
You must be signed in to change notification settings - Fork 42
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
Up and Down orientation changes heading #18
Comments
May be related: #14 I fixed some inconsistencies when the device is rotated to landscape, perhaps that PR helps. |
It doesn't seem to be working, still the same observations. The phone isn't rotated to landscape in this case at all. It just gives funny values when leaning back or forwards. Shouldn't it give always the same heading value in this case? Just think about the real use-case, when adapting this library e.g. show compass on apps. The compass direction should not change if you change the angle of the phone, right?! |
I see, that is probably something different then. Do you see this in iOS, Android, or both? I know iOS has a bunch of options to tell it what's the origin so you could handle phone movements. For Android, however, I'm afraid it will most likely need some math expert to solve it as it is purely done in code without any help from the OS. |
Just gave it a quick test and it seems like it happens only on Android? Seems to be working as you would expect in iOS (same orientation with the phone almost vertical and almost flat) |
From my experience, it seems to work better in this library then in others I've tried. Thank you for the lib and your support so far! 👍🏼 |
Yes, doesn't work on Android. I haven't tried on iOS but it's most likely as you described...works on iOS but not on Android. There seems to be always some differences between these platforms, e.g. the sensor values in Android have to be multiplied by -9.81 in order to get comparable results to iOS (you can google why it's like this). |
@jahau the difference is that the iOS version of the code relies entirely on the framework (no math, no odd sensor usage, just a simple query). On the other hand, the Android version has to combine 2 or 3 different sensors data (manually), multiply some matrices and do a bunch of things to get the value. When I reviewed the android code, I looked into a bunch of alternatives and different SO questions and the code was more or less always the same, so I don't know what could be missing. Alternatively, the android version could try to use the GPS/Location libraries, but that would sadly require user location permission (I gave it a quick try a while ago and it was really bad too). |
Is it by design that up and down movement (z changes) orientation changes also the compass value? Or is it just a bug with React Native 0.64.0? Thanks.
The text was updated successfully, but these errors were encountered: