Mixedrealitytoolkit-unity: [ImmersiveHeadsets] SpatialAnchorTransferManager denied access to WorldAnchor serialization

Created on 16 Feb 2018  路  3Comments  路  Source: microsoft/MixedRealityToolkit-Unity

Overview

I'm getting an error when trying to export anchors data, using the example from Unity (link here) :
Calling "WorldAnchorTransferBatch.ExportAsync" leads to

SpatialAnchorTransferManager denied access to WorldAnchor serialization

Expected Behavior

The anchors should be serialized and returned as a byte array.

Actual Behavior

The following error is returned and the export fails

SpatialAnchorTransferManager denied access to WorldAnchor serialization

It happens both in editor and in build.

Steps to reproduce

Unity Editor Version

2017.3.0p4 / 2017.3.1p1 / 2017.2.0p2

Mixed Reality Toolkit Release Version

Release from the 16th of january

Thanks for your help !
Tom

Code :

private void ExportAnchors() {
    WorldAnchorTransferBatch transferBatch = new WorldAnchorTransferBatch();
    transferBatch.AddWorldAnchor("anchor", myAnchorGameObject.GetComponent<WorldAnchor>());
    WorldAnchorTransferBatch.ExportAsync(transferBatch, OnExportDataAvailable, OnExportComplete);
}

private void OnExportComplete(SerializationCompletionReason completionReason) {
    if (completionReason != SerializationCompletionReason.Succeeded) {
        // If we have been transferring data and it failed, 
        // tell the client to discard the data
        Debug.LogError("Anchors exporting failed");
    } else {
        // Tell the client that serialization has succeeded.
        // The client can start importing once all the data is received.
        Debug.Log("Anchors exporting succeded");
    }
}

private void OnExportDataAvailable(byte[] data) {
    // Send the bytes to the client.  Data may also be buffered.
    File.WriteAllBytes(Application.persistentDataPath+"/anchors.dat", data);
    Debug.Log("Anchors data correctly written");
}


Immersive HMD

Most helpful comment

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 ?

All 3 comments

The Immersive Headsets don't have the ability to get spatial data.

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 ?

I have the same question. @StephenHodgson, could you respond the the OP鈥檚 follow-up comment? Why is spatial mapping required for world anchor sharing, since (unshared) world anchors clearly are supported with the immersive HMDs?

Was this page helpful?
0 / 5 - 0 ratings