Azure / azure-spatial-anchors-samples

Azure Spatial Anchors sample code
Other
293 stars 138 forks source link

AnchorModuleScript #379

Closed BlackLi-J closed 1 year ago

BlackLi-J commented 1 year ago

Description private void CloudManager_AnchorLocated(object sender, AnchorLocatedEventArgs args) { QueueOnUpdate(new Action(() => Debug.Log($"Anchor recognized as a possible Azure anchor")));

    if (args.Status == LocateAnchorStatus.Located || args.Status == LocateAnchorStatus.AlreadyTracked)
    {
        currentCloudAnchor = args.Anchor;

        QueueOnUpdate(() =>
        {
            Debug.Log($"Azure anchor located successfully");

            // Notify AnchorFeedbackScript
            OnASAAnchorLocated?.Invoke();

if WINDOWS_UWP || UNITY_WSA

            // HoloLens: The position will be set based on the unityARUserAnchor that was located.

            // Create a local anchor at the location of the object in question
            gameObject.CreateNativeAnchor();

            // Notify AnchorFeedbackScript
            OnCreateLocalAnchor?.Invoke();

            // On HoloLens, if we do not have a cloudAnchor already, we will have already positioned the
            // object based on the passed in worldPos/worldRot and attached a new world anchor,
            // so we are ready to commit the anchor to the cloud if requested.
            // If we do have a cloudAnchor, we will use it's pointer to setup the world anchor,
            // which will position the object automatically.
            if (currentCloudAnchor != null)
            {
                Debug.Log("Local anchor position successfully set to Azure anchor position");
               // gameObject.GetComponent<UnityEngine.XR.WSA.WorldAnchor>().SetNativeSpatialAnchorPtr(currentCloudAnchor.LocalAnchor);
            }

A clear and concise description of what the issue is. Is there any code missing in this script that finds an anchor but has no synchronization location? The following Android method synchronizes in a different place than the first time Steps to reproduce the issue

If the issue occurs in one of the ASA sample apps, please detail the steps required to reproduce it. Otherwise, provide details on how to reproduce it in your custom app.

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

If applicable, add screenshots to help explain your problem. a559ccc8882d5c1ac489adee13e1ad1

Development information (please complete the following information)

AR Device information (please complete the following information):

Additional context

Add any other context about the problem here.

Varnauld commented 1 year ago

Hello, thank you for submitting this issue. @darax would you be available to review please?

Varnauld commented 1 year ago

(tracking n# for this issue - 42109963)

darax commented 1 year ago

This should be handled by the folks who made that tutorial over here: https://github.com/microsoft/MixedRealityLearning/issues