Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[XRI3] Spatial Mouse Scene Description panel incorrectly scales entire scene when manipulated #876

Closed
AMollis opened this issue Jul 25, 2024 · 6 comments · Fixed by #879
Closed
Assignees
Labels
Type: Bug A problem with an existing feature that can be fixed with the next patched release. Type: Example An issue related to an example or sample.

Comments

@AMollis
Copy link
Contributor

AMollis commented Jul 25, 2024

To reproduce

Steps to reproduce the behavior:

  1. Build sample from Features/XRI3 branch for HL2
  2. On HL2 go to SpatialMouseSample.unity scene
  3. Using hand ray to manipulate the description panel
  4. Result: Entire scene is scaled down incorrectly.

Expected behavior

Scene to move without being scaled

A clear and concise description of what you expected to happen.

@AMollis AMollis added Type: Bug A problem with an existing feature that can be fixed with the next patched release. Type: Example An issue related to an example or sample. labels Jul 25, 2024
@AMollis AMollis self-assigned this Jul 25, 2024
@AMollis AMollis changed the title [MRTK] [XRI3] Spatial Mouse Scene Description panel incorrectly scales entire scene when manipulated [XRI3] Spatial Mouse Scene Description panel incorrectly scales entire scene when manipulated Jul 25, 2024
@AMollis
Copy link
Contributor Author

AMollis commented Jul 25, 2024

This is likely because of the following exception

NullReferenceException: Object reference not set to an instance of an object
MixedReality.Toolkit.Input.TrackedPoseDriverExtensions.GetInputTrackingStateNoCache (UnityEngine.InputSystem.XR.TrackedPoseDriver driver) (at Library/PackageCache/org.mixedrealitytoolkit.input@9bc94a6761e7/Tracking/TrackedPoseDriverExtensions.cs:85)
MixedReality.Toolkit.Input.TrackedPoseDriverExtensions.GetInputTrackingState (UnityEngine.InputSystem.XR.TrackedPoseDriver driver) (at Library/PackageCache/org.mixedrealitytoolkit.input@9bc94a6761e7/Tracking/TrackedPoseDriverExtensions.cs:56)
MixedReality.Toolkit.Input.FlatScreenModeDetector.IsModeDetected () (at Library/PackageCache/org.mixedrealitytoolkit.input@9bc94a6761e7/InteractionModes/FlatScreenModeDetector.cs:61)
MixedReality.Toolkit.Input.InteractionModeManager.Update () (at Library/PackageCache/org.mixedrealitytoolkit.input@9bc94a6761e7/InteractionModes/InteractionModeManager.cs:449)

@AMollis
Copy link
Contributor Author

AMollis commented Jul 25, 2024

Problem seems to be in FlatScreenModeDetector.cs

LeftHandTrackedPoseDriver and RightHandTrackedPoseDriver are null

        public bool IsModeDetected()
        {
            // Flat screen mode is only active if the Left and Right Hands aren't being tracked
            #pragma warning disable CS0618 // Type or member is obsolete
            if (controllerLookup != null)
            {
                return !controllerLookup.LeftHandController.currentControllerState.inputTrackingState.HasPositionAndRotation() && !controllerLookup.RightHandController.currentControllerState.inputTrackingState.HasPositionAndRotation();
            }
            #pragma warning restore CS0618
            else if (trackedPoseDriverLookup != null)
            {
                return !trackedPoseDriverLookup.LeftHandTrackedPoseDriver.GetInputTrackingState().HasPositionAndRotation() &&
                    !trackedPoseDriverLookup.RightHandTrackedPoseDriver.GetInputTrackingState().HasPositionAndRotation();
            }
            else
            {
                Debug.LogWarning("Neither controllerLookup nor trackedPoseDriverLookup are set, unable to detect mode.");
                return false;
            }
        }

@AMollis
Copy link
Contributor Author

AMollis commented Jul 25, 2024

This scene is not using the "XRI3 rig prefab" this is the problem

image

@AMollis
Copy link
Contributor Author

AMollis commented Jul 25, 2024

Fix should be use prefab, and add additional interactor to the prefab in scene

image

@AMollis
Copy link
Contributor Author

AMollis commented Jul 25, 2024

This is a "sample only" issue.

AMollis added a commit that referenced this issue Jul 25, 2024
…ch. (#879)

# Overview 

After updating sample scenes to the new XRI3 rig, some interactor
references broke on some test behaviours. This change fixes these
issues.

Also adjusting a game object name in the "SolverExample" scene, to
better example what the game object is.

# Fixes

-
#878
-
#877
-
#876

# Inspector/Scene Updates

### Spatial Mouse Sample Scene Changes
Updates scene to use the MRTK3/XRI3 Rig Prefab, this fixed broken
interactor references


![image](https://github.com/user-attachments/assets/d9f7f24d-ed8e-467a-9a34-b2724dc0801f)

###  Solver Examples Scene Changes
Adding hand ray interactor references on the `SolverExampleManager` test
behaviour


![image](https://github.com/user-attachments/assets/58a4b9c7-66cd-4db7-bda1-d3c52f07a753)

### Eye Tracking Visualizer Example Scene Changes
Adding gaze interactor references on the `LogStructureEyeGaze` test
behaviour.


![image](https://github.com/user-attachments/assets/f0154bd6-6530-4dc3-b7d5-bed9d4fbeaf2)
@AMollis
Copy link
Contributor Author

AMollis commented Jul 25, 2024

Fixed

@AMollis AMollis closed this as completed Jul 25, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Type: Bug A problem with an existing feature that can be fixed with the next patched release. Type: Example An issue related to an example or sample.
Projects
None yet
1 participant