MixedRealityToolkit-Unity icon indicating copy to clipboard operation
MixedRealityToolkit-Unity copied to clipboard

Importing anchor Succeeds with 0 anchors

Open hanzz0502 opened this issue 8 years ago • 2 comments

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 exportingAnchorBytes = new List(); } 在另一个Hololens的客户端: 通过WorldAnchorTransferBatch.ImportAsync(anchorData, ImportComplete);导入Anchor

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

hanzz0502 avatar May 08 '18 10:05 hanzz0502

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.

calebcannon avatar May 18 '18 16:05 calebcannon

Closing issues older than 180 days. If this is still an issue, please reactivate with recent information.

wiwei avatar Apr 11 '19 20:04 wiwei