WebXRAnchorSystem can't add an anchor

When i use function:

addAnchorPointUsingHitTestResultAsync(hitTest);

The anchor is added as expected, but when i use function:

addAnchorAtPositionAndRotationAsync(position);

i got an error:
Uncaught (in promise) DOMException: Anchor creation failed.

Where is my mistake?

This PG Babylon.js Playground with first function.
This PG https://playground.babylonjs.com/#HYK4HC#1 with second (wrong) function.

Adding @RaananW

Hi!

I will check that and get back to you.

For some reason adding anchors in unbound space it not supported. change it to local-floor and you get the results you expect:

WEBXR | Babylon.js Playground

Thanks for not thinking about it!

1 Like

Hi,
When I run this in immersive mode (using WebXR in chrome) I get an error ā€œthe required feature ā€˜anchorsā€™ is not supportedā€ do you have any idea why?
Thank you,
Tali

@RaananW is the king of VR, and the more I read V/X/A R questions, the more I think to dive in to help him more than pinging him :slight_smile:

nice you know AR/VR/XR in Babylon JS as well?

Nope, hence why I need to learn cause I feel useless on those questions :slight_smile:

Hi Tali,

I assume you mean chrome on android? Have you turned on the webxr incubations flag in chrome://flags?

Iā€™m using Chrome on my PC and have WebXR set to Samsung Galaxy S8+(AR) in WebXR in the Babylon Playground. Yes I have the incubation flags turned on.

no PC/desktop browser has the anchors feature turned on. You will have to use mobile.

Oh that makes a lot of sense! Do you have recommendations for how to use Babylon on mobile? I have an iPhone. Would it work to run it on a HoloLens as well?
Thank you!

The only devices supporting anchors currently are Android devices with the latest chrome. IPhone doesnā€™t support WebXR (thanks apple), and hololens doesnā€™t have all ar features yet as far as I know.
Latest chrome on android supports anchors, plane detection, hit tests.

Ok thank you! So if I get my hands on an android device how can i run my code?
Thanks for the quick response!

There you go:

Just open the page and make sure the flags are turned on

1 Like

Thank you, I can only run in the Babylon playground on chrome on an Android?

yep, just make sure to turn on the right flags. Itā€™s still an experimental technology

1 Like

Thanks, when I open WebXR - Samples on chrome or chrome canary I get AR and VR support detected. But when I open any of the demos they donā€™t work. Iā€™m trying to get the anchor demo Anchors in particular. Any idea why?
Using latest chrome and have incubation flag enabled.