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

[OpenXR] Invert the logic of detecting hand tracking detection #769

Merged
merged 1 commit into from Jun 28, 2023

Conversation

svillar
Copy link
Member

@svillar svillar commented Jun 27, 2023

So far the current code was checking whether hand tracking was active, and if that's
the case, then hand tracking was used as input. Otherwise we fell back to using controllers.

That approach has been working fine so far because the devices we ported Wolvic to,
do activate hand tracking only when the controllers are not used. However there are
some other systems that do continuosly track the hands (even when using the controllers,
as the MagicLeap2). For the latter ones, the above approach does not work because hand
tracking will be always active even when the controllers are being used.

That's why we should invert the check condition. From now on, we first check if the
controller pose is valid (by looking for its orientation valid bit (it does not make sense
to check for position because there are 3DoF controllers as well). If it's valid then we
use the controller. Otherwise we check whether hand tracking is enabled.

There is one exception, Pico runtime does continuously track the controllers even when
hand tracking is used. That's why for the case of Pico we always have to check whether
hand tracking is active.

@svillar svillar self-assigned this Jun 27, 2023
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 patch looks good, so feel free to ignore the suggestions I made about the lambda.

app/src/openxr/cpp/OpenXRInputSource.cpp Outdated Show resolved Hide resolved
So far the current code was checking whether hand tracking was active,
and if that's the case, then hand tracking was used as input. Otherwise
we fell back to using controllers.

That approach has been working fine so far because the devices we
ported Wolvic to, do activate hand tracking only when the controllers
are not used. However there are some other systems that do continuosly
track the hands (even when using the controllers, as the MagicLeap2).
For the latter ones, the above approach does not work because hand
tracking will be always active even when the controllers are being used.

That's why we should invert the check condition. From now on, we first
check if the controller pose is valid (by looking for its orientation
valid bit (it does not make sense to check for position because there
are 3DoF controllers as well). If it's valid then we use the controller.
Otherwise we check whether hand tracking is enabled.

There is one exception, Pico runtime does continuously track the
controllers even when hand tracking is used. That's why for the case
of Pico we always have to check whether hand tracking is active.
@svillar svillar merged commit d2ba6a1 into main Jun 28, 2023
6 checks passed
@svillar svillar deleted the hand-tracking-activation branch June 28, 2023 07:34
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.

None yet

2 participants