Search Unity

Exporting World Anchors returns access denied

Discussion in 'VR' started by DevTVR, Oct 4, 2019.

  1. DevTVR

    DevTVR

    Joined:
    Oct 4, 2019
    Posts:
    4
    I am developing a VR UWP application on Windows 10 for the new HP Reverb which has inside out tracking.

    WorldAnchors are working perfectly in editor and with deployed apps, trying to export them however gives me the following error.

    Using WorldAnchorTransferBatch.ExportAsync() returns

    SpatialAnchorTransferManager denied access to WorldAnchor serialization UnityEngine.XR.WSA.Sharing.WorldAnchorTransferBatch:ExportAsync_Internal(WorldAnchorTransferBatch, SerializationDataAvailableDelegate, SerializationCompleteDelegate) UnityEngine.XR.WSA.Sharing.WorldAnchorTransferBatch:ExportAsync(WorldAnchorTransferBatch, SerializationDataAvailableDelegate, SerializationCompleteDelegate)

    using this code:

    Code (CSharp):
    1. private void SetExportAnchors()
    2.         {
    3.             anchorIDs = worldAnchorManager.AnchorStore.GetAllIds();
    4.             WorldAnchorTransferBatch transferBatch = new WorldAnchorTransferBatch();
    5.             for (int i = 0; i < anchorIDs.Length; i++)
    6.             {
    7.                 GameObject myObject = GameObject.Find(anchorIDs[i]);
    8.  
    9.                 if (myObject) {
    10.                     transferBatch.AddWorldAnchor(anchorIDs[i], worldAnchorManager.AnchorStore.Load(anchorIDs[i], GameObject.Find(anchorIDs[i])));
    11.                 }
    12.             }
    13.             Debug.Log("Serializing");
    14.             WorldAnchorTransferBatch.ExportAsync(transferBatch, OnExportDataAvailable, OnExportComplete);
    15.         }
    Also tried the azure spatial anchors example project with the same outcome. The Error reads "Access denied to spatial anchor exporter. Ensure your OS build is up to date and the spatialperception capability is set."

    Has anyone an Idea what I'm doing wrong? Or someone knows an alternative way to share world anchors on UWP?

    thanks

    Spatial Perception is checked in the "capabilities".
     
  2. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
  3. DevTVR

    DevTVR

    Joined:
    Oct 4, 2019
    Posts:
    4
    hey joejo, thanks for the answer, I do have the "Spatial Perception" enabled, in the Unity player settings as well as in the app manifest in visual studio :/ That's why I'm at a bit of a loss to why it doesn't work....
     
  4. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    I just saw the HP Reverb bit above. I'm pretty sure that just because it has Inside-Out tracking doesn't mean it's going to support spatial mapping. I believe this API set is only going to work on HoloLens devices.
     
  5. DevTVR

    DevTVR

    Joined:
    Oct 4, 2019
    Posts:
    4
    It's true that spatial mapping does not work on the reverb (which is stupid, since it has the same inside out capabilities as the Hololens afaik).

    Still, spatial Anchors are working perfectly, as expected according to Microsofts own docs. Also people have gotten Inside Out Immersive devices to work with Azure Spatial Anchors.

    So I'm thinking that either I'm missing something, or it isn't as easy in the end as it's should be :(
     
  6. darmova

    darmova

    Joined:
    Nov 27, 2019
    Posts:
    10
    I think it should be possible to make use of azure spatial anchors on WMR devices, but I keep getting the same error. I know for sure that some people got it running with mixed reality headsets, not just hololens. I opened the issue on microsoft github page :https://github.com/MicrosoftDocs/azure-docs/issues/43407 but no reply so far. Btw this document clearly states that you can use azure spatial anchors to set up large room scale experience with mixed reality: https://docs.microsoft.com/en-us/windows/mixed-reality/location-based-experiences
     
    Last edited: Nov 27, 2019
  7. darmova

    darmova

    Joined:
    Nov 27, 2019
    Posts:
    10
    In case anyone is still interested, I found this: https://docs.unity3d.com/Manual/wmr_quick_start.html . Apparently you need to set "Local Machine" instead of "Device" in Visual Studio for running the app in immersive headset. "Device" is apparently 'hololens only' option. Also when you build from Unity, you apparently should set target device to "Any device" instead of "Hololens". After two days I finally got the the azure spatial anchors example project running in my HMD, now it says "Next: create azure spatial anchors session" in purple. No idea where to go from here, though.
     
  8. DevTVR

    DevTVR

    Joined:
    Oct 4, 2019
    Posts:
    4
    hi darmova, thanks for sharing your progress in this issue.Its super interesting that you got that far. I am very curious if you can get it working all the way. I think to remember that I set the "local machine" option too though. But its also possible that they updated the api (are you running on the newest insider build?) or they missed something too....

    You can find the complete tutorial for how to set up the spatial anchors project here: https://docs.microsoft.com/en-us/az...-share-anchors-across-devices?tabs=VS,Android

    Basically I gave up on that approach a couple of weeks ago after getting the confirmation that the api is not working for devices other than the hololens: https://stackoverflow.com/questions...to-windows-spatialperception-for-immersive-vr

    Since we only have a local setup I automated a workflow to grab and sync the windows spatial anchors with this tool https://docs.microsoft.com/en-us/windows/mixed-reality/mixedrealityspatialdatapackager

    cheers