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

[VisionGlass] Improve reliability of phone pointer #1709

Merged
merged 2 commits into from
Jan 22, 2025
Merged

Conversation

svillar
Copy link
Member

@svillar svillar commented Jan 22, 2025

We used to get the data about the phone orientation from the TYPE_GAME_ROTATION_VECTOR which is not aligned with the geomagnetic field of earth, and thus does not have a fixed reference frame. As the docs say, this might cause drift in the measurements as time passes by. Replacing it by TYPE_ROTATION_VECTOR should improve that.

As the phone and the glasses use different reference frames we need to translate the info from the phone to the reference frame of the glasses, that's why we now need to store that translation of reference frames in a quaternion and apply it on each frame. The good part is that we don't need to rely on resetting the IMU of the phone hoping for getting similar reference frames for the phone and glasses.

Android APIs retrieve orientation data in double format.
…VECTOR

The GAME rotation vector does not use the geomagnetic field, therefore the Y
axis does not point north. But according to the docs,
"However, the orientation may drift somewhat over time". That's why we
switch to ROTATION_VECTOR to avoid that drift.

As the new type of rotation vector points to the north, there is no need
to perform re-initializations every time the controller is calibrated as
the origin of coordinates won't change.
@svillar svillar added the release_candidate PR that should be part of the next release label Jan 22, 2025
Copy link
Member

@javifernandez javifernandez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good and it works perfectly.

@svillar svillar merged commit 9239bb5 into main Jan 22, 2025
22 checks passed
@svillar svillar deleted the rotation_vision branch January 22, 2025 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_candidate PR that should be part of the next release vision glass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants