question

ARNAUD-9666 avatar image
0 Votes"
ARNAUD-9666 asked asergaz commented

How to load ASA in a new Unity Project

Hello, I've been reading through the documentation of Azure Spatial Anchors and I'm a bit confused about how you re-use an ASA in a new Unity project.

I don't understand is how do you load an ASA in your Unity UI to be the reference location of a prefab for instance?

All I found in the ASA documentation is how you can 'locate and ASA' once it's been created. Nowhere do they talk about loading an ASA in a completely new Unity project you're designing in which you want to have a geographical persistent location for a prefab.

Thanks for any help.

azure-spatial-anchors
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

asergaz avatar image
0 Votes"
asergaz answered asergaz commented

Hi @ARNAUD-9666 ,
Sorry to hear you are confused with the documentation you have read so far. Would help if you can share the docs you have been looking at.

I am nevertheless sharing the following which I believe can help clarify your current questions:

1) Building in Unity with Azure Spatial Anchors

Developers can choose Unity for creating and deploying mixed reality applications that use Azure Spatial Anchors. If creating your own project, follow the Unity project setup guide. Otherwise, you can get started quickly with one of the following Quickstarts:

2) Configuring Azure Spatial Anchors in a Unity project

This guide will show you how to get started with the Azure Spatial Anchors SDK in your Unity project.


Let me know if these two docs can help clarify and help you proceed with your project?

Thank you!


Remember:
- Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.
- Want a reminder to come back and check responses? Here is how to subscribe to a notification.





· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks Asergaz, these documents are actually the ones I was referring to and the source of my confusion mostly.

All I found in them is how you build an app in Unity to create and then 'locate and ASA' once it's been created or the 'Watcher' script that can search ASAs by their ID. But it all seem to have to happen in the same app that's also creating these Azure Spatial Anchors. Nowhere do they speak about building a new app from scratch that is simply going to make use of these ASAs on the designing level.

How can you even visualize these ASAs in Unity's UI? How would you go to create a prefab that's going to connect to these ASAs?

I also went through all the project examples from the Azure Spatial Anchors Github (https://github.com/Azure/azure-spatial-anchors-samples) and none of them actually shows an example that doesn't have the creation of the ASA as part of the app.

I think the best example I can give to show you what seems to be 'missing' in your documentation is how Vuforia lets you see Area Targets as a mesh in Unity's UI so that you have some visual references as to where you want to position your prefab elements in the scene.

If you know of a documentation example or a Youtube video that deals with an example project built in Unity AR Foundation using ASAs previously created and giving a way to visualize them in the UI that would be extremely useful and helpful to me.

Thanks in advance for your precious help.

1 Vote 1 ·

Thank you for bringing more detail to your question @ARNAUD-9666.

We strive to deliver great customer experience and having the best samples and examples to demonstrate the product is crucial.

I am sharing this information with the Content Team and I will get back to you soon.

Appreciate your time.

0 Votes 0 ·
patrick-misteli-MSFT avatar image
1 Vote"
patrick-misteli-MSFT answered patrick-misteli-MSFT commented

Hi @ARNAUD-9666

Thank you for your feedback. We have recently updated the HL2 tutorial and point out the use of different devices here (link)

In short: You need a device to create an anchor. From your post it seems like you've done that. Whenever you successfully create an anchor you will be given an Anchor ID back by the service as a response.

Given this Anchor ID (and the appropriate authorization to your ASA Service on Azure) any device can now create a watcher and find this Anchor. In the sample app, as well as in the tutorial linked above, this is simulated by shutting down the session. Starting a new session and looking for the anchors again.

What you could also do to test things out is to
1. Device A: create an anchor
2. Device A: receive the Anchor ID from the service (after successfully creating the anchor)
3. Device A: Send this ID to Device B
4. Device B: Create a session + a watcher with the Anchor ID

Device B will then find the anchor at this position. It is not necessary to create a visual game object at this anchor, however the Tutorial will create one to make it visually easier to follow





· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for your detailed answer Patrick, this is all documentation I had looked at before and it makes sense to me that you'd be using the ID to call back an ASA previously created (from the same Azure account).

But my question is more on the designing part of an app in Unity that would want to make use of a group of ASAs captured in a space that we're trying to fill with prefabs and have various interactions within that space. We need to have some form of visualization of these anchors in that space in Unity to be able to position things precisely and have a sense of where the ground floor is etc.

It's like the way Vuforia implemented their Area Targets, you can visually see an actual mesh of the space that has been captured so that you can places your AR elements within that space. I hope it makes sense to you.


If ASAs are only accessible during runtime it sort of defeats the purpose of persistent anchoring don't you think? I'm sure you guys have been thinking of that issue and I was thinking that you might have some other demo projects that would let us have 'mock ups' of these ASAs that can be identified by their IDs and I'm sure we could use the spatial info that was captured when these ASAs were created to replicate a sense of that space within Unity.

Thanks in advance for your precious help again.

1 Vote 1 ·

At this moment there is unfortunately no way to "see" an anchor and its surroundings other than during runtime after localizing them.

0 Votes 0 ·
ARNAUD-9666 avatar image
1 Vote"
ARNAUD-9666 answered asergaz commented

What do you think of that solution? They seem to be able to get some data out of the ASA scanning process through some JSON files that they download after the initial scanning stage: https://assetstore.unity.com/packages/tools/integration/easy-ar-spatial-anchors-with-azure-cloud-208782

Here is an example of what we get out of these JSON files



That's an example of what we're able to get out of this JSON file after creating the ASAs

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @ARNAUD-9666,

This looks like a promising solution, thank you for sharing :). As our Product Team confirmed, "At this moment there is unfortunately no way to "see" an anchor and its surroundings other than during runtime after localizing them" but we want to bring your feedback into consideration for future.

May I request you to please log this feature request on the product feedback page: Microsoft Azure | Share your Ideas | Azure Spatial Anchors

171219-image.png

The product group does monitor the request and they can plan for the implementation in the future. Once you log the feature request you will also be notified of the status of the request. We invite you to keep using this forum and motivate others to do the same. You can always help other community members by answering their queries.

Thank you!


0 Votes 0 ·
image.png (208.4 KiB)