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

DeviceOrientationController moving on its own #5

Open
marciopuga opened this issue Sep 8, 2014 · 6 comments
Open

DeviceOrientationController moving on its own #5

marciopuga opened this issue Sep 8, 2014 · 6 comments

Comments

@marciopuga
Copy link

Is the DeviceOrientationController weirdly moving on its own while you hold the device still? I cant get rid of it.

@richtr
Copy link
Owner

richtr commented Sep 8, 2014

Could you tell us what device, OS and browser (+ versions) are you using?

Is the movement jerky or are you experiencing small incremental drift?

This could be occurring for a number of reasons but we may be able to remove it by implementing a low/high pass filter on the raw data collected. This hasn't been added to date because the latest browser versions tend to provide already smoothed device orientation data. Have you tried this approach?

@marciopuga
Copy link
Author

Sorry, completely forgot this bit. I'm testing on a LG Nexus 4, Android Version 4.4.4, Chrome 37.0.2062.117,
Yes! it's a weird small incremental drift. I think the low/pass filter would actually smooth the results. Thanks for the idea.

@richtr
Copy link
Owner

richtr commented Sep 9, 2014

Let me know if you come up with anything here. I think this would be a useful addition to this project as it would also solve jerky sensor data I've observed being returned from older devices/browsers.

Other than that, incremental drift sounds like an implementation issue in sensor data being returned. It would be best to file such bugs against specific projects (e.g. Android and/or Chromium) so we can fix these issues at the platform level.

@marciopuga
Copy link
Author

After some testing I've also found out that (it sounds super obvious now) some of the drift was being caused by magnets affecting the compass. Easy to reproduce with headphones.

@marciopuga
Copy link
Author

This chromium issue [https://code.google.com/p/chromium/issues/detail?id=397824] might also explain a why the android native app behaves better with the drifts

@richtr
Copy link
Owner

richtr commented Sep 10, 2014

I've suggested that we use GAME_ROTATION_VECTOR for DeviceOrientation Event data @ http://lists.w3.org/Archives/Public/public-geolocation/2014Aug/0001.html. The main concern there is how we could then still be able to compute compass-based deviceorientation. Any thoughts here or on that mailing list would be great.

It's worth noting that iOS already does this. DeviceOrientation data in iOS is not based on magnetometer inputs (or, at least, that is my current understanding).

Interested in further thoughts you have here and whether we can provide any improvements at the JavaScript level or any further insights for the API standard.

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

2 participants