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

Add a low-pass noise filter. #6

Merged
merged 2 commits into from Aug 2, 2016
Merged

Add a low-pass noise filter. #6

merged 2 commits into from Aug 2, 2016

Conversation

jaredsinclair
Copy link
Contributor

On some devices, the rotation rates exhibit a low-level drift on one or more rotation axes. The symptom expressions are not identical, but they appear to be related to low component quality (iPhone 5c versus higher end devices) and/or rough usage (drops, etc).

Test devices Kilo and Juliet (both iPhones 5c) are affected. Lay them flat on a table or hold them absolutely still in your hand, and you'll see the camera drift up or down to the min/max y values, and in an infinite rotation in the x direction.

In an ideal scenario, we could ask users to calibrate their gyroscopes and apply a corrective factor to all inputs. Barring that, the next best thing we can try is to add a low-pass filter which ignores input less than a given threshold. In my non-scientific testing with the only affected devices at my disposal, I found that a noise threshold between 0.10 and 0.15 filtered out the noise with a minimal loss in sensitivity. Less than 0.10 and the 360 camera position starts to drift. I'm using 0.12 for now.

See also: https://forums.developer.apple.com/thread/12049

@cdzombak
Copy link
Contributor

cdzombak commented Aug 1, 2016

👍 I am happy with this change.

Adding @thiagopnts as a second reviewer for a sanity-check, since this calculation code isn't mine.

@jaredsinclair
Copy link
Contributor Author

BTW I'm certain the phenomenon I'm seeing is not a bug in our code because the compass app on one of the affected devices is profoundly affected. The other device asked me to perform a calibration on launch and it seems fine (I don't know if there's a way to force a recalibration except to reinstall the OS).

@cdzombak
Copy link
Contributor

cdzombak commented Aug 1, 2016

Either way, I think calibration is app-specific and I don't foresee us offering that in our app, particularly if this solution works well enough.

@jaredsinclair
Copy link
Contributor Author

jaredsinclair commented Aug 1, 2016

An interesting side note: despite the fact that the system Compass app's level mode asked me to calibrate the Juliet test device, that calibration info is not fed back into CoreMotion. The buggy behavior was the same in our app before and after the Compass app level mode calibration.

@jaredsinclair
Copy link
Contributor Author

@cdzombak Just saw your comment. Yep.

@thiagopnts
Copy link
Contributor

nice, it LGTM. Are those devices in the office? I want to test on the web library, this probably happens on it too

@jaredsinclair
Copy link
Contributor Author

Toni has them locked away. Juliet and Kilo. iPhone 5c

Sent from my iPhone

On Aug 1, 2016, at 8:28 PM, Thiago Pontes notifications@github.com wrote:

nice, it LGTM. Are those devices in the office? I want to test on the web library, this probably happens on it too


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@cdzombak cdzombak merged commit 68d73c4 into develop Aug 2, 2016
@cdzombak cdzombak deleted the fix/noise-filter branch August 2, 2016 14:02
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

Successfully merging this pull request may close these issues.

None yet

3 participants