Search Unity

[ImmersiveHeadsets] Access denied when trying to export anchors

Discussion in 'VR' started by Tom_Oak, Feb 16, 2018.

  1. Tom_Oak

    Tom_Oak

    Joined:
    Feb 16, 2018
    Posts:
    3
    Hi,

    I'm trying to export anchors from an immersive headset, save the data on a server, and then load it on other instances of the application so that every headset has the same anchors. For now I'm simply saving the data on disk.
    I've followed the code from this Unity doc (see my version below) and I'm getting an error : calling "WorldAnchorTransferBatch.ExportAsync" lead to
    The world anchors features are supposed to work on immersive headset, they work both in build and in editor for local persistant anchors, but exporting fails both in build and in editor.

    Is it a bug or have I missed something ?
    Thanks for your help !
    Tom

    Code :
    Code (CSharp):
    1. private void ExportAnchors() {
    2.     WorldAnchorTransferBatch transferBatch = new WorldAnchorTransferBatch();
    3.     for (int i= 0; i < m_numOfTargets; i++) {
    4.         transferBatch.AddWorldAnchor("anchor_"+i, m_AnchorPoints[i].GetComponent<WorldAnchor>());
    5.     }
    6.     WorldAnchorTransferBatch.ExportAsync(transferBatch, OnExportDataAvailable, OnExportComplete);
    7. }
    8.  
    9. private void OnExportComplete(SerializationCompletionReason completionReason) {
    10.     if (completionReason != SerializationCompletionReason.Succeeded) {
    11.         // If we have been transferring data and it failed,
    12.         // tell the client to discard the data
    13.         Debug.LogError("Anchors exporting failed");
    14.     } else {
    15.         // Tell the client that serialization has succeeded.
    16.         // The client can start importing once all the data is received.
    17.         Debug.Log("Anchors exporting succeded");
    18.     }
    19. }
    20.  
    21. private void OnExportDataAvailable(byte[] data) {
    22.     // Send the bytes to the client.  Data may also be buffered.
    23.     File.WriteAllBytes(Application.persistentDataPath+"/anchors.dat", data);
    24.     Debug.Log("Anchors data correctly written");
    25. }
    Setup :
    - Windows 10 v 1709 / 16299.248
    - HP immersive headset (I can also try on every other model if needed)
    - Unity 2017.3.0p4 / 2017.3.1p1 / 2017.2.0p2
    - MRTK from the 16th of january
     
    Last edited: Feb 16, 2018
  2. StephenHodgson-Valorem

    StephenHodgson-Valorem

    Joined:
    Mar 8, 2017
    Posts:
    148
    Anchors aren't supported on the VR headsets.
     
  3. Tom_Oak

    Tom_Oak

    Joined:
    Feb 16, 2018
    Posts:
    3
    Thanks for your answer. I get that most spatial features are unavailable since the headsets don't have a depth camera, but I don't understand why anchors sharing would be unavailable :

    First, the readme states that the "Sharing" feature is available on both the hololens and immersive headsets, and specifies that "Anchor sharing" is included (here and here)

    And additionally, I can use anchors in my Unity scene, have them saved and loaded automatically from one session to another, I even see them move slightly when they readjust, just like in the Hololens...which in my understanding means that there is some kind of description of the world at this location that is stored somehow, probably just like this hololens does it ?