-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Update XR Rig
prefab to better support HoloLens 2 scenarios
#11445
Comments
XR Rig
prefab to better support HoloLens 2 scenarios
Are you seeing an issue with the current defaults on HL2? When set to "Not Specified", the XR Rig allows the device/runtime to determine its optimal mode. The Camera Y Offset is only used when the device/runtime decides to use "Floor", so this value should not affect HL2. As a side note, I had a request out to Unity to add "Unbounded" to the XR Origin component, so it should show up in a future iteration. I don't remember the timeline. |
Using the default configuration, both ASA and ARR don't function correctly. ASA recalls anchors 1.6m too high. ARR renders content 1.6m too high. Setting tracking origin to We need to understand the issue a bit better before we can determine the correct course of action here. Whatever is chosen we'll do our best not to prohibit usage on non-HoloLens devices. |
Just realized I had this exactly backwards, my bad! It actually only takes effect when using "Device" 😅 this is likely the issue you're seeing, but it sounds like a bug in ASA and ARR to me. They should be placing/transforming their content relative to the Camera Offset (or really, probably the Trackables Parent object for anchors), similar to how ARFoundation's components (like ARMeshManager and ARAnchorManager) work. Depending on the Unity/ARFoundation versions they support, they'll be looking for the XROrigin or ARSessionOrigin components. This snippet from the 4.2.7 release of ARAnchorManager: MRTK3 surfaces this as a static member via MixedRealityToolkit-Unity/com.microsoft.mrtk.core/Utilities/PlayspaceUtilities.cs Lines 41 to 54 in 9941264
For correctness with a broader configuration of apps, ASA and ARR should also account for this offset object. |
@keveleigh I'm trying to better understand the motivation behind setting the default "Camera Y Offset" to 1.6, and the default Y Position on the Camera Offset GameObject to 1.6: This seems like it has no net effect (GameObject moves up 1.6m then XROrigin moves it back down 1.6) other than allowing the user to build the scene at a different origin height (the MRTK content appear to be positioned at a height of 1.769m). This same effect could be achieved by setting both the GameObject Y Position to 0, the "Camera Y Offset" to 0, and moving the scene content to 0 height. Do you recall if there any reason the scene content was positioned at the 1.769m height in MRTK 3? The example scenes in MRTK 2 all had content centered around the default origin at 0. I'm still looking into the ARR and ASA bugs separately - agree that they should respect the offset if it's there. |
The GameObject is at 1.6m at edit time to better visualize the scene you're building through Unity's various camera previews, as it matches where the camera will relatively be at runtime. At runtime, Unity will set the Camera Offset GameObject's height to 1.6m according to the As far as why we've preferred this offset as opposed to localizing everything directly around the head is largely to do with XRI's locomotion/teleportation implementation. It assumes there will be some floor representation (and thus, some offset between the head and the floor), whether it's an artificial 1.6m or one actually determined by the runtime. https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@2.3/manual/locomotion.html
While this is true for devices that default to
This is true! And it led to some special casing in the teleportation logic where we tried to guesstimate where we should put the camera post-teleport that didn't really work in all cases. MixedRealityToolkit-Unity/Assets/MRTK/Services/TeleportSystem/MixedRealityTeleportSystem.cs Lines 300 to 302 in b026319
Regarding the floor-embedded content I mentioned above, this also led to us creating a special MonoBehaviour that adjusted the app's content's height at runtime, but I've found the |
Thanks for the detailed explanation! The rationale for using the Y Offset makes sense. I'm working on validating the issues with our services and checking the behavior of this with OpenXR's unbounded space. ASA already has a fix coming and I've validated that this is no longer an issue. |
Confirmed ARR does not respect the Y Offset on the XR Origin, following up with them to create a bug. I think based on the investigation here we can go ahead and close this issue as there's no changes needed on MRTK. |
removed camera offset microsoft/MixedRealityToolkit-Unity#11445
removed camera offset microsoft/MixedRealityToolkit-Unity#11445 .
This issue has been migrated a new MRTK repository, and the status of this issue will now be tracked at the following location:
XR Rig
prefab to better support HoloLens 2 scenarios MixedRealityToolkit/MixedRealityToolkit-Unity#323Overview
We recently hit issues where the default
XR Rig
settings didn't work with Azure Spatial Anchors and Azure Remote Rendering on HoloLens 2. We should improve the experience for HoloLens 2 so that these scenarios work out of the box.Tasks
XR Rig
prefab. At the momentTracking Origin Mode
is set toNot Specified
andCamera Y Offset
set to 1.6. This doesn't seem ideal for HoloLens2, but perhaps it is correct given theTransform.Position.Y
value is 1.6. However, these settings didn't work correctly with ASA and ARR; need to understand why.XR Rig
prefab as neededXR Rig
prefab?XR Rig
prefab?Current Defaults:
More Context
For ASA and ARR to function correctly on HoloLens 2, we had to set
Tracking Origin Mode
toDevice
andCamera Y Offset
to 0.Some useful information from the MSFT OpenXR Team:
Also from OpenXR Team:
The "Device" setting uses "Local" tracking. The MSFT OpenXR plugin has a component to force the app into an "Unbounded" tracking. See the EyeLevelSceneOrigin class for details. Perhaps the MRTK
XR Rig
prefab for HoloLens should use this.The text was updated successfully, but these errors were encountered: