question

OlivierMartineau-2709 avatar image
0 Votes"
OlivierMartineau-2709 asked OlivierMartineau-2709 commented

Can't retrieve Azure Spatial Anchor (unity3D, Hololens 2)

About one year ago, I developed an application for Hololens 2 using Azure Spatial Anchors. This application can create, retrieve and delete anchors. It worked well. Today, I tried to use the application again. The anchor creation works but I can not retrieve my anchor.

I use AzureSpatialAnchor SDK 2.1.1. Here is the code for retrieving my anchors :

AnchorLocateCriteria criteria = new AnchorLocateCriteria();
criteria.Identifiers = anchorsToFind.ToArray();
azureWatcher = azureSession.CreateWatcher(criteria);

Of course, I defined a method for callback when anchor has been retrieved :

azureSession = new CloudSpatialAnchorSession();
...
azureSession.AnchorLocated += OnAzureAnchorLocated;

     public void OnAzureAnchorLocated(object sender, AnchorLocatedEventArgs args) {
         AddToActionQueue(() => {
             DebugConsole.LogMessage("OnAzureAnchorLocated");
             switch (args.Status) {
                 case LocateAnchorStatus.Located:
                 case LocateAnchorStatus.AlreadyTracked:
                     PlaceAnchor(args.Anchor);
                     break;
                 case LocateAnchorStatus.NotLocatedAnchorDoesNotExist:
                     // The anchor was deleted or never existed in the first place
                     // Drop it, or show UI to ask user to anchor the content anew
                     DebugConsole.LogMessage("Anchor does not exist");
                     break;
                 case LocateAnchorStatus.NotLocated:
                     // The anchor hasn't been found given the location data
                     // The user might in the wrong location, or maybe more data will help
                     // Show UI to tell user to keep looking around
                     DebugConsole.LogMessage("Anchor not located");
                     break;
             }
         });
     }

I have no error and no message (located, alreadyTracked, doesNotExists, NotLocated)

Taking a look in the spatial anchor supervision in Azure portal, I can see one creation request but.. no queries request !

Does someone know how I could solve my problem ?
Thanks.

Olivier.

hololens-developmentazure-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.

1 Answer

SatishBoddu-MSFT avatar image
0 Votes"
SatishBoddu-MSFT answered OlivierMartineau-2709 commented

Hello @OlivierMartineau-2709 I hope the below info helps with your initial query.

The minimum supported version is ASA SDK 2.7.0. Please make sure to update to the latest SDK (ASA SDK 2.10.2).

Please have a look at the : ASA SDK 2.7.0 is the Minimum Version


Please comment in the below section for further help in this matter. If the response is helpful, please click "Accept Answer" and upvote it.

· 6
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 @SatishBoddu-MSFT
Thanks for your answer. Before upgrading my project, I followed the tutorial :https://docs.microsoft.com/en-us/windows/mixed-reality/develop/unity/tutorials/mr-learning-asa-02?tabs=winxr
I'm using : Unity 2020-3.17f1, Azure Spatial Anchors SDK Core 2.10.2, Azure Spatial Anchors for Windows 2.10.2, Mixed Reality OpenXR plugin 1.0.2, AR Foundation 4.1.7
When I deploy the application into my Hololens 2 :
Application runs
I move the cube (OK)
I start an azure session (OK)
I create an azure spatial anchor : I have an InvalidOperation : coudn't obtain a native anchor pointer. It happens on this call in AnchorModuleScript : localCloudAnchor.LocalAnchor =await theObject.FindNativeAnchor().GetPointer();

What's going wrong ?

0 Votes 0 ·

Hello @OlivierMartineau-2709 let me check with my team on this scenario.

0 Votes 0 ·

Hi @SatishBoddu-MSFT any news from the team ? I saw the resolution for @MarkoXR-5383 but in my case the ASA SDK version is already 2.10.2... I still can't create a spatial anchor. Thanks

0 Votes 0 ·

Hi, I am having a the same issue.
The AnchorLocated event isn't being fired.
I followed the Microsoft tutorial (https://docs.microsoft.com/en-us/windows/mixed-reality/develop/unity/tutorials/mr-learning-sharing-05) and it is working locally on one HoloLens 2. But when I try to share anchor on one HoloLens 2 and get it from another HoloLens 2 in the same room the watcher can't seem to find it. No error is thrown and last debug message I get is "Watcher created" and "Looking for Azure anchor... please wait..." https://i.stack.imgur.com/ozHbZ.png . I tried going to different rooms multiple times but that didn't help. I'm using: Unity 2020.3.12 LTS, MRTK 2.7.2, ASA 2.10.0-preview1, OpenXR 1.0

0 Votes 0 ·

Hello @MarkoXR-5383 thanks for reaching out on this forum, we suggest creating a separate post on your issue.

If you don't mind, could you please create a new post, so that we have the team to get engaged on your query? Thanks for understanding!

0 Votes 0 ·

Hi @SatishBoddu-MSFT thank you for the reply.
The issue was resolved here: https://github.com/Azure/azure-spatial-anchors-samples/issues/291
Updating the ASA SKD to v2.10.2 solved the problem.

0 Votes 0 ·