Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
aesiio's avatar
aesiio
Explorer
3 years ago
Solved

Implementing XR_FB_spatial_entity - Getting XR_ERROR_VALIDATION_FAILURE

Hello!

 

I am attempting to implement the OpenXR extension XR_FB_spatial_entity (https://developer.oculus.com/documentation/native/android/openxr-lsa-persist-content/). I am starting by implementing the function xrCreateSpatialAnchorFB. However, when I call this function during runtime, I get the return code "XR_ERROR_VALIDATION_FAILURE". Is there any way to get more information about what is causing this validation error?

 

I am writing my code in C# (using the StereoKit library). My call to the function looks something like:

		public bool CreateAnchor()
		{
			Log.Info("Begin CreateAnchor");

			var anchorCreateInfo = new XrSpatialAnchorCreateInfoFB();
			anchorCreateInfo.next = IntPtr.Zero;
			anchorCreateInfo.space = Backend.OpenXR.Space;
			anchorCreateInfo.poseInSpace.orientation.w = 1;
            anchorCreateInfo.time = Backend.OpenXR.Time;


            XrResult result = xrCreateSpatialAnchorFB(
				Backend.OpenXR.Session,
				anchorCreateInfo,
				out XrAsyncRequestIdFB requestId);

            Log.Info($"xrCreateSpatialAnchorFB initiated. The request id is: {requestId}. Result: {result.ToString()}");

			return result == XrResult.Success;
		}

 

Any tips on how to debug this further?

 

Thanks, 

Jack

  • I had been using the wrong number for the XrStructureType πŸ™ƒ

    The correct number is: XR_TYPE_SPATIAL_ANCHOR_CREATE_INFO_FB = 1000113003

1 Reply

  • I had been using the wrong number for the XrStructureType πŸ™ƒ

    The correct number is: XR_TYPE_SPATIAL_ANCHOR_CREATE_INFO_FB = 1000113003