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

Switch hands in SolverHandler when interactor is not actively hovering #11441

Merged
merged 5 commits into from
Mar 31, 2023

Conversation

srinjoym
Copy link
Contributor

@srinjoym srinjoym commented Mar 29, 2023

Overview

The SolverHandler script is responsible for tracking a target and sending a goal position to any solvers. The SolverHandler can track the user's head, hand joints or interactors. It can also track just one hand, or both hands. This PR fixes a bug that occurs when using the SolverHandler script to tracking both left and right interactors. If the user's original hand goes out of view, the SolverHandler does not automatically switch to tracking the other hand (even if it's in view).

This behavior was implemented correctly in MRTK 2 (code). However, in MRTK 3 the check for if the controller is active was removed.

This PR updates the SolverHandler to check if the current interactor is actively hovering. If it's not active hovering, the script switches to the other interactor. Here's a video of the new behavior:
https://user-images.githubusercontent.com/7866060/228664304-527e5b5c-6515-4bb1-89c2-34893640ca2a.mp4

Note: This does not solve a related issue with SolverHandler where it does not switch hands when tracking hand joints. This fix only applies to interactors.

Changes

Verification

Not sure if there's any unintended changes to the behavior here. The interactor will not be actively hovering if the target does not have an Interactable script on it.

Also looking into adding tests to validate this behavior.

@github-actions github-actions bot added the MRTK3 label Mar 29, 2023
@srinjoym srinjoym changed the title Switch hands in SolverHandler when ray interactor is inactive Switch hands in SolverHandler when interactor is not actively hovering Mar 29, 2023
@srinjoym srinjoym marked this pull request as ready for review March 29, 2023 21:02
@srinjoym srinjoym self-assigned this Mar 29, 2023
shaynie
shaynie previously approved these changes Mar 29, 2023
AMollis
AMollis previously approved these changes Mar 29, 2023
@AMollis
Copy link
Member

AMollis commented Mar 29, 2023

A unit test would be nice :)

AMollis
AMollis previously approved these changes Mar 30, 2023
@srinjoym srinjoym enabled auto-merge (squash) March 30, 2023 19:18
shaynie
shaynie previously approved these changes Mar 30, 2023
@srinjoym srinjoym dismissed stale reviews from shaynie and AMollis via 4f1abfc March 31, 2023 16:40
@shaynie shaynie self-requested a review March 31, 2023 18:02
@srinjoym srinjoym merged commit 9941264 into microsoft:mrtk3 Mar 31, 2023
drusk-unity pushed a commit to drusk-unity/MixedRealityToolkit-Unity that referenced this pull request Jun 26, 2023
microsoft#11441)

* check if controller hover is active in solver handler

* add tests for solver handler :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants