-
Notifications
You must be signed in to change notification settings - Fork 323
FIX: Corrected behaviour of TrackedPoseDriver when no device is connected. #1823
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
Conversation
…cted with an additional test case mimicking the reported scenario.
@smnwttbr I don't have any XR devices so I'll add an XR QA instead. @UnityRyanC |
I won't be able to test this PR as I don't have a Mac (which the bug mentions was where the issue was reproduced on). I spoke with Manuel Gonzalez Solano, who does testing on PolySpatial and Apple Vision OS, who'll be able to test this once he's free later this week. I don't have permission to update reviewers on this PR, so @Pauliusd01 could you update the PR for me please? |
Okay, I dmed him on slack since I can't find him on github by name. |
@Pauliusd01 can you add me as reviewer? I don't seem to have permission to add myself |
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.
I tested the isxb-699-trackedposedriver-fix
branch against a new Universal 3D project created and run using Unity Editor 6000.0.26f1 apple silicon and 2022.3.51f1 apple silicon, on an M1 macOS machine.
I did observe that the non-origin position and rotation was preserved on GameObjects having Tracked Pose Driver
components if I left the Ignore Tracking State
checkbox enabled.
If I check the Ignore Tracking State
checkbox, GameObjects having Tracked Pose Driver
component and set at non-origin position and rotation are once again returned to origin position and rotation when PlayMode starts
I also observed that setting Update Type = Before Render
with Ignore Tracking State
checked, non-origin rotations and positions are preserved when starting PlayMode
I've also bound input actions to change position and rotation on GameObjects having TrackedPosedDriver component, and I observe the following:
|
Removed extra white space mentioned in review feedback
Thanks for the feedback @mangosol , I have taken this old PR back again since @smnwttbr worked on it to conclude this. How should I interpret your assessment, is it in line with what you would expect? Any additional feedback/perspective from @chris-massie? |
Thanks for the feedback @mangosol , I have taken this old PR back again since @smnwttbr worked on it to conclude this. How should I interpret your assessment, is it in line with what you would expect? Any additional feedback/perspective from @chris-massie? |
I do not have sufficient context on whether the behavior I observed is expected or not; my assessment is meant to describe current behavior for either you or any other stakeholder with more in depth knowledge of functional requirements to determine if the current behavior is expected or not given the changes in this PR. I'm happy to sign off if behavior is in line with requirements |
OK, thanks, I will do a review of this then and assess it and then make a decision based on that. Thanks for testing this through and carefully documenting observations. Its helpful. |
… state if position and/or rotation actions have a resolved control that could drive input. Additionally fixed so that ignoreTrackingState == true, doesn't reset to identity, but preserve the configured transform of the associated GameObject.
This PR have been updated based on reviewing implementation and previous suggested fix. I have updated the PR description accordingly. It would be fantastic if it would be possible to reassess this fix and ensure there are no regressive behavior in XR domain. @mangosol @chris-massie |
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.
Changes look good. I suggest outsourcing the HasResolvedControl method since it could be useful in more cases.
Packages/com.unity.inputsystem/InputSystem/Plugins/XR/TrackedPoseDriver.cs
Show resolved
Hide resolved
Packages/com.unity.inputsystem/InputSystem/Plugins/XR/TrackedPoseDriver.cs
Show resolved
Hide resolved
Packages/com.unity.inputsystem/InputSystem/Plugins/XR/TrackedPoseDriver.cs
Outdated
Show resolved
Hide resolved
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.
A couple of minor tweaks.
Packages/com.unity.inputsystem/InputSystem/Plugins/XR/TrackedPoseDriver.cs
Outdated
Show resolved
Hide resolved
Packages/com.unity.inputsystem/InputSystem/Plugins/XR/TrackedPoseDriver.cs
Outdated
Show resolved
Hide resolved
…ility as well as used cached evaluations for resolved bindings to avoid dual evaluation.
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.
These changes look good. I don't think it should impact performance too much since the HasResolvedControl calls only happen during the first update.
Co-authored-by: Chris Massie <[email protected]>
Co-authored-by: Chris Massie <[email protected]>
Co-authored-by: Chris Massie <[email protected]>
@chris-massie I have applied all your suggestions to the PR and re-run CI on the branch. Hence requesting re-review. Additionally do you think an additional QA pass is needed from @mangosol or other XR QA before this lands or not? |
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.
I tested these changes out with the XRI simulator and it seemed to work as I expected where the existing pose is retained if there's no device. If I connect the device late the Transform stays at the initialized pose until a change from (0, 0, 0) happens on the device, at which point it updates as expected.
Thanks @chris-massie and @vrdave-unity for the latest reviews and testing, it was very valuable. I will get this merged based on this. |
Description
This fix is intended to fix reported behaviour in ISXB-699
.
Changes made
Modified behaviour so that when position and rotation are assigned actions, they are evaluated similar to tracking state is such a way that they may only be applied if the binding is associated with a resolved control. If not, the evaluated tracking state will not contain the flag for the corresponding transform. This applies to ignoreTrackingState == false.
Modified behavior so that when entering playmode with ignoreTrackingState == true, the transform of the associated GameObject is preserved rather then forcibly reset to identify transform. This is achieved by initialising the internal m_CurrentPosition and m_CurrentRotation based on the local transform of the associated GameObject.
Added a test case that is mimicking the reported behavior.
Notes
Requesting insights from XR team regarding any implications this might have since behavior wasn't previously covered properly in existing test cases. It also changes the behaviour commented inline in the implementation.
Checklist
Before review:
Changed
,Fixed
,Added
sections.([case %number%](https://issuetracker.unity3d.com/issues/...))
.Area_CanDoX
,Area_CanDoX_EvenIfYIsTheCase
,Area_WhenIDoX_AndYHappens_ThisIsTheResult
.During merge:
NEW: ___
.FIX: ___
.DOCS: ___
.CHANGE: ___
.RELEASE: 1.1.0-preview.3
.