Forum Discussion
MShekow
12 years agoHonored Guest
Will orientation change after auto-magnetometer-calibration?
Hi there,
from other headtrackers I'm used to the fact that the orientation the HMD's API/SDK reports will jump (in Y) once the calibration has finished. This is so because once magnetometer calibration has been carried out, a yaw of 0 degrees means that you're looking north. I've not experienced such a jump in Y-values with the Oculus SDK and I'm just wondering whether this is done on purpose, or what you thoughts are about this.
Best regards!
Marius
from other headtrackers I'm used to the fact that the orientation the HMD's API/SDK reports will jump (in Y) once the calibration has finished. This is so because once magnetometer calibration has been carried out, a yaw of 0 degrees means that you're looking north. I've not experienced such a jump in Y-values with the Oculus SDK and I'm just wondering whether this is done on purpose, or what you thoughts are about this.
Best regards!
Marius
3 Replies
- jhericoAdventurerSteve LaVelle covers that in the OVR blog entry on Sensor Fusion here. It's desirable to prevent a sudden jump in the orientation because how disorienting that could be to the user.
In order to prevent a sudden jump, the SensorFusion code does small iterative adjustments over time, except in special conditions right at the beginning of the application. You can see the code here starting at line 211. - MShekowHonored GuestHi. Thanks for the response. The article and code part you mentioned is about tilt error, which is a bit different in its characteristic to yaw error. From my understanding, given that you want to avoid jumps in yaw if yaw-correction through the magnotometer-fusion is taking place, I assume that the SDK will not try to slowly align the HT orientation with true north, but it will take note of the angle difference between the current HT orientation yaw and the "magnetometer yaw", making sure the difference is kept stable, slowly correcting the HT in case of a drift.
Example (what I reckon is NOT being done by the SDK):
1) The magnetometer calibration finished when I was looking east in the real world (comfirmed by using a compass), even though in the application (e.g. a game) I was looking south.
2) I immediately turn my head left by 90 degrees, looking north in real world, while looking East in the application
3) I keep my head turned into this direction for minutes
4) During these minutes, my orientation in the application slowly changes from east to north, as it aligns with true north
What I think what happens:
1-3) as above
4) My orientation in the application stays east (were the magnetometer fusion not used, it might have drifted e.g. from 90 degrees around the Y axis to e.g. 85 degrees).
Correct so far? - jhericoAdventurerThe compass directions involved are completely irrelevant. The yaw correction works just like the tilt correction. The only difference is instead of having a known value representing the correct 'down' vector, you have to set reference points which basically consist of the current magenetic vector, and the current orientation.
If you enable magentic yaw correction without setting reference points, it will default to using the current orientation and magenetic reading as the starting value, as seen here. You could also set reference points explicitly by having the user 'look left', 'look right', etc... Once it has reference points, it will find the closest reference orientation to the current known orientation, and if that point is 'close enough', use the known magnetic vector to adjust the orientation incrementally into alignment, in exactly the same way as is done with the tilt correction. The code that does so is here and looks remarkably similar to the code for tilt correction, just above it.
Once the magnetic references are set, they do not drift over time. You can sit sideways at your desk as long as you like and the will either yaw correct your or not, depending on how far you are from the nearest reference point. The MagRefDistance is the criteria here and is compared to the result of 'Distance()' between the computed quaternion and the reference quaternion, and the default maximum distance is 0.5f. Unfortunately this doesn't represent a very well defined quantity, like degrees or radians. It also means that if you are oriented sufficiently far away from all the reference points, you yaw will be allowed to drift till it gets close enough to one to be corrected, at which point your actual magnetic vector will imply a large correction, and the yaw drift will bounce off the reference point and 'un-drift' back into alignment, and then be left free to drift again.
I think I'll experiment with the rift to see what the empirical effects of a single reference point are and how far a quaternion distance of '0.5' represents.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 6 months ago
- 4 years ago
- 7 months ago
- 1 year ago