Skip to content
This repository has been archived by the owner on Nov 16, 2024. It is now read-only.

OpenXR Persistence on hololens does not work. #322

Open
Peamon opened this issue Dec 21, 2023 · 1 comment
Open

OpenXR Persistence on hololens does not work. #322

Peamon opened this issue Dec 21, 2023 · 1 comment

Comments

@Peamon
Copy link

Peamon commented Dec 21, 2023

With at least unity 2021.3.6, OpenXR with mixedreality openxr 1.10 and worldlockingtools 1.5.9 and master, compiled in UWP64 for hololens 2.

The persistance of the anchor does not work, and WorldLockingManager.GetInstance().AnchorManager.SupportsPersistence is false

To make it works, simply change the line 225 of file WorldLocking.Core/Scripts/XR/AnchorManagerXR.cs

from :

openXRPersistence = XRGeneralSettings.Instance.Manager.activeLoader.name.StartsWith("Open XR");

to:

openXRPersistence = XRGeneralSettings.Instance.Manager.activeLoader.name.StartsWith("OpenXR");

(juste remove a space !!!)

The effective name of activeLoader is OpenXRLoader as shown in logs :

ActiveLoader name:[OpenXRLoader] type:[UnityEngine.XR.OpenXR.OpenXRLoader]
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
Microsoft.MixedReality.WorldLocking.Core.AnchorManagerXR:.ctor(IPlugin, IHeadPoseTracker, XRAnchorSubsystem, XRSessionSubsystem)
Microsoft.MixedReality.WorldLocking.Core.<TryCreate>d__7:MoveNext()
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:Start(TStateMachine&)
Microsoft.MixedReality.WorldLocking.Core.<SelectAnchorManager>d__114:MoveNext()
System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:Start(TStateMachine&)
Microsoft.MixedReality.WorldLocking.Core.<ResetAnchorManager>d__113:MoveNext()
System.Runtime.CompilerServices.AsyncVoidMethodBuilder:Start(TStateMachine&)
Microsoft.MixedReality.WorldLocking.Core.WorldLockingManager:SetContext(WorldLockingContext)
Microsoft.MixedReality.WorldLocking.Core.WorldLockingContext:CheckPushSettings(Scene)
Microsoft.MixedReality.WorldLocking.Core.WorldLockingContext:OnEnable()

It will be great if this can be corrected in the master !!!

the issue is also described here: https://forum.unity.com/threads/hololens-2-persist-anchors-with-world-locking-tools.1406428/

@Peamon Peamon changed the title OpenXR Persistance on hololens does not work. OpenXR Persistence on hololens does not work. Dec 21, 2023
@P422L
Copy link

P422L commented Jan 10, 2024

I tried implementing your fix but Persistence still isn't working. As soon as I restart the App on my Hololens2 everything resets. I have the WLT Debug options turned on so I can see that the Anchors are being created as I move around.

Unfortunately I'm unable to debug because the Hololens2 is from my University and I'm developing and building from my Home Workstation. Any further Ideas?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants