googlevr / cardboard

Open source Cardboard SDK and samples
Other
1.48k stars 252 forks source link

Too Much Drift #311

Open DaricXR opened 2 years ago

DaricXR commented 2 years ago

SPECIFIC ISSUE ENCOUNTERED

I am making an application in VR. The app is causing too much drifting while playing. as my app will be played while cycling and during cycling head of the user is continuously shaking due to which drifting is happening and I have to call recenter function every 15 to 20 seconds.

SMARTPHONE (please complete the following information):

STEPS TO REPRODUCE THE ISSUE

  1. Open VR app
  2. Shake head like you are cycling
  3. and it causes drifting

EXPECTED BEHAVIOR

IT must not cause too much drift

VERSIONS USED

What version of Google Cardboard are you using? Cardboard SDK/Cardboard XR Plugin 1.9

If you are using Cardboard XR Plugin:

LINK TO A REPOSITORY WITH CODE TO REPRODUCE THE BUG

Peny20 commented 2 years ago

Hi, I noticed drift too. Is it a bug or limitations of sensors in phone?

ghost commented 2 years ago

We've also been noticing this. Anyone else?

arilow commented 2 years ago

Thanks for reaching out to us! And sorry for the delay here. I confirm that we've been able to reproduce the reported bug.

In order to compute the head pose, the Cardboard SDK uses the data obtained from the phone’s accelerometer and the gyroscope. Given that the rotations along the yaw angle are normal to the earth’s surface, their tracking ends up relying only on the gyro data.

Taking into account that the gyro output is an angular velocity, it needs to be integrated so as to get the angular position. This computation has an intrinsic error which might accumulate over time, particularly when the head viewer moves continuously, causing this effect to be noticeable.

You can find further information about the gyroscope sensor on the Android official documentation and you can find the place where the Cardboard SDK integrates its data here.

Although several measures are taken in order to reduce the head pose uncertainty (for instance, using an Extended Kalman Filter to perform the sensor fusion), a ticket has been added to our backlog to analyze this issue and look for potential improvements that could be made. In case you find a suitable solution or improvement and you would like to share it with the community, please feel free to read CONTRIBUTING.md and follow the process to send a PR, contributions are welcome.

Thanks!