-
-
Notifications
You must be signed in to change notification settings - Fork 527
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
fix(client_openxr): Eye gaze orientation after recenter on Pico #2767
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit after the headset has been removed and the screen shuts off, the headset will go to sleep. At least this is what happens on the Quest. This will trigger the XR session to destroy. Upon reactivation, the session and also the InteractionContext will be recreated. In this case the filed relative_head_orientation
would be reset. have you tested this case?
pub action_set: xr::ActionSet, | ||
pub button_actions: HashMap<u64, ButtonAction>, | ||
pub hands_interaction: [HandInteraction; 2], | ||
multimodal_handle: Option<MultimodalMeta>, | ||
pub relative_head_orientation: Quat, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably need a comment, saying that this is the relative head orientation since the refernce space first initialization. ALso it might be good to mention why it's needed (workaround for Pico eye tracking)
alvr/client_openxr/src/stream.rs
Outdated
let head_rot_inv = int_ctx.relative_head_orientation.conjugate().inverse(); | ||
|
||
Pose { | ||
orientation: head_rot_inv * pose.orientation, | ||
position: head_rot_inv * pose.position, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For simplicity, instead of storing relative_head_orientation
you could store the whole Pose. This allows you to directly use the Pose * Pose operator here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This of course if the bug affects the whole pose, not just the orientation. but in the end we don't care much, as we just use the orientation for VRChat. Do the change anyway as it would simplify the code a bit
0180fec
to
e4d3163
Compare
Pico OS just kills application in any case :) |
alvr/client_openxr/src/lib.rs
Outdated
@@ -353,6 +353,10 @@ pub fn entry_point() { | |||
|
|||
lobby.update_reference_space(); | |||
|
|||
let relative_head_pose = interaction_context.read().relative_head_pose; | |||
interaction_context.write().relative_head_pose = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can keep the *=
operator in theory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error[E0368]: binary assignment operation
*=
cannot be applied to typealvr_common::Pose
alvr/client_openxr/src/stream.rs
Outdated
let mut relative_head_pose = int_ctx.relative_head_pose; | ||
relative_head_pose.position = Vec3::ZERO; | ||
|
||
relative_head_pose * pose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you don't need to set the position to zero
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stored position will break eye gaze position. That's why I've stored Quat in the first place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see... well then you could undo the last commit, but keep the comment in the struct, and specify this detail
e4d3163
to
430363c
Compare
Fixes #2740.