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:
WorldAnchorTransferBatch.ExportAsync(sharedAnchorInterface, WriteBuffer, ExportComplete);
The source of the part that exported WorldAnchor to the byte array is as follows :
(ImportExportAnchorManager.cs)
/// <summary>
/// Called by the WorldAnchorTransferBatch when anchor exporting is complete.
/// </summary>
/// <param name="status"></param>
public void ExportComplete(SerializationCompletionReason status)
{
if (status == SerializationCompletionReason.Succeeded && exportingAnchorBytes.Count > minTrustworthySerializedAnchorDataSize)
{
Debug.Log("Uploading anchor: " + exportingAnchorName);
roomManager.UploadAnchor(
currentRoom,
new XString(exportingAnchorName),
exportingAnchorBytes.ToArray(),
exportingAnchorBytes.Count);
}
else
{
Debug.Log("This anchor didn't work, trying again");
CurrentState = ImportExportState.InitialAnchorRequired;
}
}
“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.