Importing anchor Succeeds with 0 anchors
Overview
在MixedRealityToolkit-unity的sharing模块中,通过以下代码在Hololens客户端上传Anchor WorldAnchorTransferBatch watb = new WorldAnchorTransferBatch(); Debug.Log("exporting " + exportingAnchorName); watb.AddWorldAnchor(exportingAnchorName, worldAnchor); WorldAnchorTransferBatch.ExportAsync(watb, WriteBuffer, ExportComplete);
其中:
private void WriteBuffer(byte[] data)
{
exportingAnchorBytes.AddRange(data);
//private List
Expected Behavior
Actual Behavior
使用WorldAnchorTransferBatch.ImportAsync导入worldAnchor时,SerializationCompletionReason为succeeded,但是WorldAnchorTransferBatch实例GetAllIds得到的数组长度为0,怎么回事?如何解决?
Steps to reproduce
(Links to sample github project preferred)
Unity Editor Version
unity2017.2.0f3
Mixed Reality Toolkit Release Version
MixedRealityToolkit-Unity-1.Dev.2017.2.0
I've seen this issue many times, and I don't think it's an problem particular to the MRTK, What we've ended up doing is looking for this result and treating it as an error, just as if the CompletionReason was a negative result. Additionally, when importing anchors we also setup some timers to trigger an error if the anchor hasn't located within some interval. This is an important part of the process since importing the anchor is just one step. Locating the anchor and placing the hologram is another.
On the anchor export side I do something similar: if the exported anchor is less than 1MB I assume the spatial map is incomplete and the user needs to update the map or reposition the hologram.
Closing issues older than 180 days. If this is still an issue, please reactivate with recent information.