Closed ikto-art closed 1 year ago
I also tried ignoring the validation checks in SpatialAnchorManager.cs and got this error from ASA:
System.InvalidOperationException: Azure Spatial Anchors requires xrConvertWin32PerformanceCounterToTimeKHR, xrTryGetPerceptionAnchorFromSpatialAnchorMSFT, xrCreateSpatialAnchorFromPerceptionAnchorMSFT, xrCreateSpatialAnchorMSFT, and xrReadSpatialAnchorNeighborhoodDataMSFT extensions avaialble.
I forgot to write earlier that the first time I ran the UWP build it seemed to not be able to find an available XR runtime or connect to the HoloLens 2 so I added one manually that pointed to Microsoft.Holographic.AppRemoting.OpenXr.dll
and then it worked.
Now I just tried to install the Microsoft app 'OpenXR for Windows Mixed Reality' and set it as the available runtime but in the log there were errors of XR_ERROR_FORM_FACTOR_UNAVAILABLE
then it apparently automatically switched to the remoting runtime that still lacks the extensions (but the Microsoft app runtime had the XR_MSFT_perception_anchor_interop
extension).
@ikto-art your observations are right on track - OpenXR Remoting 2.8.1 indeed has the necessary platform support for ASA to work, but the ASA SDK still depends on a runtime-specific extension that's only present in the non-Remoting runtime. Once that dependency is removed, the ASA SDK should work with OpenXR Remoting 2.8.1 and higher.
Thank you for that information. Do you know approximately when that might happen? Also, when you say the remoting runtime has the necessary platform support you mean users of that runtime have the access to export anchors or is it a private access for now? I wanted to try the XRAnchorTransferBatch class before replying to your comment but didn't have the time yet, I'll try it as soon as possible.
The ASA SDK changes to enable this should be checked in shortly and published in the next 1-2 months (I'm not familiar with the exact schedule).
As for XRAnchorTransferBatch, this is not supported by Remoting and there are no plans to add this. More generally, anchor transfer batches have a number of significant drawbacks and should generally not be used, in favor of Azure Spatial Anchors. See the deprecation notes on the core API for anchor transfer batches: https://learn.microsoft.com/en-us/uwp/api/windows.perception.spatial.spatialanchortransfermanager?view=winrt-22621#remarks
Thank you, yes I knew it was deprecated but still the only workaround for now. I'll wait for the update.
Adding @darax who is working on the next SDK update (currently scheduled end of this month). Thank you
this should work in 2.14.1.
Description
I can't use the SpatialAnchorManager script in Unity when I try to use it in a build, after establishing a connection to a HoloLens 2 with OpenXR remoting.
Steps to reproduce the issue
Basic project which uses the Mixed Reality OpenXR 2.8.1 remoting runtime and MRTK 2.8.2 on Unity 2020.3.41 with UWP build. When running built player and calling SpatialAnchorManager.CreateSessionAsync() after the remoting session is established it says SpatialPerception capability not enabled (of course the package manifest has the SpatialPerception authorization).
Development information (please complete the following information)
AR Device information (please complete the following information):
Additional context
In the UWP build, a script connects to the HoloLens 2 with AppRemoting.Connect() then when connected waits 3 seconds for OpenXR sessions status to go to 'Focused' and then tries to create and start a session with SpatialAnchorManager.CreateSessionAsync().
In the log I have the following report before the call to
Windows.Perception.Spatial.SpatialAnchorExporter.RequestAccessAsync()
:I see this extension that might be needed that's not supported: XR_MSFT_spatial_anchor_export_preview But the 2.8.1 remoting library changelog seems to imply that Azure Spatial Anchors are working with Remoting.