Search Unity

[HoloLens]WorldAnchor is exported failed on HoloLens Emulator.

Discussion in 'VR' started by Y_Honda, Oct 25, 2018.

  1. Y_Honda

    Y_Honda

    Joined:
    Oct 5, 2018
    Posts:
    1
    Hello, everyone.

    The Shared Holograms(MR Academy 240) application was launched by HoloLens Emulator alone, but it fails at the part where WorldAnchor was exported to the byte array.
    As an export result, we receive an UnknownError from the Unity API.
    Why does the Unity API return UnknownError?
    Is it because WorldAnchor's size is too small?

    I used the following sources :
    https://github.com/Microsoft/HolographicAcademy/archive/Holograms-240-SharedHolograms.zip

    The API call I'm doing is:
    Code (CSharp):
    1.  
    2. WorldAnchorTransferBatch.ExportAsync(sharedAnchorInterface, WriteBuffer, ExportComplete);
    3.  
    The source of the part that exported WorldAnchor to the byte array is as follows :
    (ImportExportAnchorManager.cs)
    Code (CSharp):
    1.  
    2.     /// <summary>
    3.     /// Called by the WorldAnchorTransferBatch when anchor exporting is complete.
    4.     /// </summary>
    5.     /// <param name="status"></param>
    6.     public void ExportComplete(SerializationCompletionReason status)
    7.     {
    8.         if (status == SerializationCompletionReason.Succeeded && exportingAnchorBytes.Count > minTrustworthySerializedAnchorDataSize)
    9.         {
    10.             Debug.Log("Uploading anchor: " + exportingAnchorName);
    11.             roomManager.UploadAnchor(
    12.                 currentRoom,
    13.                 new XString(exportingAnchorName),
    14.                 exportingAnchorBytes.ToArray(),
    15.                 exportingAnchorBytes.Count);
    16.         }
    17.         else
    18.         {
    19.             Debug.Log("This anchor didn't work, trying again");
    20.             CurrentState = ImportExportState.InitialAnchorRequired;
    21.         }
    22.     }
    23.  
    "status" which is an argument of the "ExportComplete ()" method is "SerializationCompletionReason.UnknownError".
    "exportingAnchorBytes.Count" will be 218 no matter how many times it is executed.
    "minTrustworthySerializedAnchorDataSize" is defined by 100000.

    The above phenomenon occurred even if HoloLens Emulator set Room information acquired by HoloLens actual machine.

    I contacted Microsoft technical support to investigate the above phenomenon and received the following answers. :

    As a result of confirming this time, I confirmed the OS side of the HoloLens emulator side (Hyper-V guest)
    SpatialAnchorTransferManager.TryExportAnchorsAsync for SpatialAnchor generation and export
    It was a situation that itself was a success.

    Despite the fact that it is a successful situation at the API level, for the part that Unity side will make as Unknown Error,
    As for the implementation on the Unity side, we do not have any information on our side, so it is unknown,
    As a guess, if the environmental tracking information from the room information set on the emulator side is of the size expected
    We believe there is a possibility that data could not be passed.


    The version of the tool I am using is below. :
    1.Unity 2017.4.1f1
    2.Visual Studio 2017 (Version15.8.2)
    3.HoloLens Emulator 10.0.17134.0

    Best regards.
     
  2. fhanab

    fhanab

    Joined:
    Mar 11, 2020
    Posts:
    1
  3. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    Check the editor log. There should be lines in there like "Failed to complete world lock serialization" that contain the HRESULT code that we get back from the async operation. I would need that information to tell you anymore in regards to this error.
     
  4. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    Could be in the application player log or even in the debug output in VS as well.