I have two question after analyze cardboard code:
1.is the method {GetHeadPose(headData);} for get original data for gyro?
and then can you explain the significance of the data ? Can I do something for the data?
2.I want to know the method {Orientation = Quaternion.LookRotation(matrix.GetColumn(2), matrix.GetColumn(1));} of handle the gyro data, can you explain the method do what or optimization algorithm to solve my question of gyro drift in some phone such as sumsung Note3 and le1 pro
1) GetHeadPose returns the native SDK's idea of the current head orientation (and offset, if you have the neck model enabled). The native SDK tracks this by integrating and filtering the raw gyro values, with some prediction as well to account for the time to render the next frame.
In Unity, you can get the raw gyro through Input.gyro (http://docs.unity3d.com/ScriptReference/Input-gyro.html)
2) The use of Quaternion.LookRotation() is to convert the orientation from Matrix4x4 to a Quaternion. In the matrix, column 2 is the rotated Z axis and column 1 is the rotated Y axis, so calling Quaternion.LookRotation() with them returns a quaternion that rotates the Z and Y axes to this orientation.
As for drift, the native SDK tries to account for drift by detecting when you set the phone down, and looking at the gyro rates that occur at that time. Some phones defeat this algorithm because their sensors are too noisy for it to ever detect that you have put the phone down. We're still trying to tune the algorithm to cover more phones.
@smdol: We also have problems with constantly drifting gyros, but I know,it's hard to correct wrong sensor data via code. We've been asked, if it's possible, to use the compass to correct the drift over time. I know, that the compass values are even more jittery, but sometimes we have a drift >90 degrees... maybe there could be correction if the head movement is not fast, What do you think?
We just released v0.8 which has more gyro improvements. Can you try it? Since we renamed all the classes, I suggest testing with a build of the demo scene in a fresh project and running it on your phone to test the drift.
v0.8 still drifts here (Note 4) , but this android open source app has a Gyro mode that has no Drift:
https://play.google.com/store/apps/details?id=org.hitlabnz.sensor_fusion_demo
i wonder if someone could apply that to cardboard SDK
We are also getting drift in v.08, Mainly testing on a Samsung S6. Now getting desperate for a fix.
v0.9.1 still has drift issue , does it have any plan to improve drift issue?
Drift is something that will improve with each SDK update but it's not something that will every be "fixed" for everyone, because you actually have to do calibration and measurement for each phone and some phone hardware is simply never going to be good enough. This is a big part of why we created the Daydream Ready phone program.