WebXR Anchors on HoloLens

Hi!

I’m working on a QR code tracking thing for WebXR on the HoloLens. I’m basically almost there, I can recognize QR codes, calculate where they are in the space. Once one has been found I want to create an object in that location, however I find that objects that I place while already in XR mode (currently immersive-vr since immersive-ar doesn’t seem to work anymore on the HoloLens) are very jittery. While object that were already in the scene before entering XR are steady as a rock.

My assumption is that this is because anchors are made for the preexisting objects. Correct me if I’m wrong there.

However, when trying to create an anchor through anchors.addAnchorAtPositionAndRotationAsync(closestPoint, new Quaternion()) I get the following error:

OperationError: Failed to execute 'createAnchor' on 'XRFrame': Anchor creation failed.

I create the XR experience like so:

var defaultXRExperience = await newScene.createDefaultXRExperienceAsync({
            uiOptions: {
                sessionMode: supportedAR ? "immersive-ar" : "immersive-vr",
                referenceSpaceType: "local-floor"
            },
            optionalFeatures: true
});

and directly after that I try and enable the anchor stuff:

 defaultXRExperience.baseExperience.featuresManager.enableFeature(
                            WebXRAnchorSystem,
                            "latest"
                        ) as WebXRAnchorSystem

I use what I get back from that to try and create anchors.

Am I doing something wrong? Or is there maybe another way to get the 3D models to not jitter as much when instantiated?

Thanks!

are you sure you start an AR session?

Well, no since that’s not been available for some reason. On my HoloLens 2
const supportedAR = await WebXRSessionManager.IsSessionSupportedAsync("immersive-ar"); gives false.

Here’s someone else seemingly experiencing the same, I made a report using the feedback hub but :woman_shrugging: (I also tried reinstalling the entire thing, I’ve updated everything but the issue remains)

I was thinking I could continue with immersive-vr instead but I guess this is one of it’s limitations.

yep, anchors only work on AR sessions

I see, that’s unfortunate. Thanks for the quick response!

I just checked with other WebXR environments that are not Babylon just to make sure it’s not a Babylon thing, but with the official WebXR check I get this:

I keep on forgetting whether or not I ever managed to get AR to work on the hololens. Let me check a few things and get back to you

Oh I found some more people with this issue: Unable to use any WebXR AR app on MS Edge - Microsoft Q&A and Reddit - Dive into anything