8000 fix(client_openxr): Eye gaze orientation after recenter on Pico by curoviyxru · Pull Request #2767 · alvr-org/ALVR · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

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

Open
wants to merge 3 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?

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

< 8000 summary role="button" data-target="details-collapsible.summaryElement details-toggle.summaryTarget" data-action="click:details-collapsible#toggle click:details-toggle#toggle" data-aria-label-closed="Expand comment" data-aria-label-open="Collapse comment" aria-expanded="true" aria-label="Collapse comment" data-view-component="true" class="py-2 px-3 rounded-2 color-bg-subtle">
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

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.

Sorry for the long hiatus, this should be the last nit for this PR

pub action_set: xr::ActionSet,
pub button_actions: HashMap<u64, ButtonAction>,
pub hands_interaction: [HandInteraction; 2],
multimodal_handle: Option<MultimodalMeta>,
// Stores head orientation relative to the first created reference space.
// Used by head rotation correction for eye gazes on Pico.
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.

Since this is a Pico-specific fix, let's prefix this field with pico_

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
0