Giter Club home page Giter Club logo

Comments (6)

giladaya avatar giladaya commented on May 21, 2024 1

I implemented a solution using the new deviceorientationabsolute event, so it currently works only in Chrome for android (>50). For other devices, behavior will not change.
The basic idea is to have a second complementary filter step which fuses the calculated rotation quaternion with the rotation given by deviceorientationabsolute.
This takes care of the drift, but because the magnetometer is laggy, the user may see the scene moving even when her head is not moving. So to prevent this, I used an adaptive fusion factor which is equal to 0 below some radial velocity threshold.
This means that in the short term the user may experience yaw drift, but it should cancel out over time (assuming there will be some head movement)

I'm not sure that it's good enough for a PR, but in case someone finds it useful - it's available in my fork.

from webvr-polyfill.

borismus avatar borismus commented on May 21, 2024

This is not surprising. The problem complimentary orientation filter is
solving is not drift in general, but the visible drift caused by using the
magnetometer indiscriminately. In this case, you hold your cardboard still
and the world moves anyway. See my blog post about it.

On Sun, Jan 24, 2016, 6:06 AM iRomano [email protected] wrote:

Hi

I'm using ComplementaryOrientation, from your sample (
https://githubcom/borismus/webvr-polyfill/tree/master/fusion)
But i have an error with iPhone 5/5S, gyro is drift

If you were to place your phone flat and capture it's gyro-based position,
then pick it up, rotate it a bunch, and place it flat again, its integrated
gyro position might be quite different from what it was before


Reply to this email directly or view it on GitHub
#30.

from webvr-polyfill.

iRomano avatar iRomano commented on May 21, 2024

Hi
I read your article: http://smus.com/sensor-fusion-prediction-webvr/
And i used fusion - ComplementaryOrientation, prediction.
Maybe I poorly explained my problem.
If you pick up the phone and rotate it, then put in the original value, the value of event.alpha is another.
I found the event: event.webkitCompassHeading
Maybe it used to calibrate?
Is ComplementaryOrientation support this event?

from webvr-polyfill.

borismus avatar borismus commented on May 21, 2024

We do not currently have a fix for long term drift. It might be possible to
use the compass to help solve the problem, but it has to be done very
carefully since the magnetometer is notoriously noisy and unreliable. Even
in native cardboard sdk the problem is unresolved.

If you have ideas for solving the problem, please experiment with them and
send a PR to the polyfill :)

On Sun, Jan 24, 2016 at 9:05 PM iRomano [email protected] wrote:

Hi
I read your article: http://smus.com/sensor-fusion-prediction-webvr/
And i used fusion - ComplementaryOrientation, prediction.
Maybe I poorly explained my problem.
If you pick up the phone and rotate it, then put in the original value,
the value of event.alpha is another.
I found the event: event.webkitCompassHeading
Maybe it used to calibrate?
Is ComplementaryOrientation support this event?


Reply to this email directly or view it on GitHub
#30 (comment)
.

from webvr-polyfill.

giladaya avatar giladaya commented on May 21, 2024

Sorry to bring up an old issue, but unfortunately it's still relevant.

I too am trying to solve the absolute drift issue (which is not only related to iPhones BTW).
In my research, I found that there are several available algorithms intended for 9DOF sensor fusion (EG Mahony, Madgwick).
I'm still trying to wrap my head around the math in these algorithms, but I had to wonder whether my efforts are futile.

Meaning - what was the reason that none of the available algorithms were chosen in implementing the polyfill?
Were they tested and found to be unsuitable? Too time-consuming to implement? Too processor intensive?

I believe that the answers might save some time in attempts to solve this problem.

from webvr-polyfill.

borismus avatar borismus commented on May 21, 2024

Absolute drift is a hard problem. My experience with magnetometers in many phones is that they aren't reliable at all. The fusion in this project is pretty basic, but engineers on my team have spent a lot of time, and native implementations are more sophisticated.

They haven't quite cracked the absolute problem though. If you can improve on the sensor fusion in this project by fusing with magnetometer, very open to accepting PRs. But whatever you want to land would have to go through testing on a bunch of hardware.

from webvr-polyfill.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.