Closed ChasingD closed 1 year ago
public static async Task
ImportAsync(Stream inputStream) { AnchorTransferBatch anchorTransfer = new AnchorTransferBatch(); SerializationCompletionReason num = await anchorTransfer.ImportAsync(inputStream); if (num == SerializationCompletionReason.Succeeded) { return new XRAnchorTransferBatch(anchorTransfer); } return null; }
Result: SerializationCompletionReason is UnknownError
Presumably, you're transferring the anchor data over a network connection or something? Have you confirmed that the anchorData isn't being transformed somehow as part of the transfer process? i.e checking the size and doing a checksum on the byte array.
Presumably, you're transferring the anchor data over a network connection or something? Have you confirmed that the anchorData isn't being transformed somehow as part of the transfer process? i.e checking the size and doing a checksum on the byte array.
Hi WikkidEdd, thanks for your reply. I found the problem inspired by you. The problem is the anchor data is wrong during the export phase. So the data imported is wrong.
trying using as below using (MemoryStream stream = new MemoryStream(rawAnchorDownloadedData)) { stream.Write(rawAnchorDownloadedData, 0, rawAnchorDownloadedData.Length); stream.Seek(0, SeekOrigin.Begin); currentAnchorTransferBatch = await XRAnchorTransferBatch.ImportAsync(stream); }
@ChasingD is there still an issue here? From your last comment, sounds like you discovered problem with the exported data.
The problem is the anchor data is wrong during the export phase. So the data imported is wrong.
If there is still an obvious bug, please reply here. Also, in this case, can you provide a Unity project with an isolated reproduction of the bug? This will help expediate the investigation on our side.
If you are in need of API assistance, meaning there is no obvious API bug, please follow-up with our support team via https://aka.ms/mrsupport. In this case, you would select help with "HoloLens Devices" and "HoloLens App Development (HL 2)", concerning an "API" and "Spatial Anchors" issue. Our support team will then assist you with using this API.
Hi @ChasingD , I'm working on something similar but I'm having problems with the export phase of the anchors (I want export anchors on a database) Can you provide me the piece of code/function that does the export? and the import?
Thanks
openxr version 1.8.0 I use XRAnchorTransferBatch to export anchors, but when I import anchors using XRAnchorTransferBatch.ImportAsync(Stream), null is returned.
anchorData is byte[] transfered. result: transferBatch is null