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
Refactor SolverHandler to fix multiple issues #5416
Refactor SolverHandler to fix multiple issues #5416
Conversation
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
…or example if TrackedHandedness is both)
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
@keveleigh / @wiwei are there any additional steps I need to do for a breaking change PR? I know I need to update documentation but I will do that in the follow up PR. I need to fix the examples scene as well. This PR is already getting pretty big and I don't want to include those two steps 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.
Looks great! I merged this into my HandConstrait experimental to release branch and everything worked/merged nicely.
I tried the example scene (which was pretty broken before this PR) and everything behaved as I would expect except the surface magnetism solver. Might be worth a sanity check since I'm not 100% sure how it should behave?
Could you also add a note to:
https://microsoft.github.io/MixedRealityToolkit-Unity/Documentation/UpdatingToGA.html for any breaking changes?
@Cameron-Micka |
Assets/MixedRealityToolkit.SDK/Inspectors/Utilities/Solvers/SurfaceMagnetismInspector.cs
Outdated
Show resolved
Hide resolved
Thank you SO much for doing this. I have a bunch of comments, but I think we can work through them and get them addressed reasonably. I wanted to call out that this is a canonical example of a well done PR that includes great tests for features that should have tests a long time ago. Because of this I feel 100% more confident making changes to solvers going forward |
@wiwei just a heads up my upcoming hand constraint pull request depends on this pull request. So, please let me know if you and Troy need help getting this in. |
@wiwei thanks for the very helpful comments! I know it's a substantial change. @Cameron-Micka I just skimmed through most of the items and I think this is very doable to cover pretty quickly tomorrow morning. It also actually gave me a potential idea to help people with the migration/breaking change. It's particularly around that target type enum |
I'm 99% sure they are serialized as numerical values. I'll double check though. Yes your points give me an idea. We could keep the old values, mark as obsolete, and then add on the new values I listed. Then in either OnValidate or in the inspector/awake, check if they are deprecated and just auto switch to the correct value and modify TrackedHandedness as well |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
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.
## Overview This pull request moves the HandConstraint (and HandConstraintPalmUp) solver from Experimental to Release by adding tests, documentation, and a handful of bug fixes and improvements. Functionality remains pretty much the same from the previous pull request (#4532) and utilizes solver fixes from @Troy-Ferrell's (#5416) The solver has also be genericized to work with motion controllers. Thank you @julenka for guidance on how to write unit tests that utilize hands! ## Changes - Fixes: #5312, #5304, #5257, #5413 ## Commits * Removing global input handler warning. * Wip check-in, new rotation behavior. * Disable hand tracking on hands which are currently focus locked. * Adding additional hand menu features and documentation improvements. * Hand constraint example improvements. * Hacks to get solver to not throw null pointers when instantiated. Should be reverted * Skeleton test for ensuring hand menu follows hand * Comment and example improvements. * autoTransitionBetweenHands is now set via the tracked handness of the solver handler * Adding support for motion controllers. * Updating example to support new solver changes. * Moving hand based menus out of the experimental namespace. * Adding hand constraint documentation. * Addressing pr feedback. * Updating example scene to use "new" toggle buttons. * Improving documentation, especially around IMixedRealityControllers usage. * Fixing broken documentation. * Update Documentation/README_Solver.md
…Constraint (and HandConstraintPalmUp) solver from Experimental to Release by adding tests, documentation, and a handful of bug fixes and improvements. Functionality remains pretty much the same from the previous pull request (#4532) and utilizes solver fixes from @Troy-Ferrell's (#5416) The solver has also be genericized to work with motion controllers. Thank you @julenka for guidance on how to write unit tests that utilize hands! ## Changes - Fixes: #5312, #5304, #5257, #5413 ## Commits * Removing global input handler warning. * Wip check-in, new rotation behavior. * Disable hand tracking on hands which are currently focus locked. * Adding additional hand menu features and documentation improvements. * Hand constraint example improvements. * Hacks to get solver to not throw null pointers when instantiated. Should be reverted * Skeleton test for ensuring hand menu follows hand * Comment and example improvements. * autoTransitionBetweenHands is now set via the tracked handness of the solver handler * Adding support for motion controllers. * Updating example to support new solver changes. * Moving hand based menus out of the experimental namespace. * Adding hand constraint documentation. * Addressing pr feedback. * Updating example scene to use new toggle buttons. * Improving documentation, especially around IMixedRealityControllers usage. * Fixing broken documentation. * Update Documentation/README_Solver.md )
…oft#5500) ## Overview This pull request moves the HandConstraint (and HandConstraintPalmUp) solver from Experimental to Release by adding tests, documentation, and a handful of bug fixes and improvements. Functionality remains pretty much the same from the previous pull request (microsoft#4532) and utilizes solver fixes from @Troy-Ferrell's (microsoft#5416) The solver has also be genericized to work with motion controllers. Thank you @julenka for guidance on how to write unit tests that utilize hands! ## Changes - Fixes: microsoft#5312, microsoft#5304, microsoft#5257, microsoft#5413 ## Commits * Removing global input handler warning. * Wip check-in, new rotation behavior. * Disable hand tracking on hands which are currently focus locked. * Adding additional hand menu features and documentation improvements. * Hand constraint example improvements. * Hacks to get solver to not throw null pointers when instantiated. Should be reverted * Skeleton test for ensuring hand menu follows hand * Comment and example improvements. * autoTransitionBetweenHands is now set via the tracked handness of the solver handler * Adding support for motion controllers. * Updating example to support new solver changes. * Moving hand based menus out of the experimental namespace. * Adding hand constraint documentation. * Addressing pr feedback. * Updating example scene to use "new" toggle buttons. * Improving documentation, especially around IMixedRealityControllers usage. * Fixing broken documentation. * Update Documentation/README_Solver.md
…#5560) * Moving the HandConstraint Solver from Experimental to Release (#5500) ## Overview This pull request moves the HandConstraint (and HandConstraintPalmUp) solver from Experimental to Release by adding tests, documentation, and a handful of bug fixes and improvements. Functionality remains pretty much the same from the previous pull request (#4532) and utilizes solver fixes from @Troy-Ferrell's (#5416) The solver has also be genericized to work with motion controllers. Thank you @julenka for guidance on how to write unit tests that utilize hands! ## Changes - Fixes: #5312, #5304, #5257, #5413 ## Commits * Removing global input handler warning. * Wip check-in, new rotation behavior. * Disable hand tracking on hands which are currently focus locked. * Adding additional hand menu features and documentation improvements. * Hand constraint example improvements. * Hacks to get solver to not throw null pointers when instantiated. Should be reverted * Skeleton test for ensuring hand menu follows hand * Comment and example improvements. * autoTransitionBetweenHands is now set via the tracked handness of the solver handler * Adding support for motion controllers. * Updating example to support new solver changes. * Moving hand based menus out of the experimental namespace. * Adding hand constraint documentation. * Addressing pr feedback. * Updating example scene to use "new" toggle buttons. * Improving documentation, especially around IMixedRealityControllers usage. * Fixing broken documentation. * Update Documentation/README_Solver.md * Update Documentation/README_Solver.md Co-Authored-By: David Kline <davidkl@microsoft.com>
…rimental to Release (#5500) ## Overview This pull request moves the HandConstraint (and HandConstraintPalmUp) solver from Experimental to Release by adding tests, documentation, and a handful of bug fixes and improvements. Functionality remains pretty much the same from the previous pull request (#4532) and utilizes solver fixes from @Troy-Ferrell's (#5416) The solver has also be genericized to work with motion controllers. Thank you @julenka for guidance on how to write unit tests that utilize hands! ## Changes - Fixes: #5312, #5304, #5257, #5413 ## Commits * Removing global input handler warning. * Wip check-in, new rotation behavior. * Disable hand tracking on hands which are currently focus locked. * Adding additional hand menu features and documentation improvements. * Hand constraint example improvements. * Hacks to get solver to not throw null pointers when instantiated. Should be reverted * Skeleton test for ensuring hand menu follows hand * Comment and example improvements. * autoTransitionBetweenHands is now set via the tracked handness of the solver handler * Adding support for motion controllers. * Updating example to support new solver changes. * Moving hand based menus out of the experimental namespace. * Adding hand constraint documentation. * Addressing pr feedback. * Updating example scene to use new toggle buttons. * Improving documentation, especially around IMixedRealityControllers usage. * Fixing broken documentation. * Update Documentation/README_Solver.md * Update Documentation/README_Solver.md Co-Authored-By: David Kline <davidkl@microsoft.com> )
Overview
The solver system has many issues (most of which are posted on GitHub). One of the key limitations for the feature is involved in the SolverHandler class. This change addresses multiple issues:
Cleaner understanding of what kind of target type is active
=> Simpler types => Head, MotionController, HandJoint, & CustomOverride
=> Inspector now shows valid sub-properties based on the target type
Developers can define order of solvers in code (via SetSolvers)
Solvers can now be correctly tracked/instantiated at runtime dynamically
Solvers can now follow any hand or motion controller (defaults to Left first if set to Both/Any)
Removed OnValidate from Solver.cs as this is generally poor practice and give inconsistent results
Removed nonexisting property for InBetween.cs
Added solvertests to tests package (See verification section below for details)
Fixed SurfaceMagnetism
=> Renamed properties to not assume always head tracked transform
=> Created new inspector to make properties easier to understand & group
=> Updated MaxDistance for raycast default from 3m to 50m
=> Updated default Raycast Direction Mode to Tracked Target Forward (ray along head gaze or hand pointer, etc)
Fixed InBetween
=> Updated names to be clearer
=> Updated refresh of second solver to be accurate
=> Updated tooltips to be accurate
=> Modified inspector to extend from SolverInspector
NOTE: This changes property names and will break any existing code that tried to extend Solvers themselves
New Solver Handler Targeting
Hand Switching Feature:
New Editor Inspectors:
New Solver Tests:
Changes
Verification
Added Solver Tests!
Furthermore, I will follow up this PR with another one to fix the Solver Example scene which is mostly broken.
Tested basic functionality manually