Runtime placing an AR Anchors

Include the following details (edit as applicable):

  • Issue category: Lightship Maps / Semantic Segmentation / Multiplayer / Real-time Mapping-Depth / ARDK Documentation / Unity Example Package / Sample App aka ‘AR Voyage’ / ARDK Virtual Studio Tools / Developer Tools / Networking / VPS / Scanning Framework
  • Device type & OS version: Android / iOS / Other Ex. iPhone 8+ on iOS 13
  • Host machine & OS version: Mac / Windows / Linux / Other Ex. Mac on Big Sur x.x
  • Issue Environment : Unity Remote / Unity Mock / On Device / Dev Portal
  • Xcode version:
  • ARDK version: 2.5
  • Unity version: 2021.3

Description of the issue:
I wanted to place a runtime AR anchors based on Unity world coordinates,
once the VPS is localized, I have tried creating anchors in anchor management but this functionality only gives the static anchors, is there a way to understand a camera position with respect to the VPS localized location (scan) so I can place an AR anchors dynamically ?

Hi Rohit,

I’m a little unsure what you mean by static and dynamic anchors in this context. Can you explain to me how you’re differentiating between static and dynamic?

Hey Jesus,
Thanks for your response,
The anchor placement which we do it in anchor management are fixed at the given location which we have built in the unity editor tool, but I would like to place a runtime anchor once the position has been acquired in the mobile app it self,

Example :
If my world space is of 200 meter by 200 meter and the localized camera is at 50 , 50 from the origin I would like to place and AR anchor at 51, 51 so I can see that in camera view.

Does these things are possible ? is there any way to get the position of the localized camera with unity world space coordinates to build some custom AR experiences ?

Hi Rohit,

If I’m understanding correctly, I believe you can grab the local Transform of the camera to get its current position and rotation values. Since the camera is a child of the XROrigin its position would be relative to it so getting its local Transform values should get you what you want.

Sorry for late reply,
I did try out the above scenario, but there is no way where I can get the localized position of the camera, which means once the localization is successful ARDK doesn’t give what was the location of the camera.