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

fix(client_openxr): Eye gaze orientation after recenter on Pico #2767

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

curoviyxru
Copy link
Contributor

Fixes #2740.

Copy link
Member

@zmerp zmerp left a 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,
Copy link
Member

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)

Comment on lines 555 to 558
let head_rot_inv = int_ctx.relative_head_orientation.conjugate().inverse();

Pose {
orientation: head_rot_inv * pose.orientation,
position: head_rot_inv * pose.position,
}
Copy link
Member

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

Copy link
Member

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

@curoviyxru
Copy link
Contributor Author

This will trigger the XR session to destroy.

Pico OS just kills application in any case :)

@@ -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 =
Copy link
Member

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

Copy link
Contributor Author

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 type alvr_common::Pose

Comment on lines 556 to 559
let mut relative_head_pose = int_ctx.relative_head_pose;
relative_head_pose.position = Vec3::ZERO;

relative_head_pose * pose
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pico 4 Pro eye tracking position incorrect after playspace recenter or any change
2 participants