Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
childlifetech.dev's avatar
2 years ago

Possible Bug: OVRSpatialAnchor.LoadUnboundAnchorsAsync()

I've found what may be a bug with OVRSpatialAnchor.LoadUnboundAnchorsAsync(). I'm using Meta XR Core SDK v65.0.0. It doesn't work the first time it is called, but it does work if called a second time.

My function call looks just like line 177 of SpatialAnchorCoreBuildingBlock.cs:

var result = await OVRSpatialAnchor.LoadUnboundAnchorsAsync(uuids, unboundAnchors);

uuids is a List<Guid> and unboundAnchors is a List<OVRSpatialAnchor.UnboundAnchor>.

I get this warning on the first run:

[OVRPlugin] [XRCMD][failure] [XR_ERROR_VALIDATION_FAILURE]: xrDiscoverSpacesMETA(m_xrSession, &xrDiscoveryInfo, (XrAsyncRequestIdFB*)requestId), arvr\projects\integrations\OVRPlugin\Src\Util\CompositorOpenXR.cpp:16829 (arvr\projects\integrations\OVRPlugin\Src\Util\CompositorOpenXR.h:311)

And result.Status is FailureInvalidOption.

However, if I run it again, it works as expected.

Please note that the (now deprecated) OVRSpatialAnchor.LoadUnboundAnchorsAsync() that takes a OVRSpatialAnchor.LoadOptions object as input works perfectly fine the first time:

OVRSpatialAnchor.LoadOptions loadOptions = new OVRSpatialAnchor.LoadOptions();
loadOptions.Uuids = uuids.ToList();
loadOptions.StorageLocation = OVRSpace.StorageLocation.Local;
loadOptions.Timeout = 10;
var unboundAnchors = await OVRSpatialAnchor.LoadUnboundAnchorsAsync(loadOptions);

I will be using the deprecated version for the time being.

Thanks, and let me know if you need more info.