private async void StopAzureSession()
        {
            // Reset the current session if there is one, and wait for any active queries to be stopped
            await cloudManager.ResetSessionAsync();

            // Stop any existing session
            cloudManager.StopSession();
        }
Beispiel #2
0
    async public Task ResetSession()
    {
        foreach (ARAnchor anchor in aRAnchorManager.trackables)
        {
            aRAnchorManager.RemoveAnchor(anchor);
            Debug.Log("trying to remove anchor: " + anchor.trackableId);
        }
        currentCloudAnchor  = null;
        previousCloudAnchor = null;
        foundAnchors.Clear();
        spatialAnchorManager.StopSession();
        await spatialAnchorManager.ResetSessionAsync();

        await spatialAnchorManager.StartSessionAsync();
    }
Beispiel #3
0
    private async void StopAzureSession()
    {
        Debug.Log("\nAnchorModuleScript.StopAzureSession()");
        // Notify AnchorFeedbackScript
        OnEndASASession?.Invoke();

        Debug.Log("Stopping Azure session... please wait...");

        // Stops any existing session
        cloudManager.StopSession();

        // Resets the current session if there is one, and waits for any active queries to be stopped
        await cloudManager.ResetSessionAsync();

        Debug.Log("Azure session stopped successfully");
    }
Beispiel #4
0
        /// <summary>
        ///     Azure Spatial Anchorsサービスとの接続を停止します。
        /// </summary>
        /// <returns></returns>
        public async Task StopAzureSession()
        {
            try
            {
                Debug.Log("\nAnchorModuleScript.StopAzureSession()");

                OutputLog("Stopping Azure session... please wait...");

                // Stops any existing session
                cloudManager.StopSession();

                // Resets the current session if there is one, and waits for any active queries to be stopped
                await cloudManager.ResetSessionAsync();

                OutputLog("Azure session stopped successfully", isOverWrite: true);
            }
            catch (Exception e)
            {
                Debug.Log(e);
                throw;
            }
        }
Beispiel #5
0
    public async Task StopAzureSessionAsync()
    {
        if (!this.SessionStarted)
        {
            return;
        }

        Debug.Log("\nAnchorModuleScript.StopAzureSession()");

        // Notify AnchorFeedbackScript
        OnEndASASession?.Invoke();

        Debug.Log("Stopping Azure session... please wait...");

        // Stops any existing session
        cloudManager.StopSession();

        // Resets the current session if there is one, and waits for any active queries to be stopped
        await cloudManager.ResetSessionAsync();

        this.SessionStarted = false;

        Debug.Log("Azure session stopped successfully");
    }
Beispiel #6
0
    public async Task ResetSession()
    {
        foreach (ARAnchor anchor in aRAnchorManager.trackables)
        {
            if (anchor == null)
            {
                break;
            }
            Log.debug($"-----ARFoundation removing {anchor.trackableId}");
            aRAnchorManager.RemoveAnchor(anchor);
            Log.debug("-----ARFoundation removed anchor ");
        }
        anchorManager.ClearCloudSpatialAnchorList();
        Log.debug($"-----SpatialAnchorManager Session is about to Reset:{anchorFirstTimeFound}");
        spatialAnchorManager.StopSession();
        await spatialAnchorManager.ResetSessionAsync();

        ConfigureSensors();
        await spatialAnchorManager.StartSessionAsync();

        Log.debug($"-----SpatialAnchorManager Reset Complete:{anchorFirstTimeFound}");
        Log.debug("Reset Anchor Lerper");
        FindObjectOfType <AnchorLerper>().ResetLerper();
    }
        private async UniTask DemoRoutine()
        {
            _instructionUIPresenter.UpdateMessage("NearAnchor Demo");
            await _instructionUIPresenter.OnTriggerProceed().First();

            _instructionUIPresenter.UpdateMessage("1.最初に一つ目のアンカーを生成します");
            await _instructionUIPresenter.OnTriggerProceed().First();

            // セッション開始
            await _spatialAnchorManager.StartSessionAsync();

            // 最初のアンカーの生成
            var firstAnchor = await CreateAnchorTask();

            _instructionUIPresenter.UpdateMessage("2.続けて周辺に接続されたアンカーを生成します");
            await _instructionUIPresenter.OnTriggerProceed().First();

            _instructionUIPresenter.UpdateMessage("3.二つ目のアンカーを生成します");
            await _instructionUIPresenter.OnTriggerProceed().First();

            // 周辺のアンカーの生成
            var secondAnchor = await CreateAnchorTask();

            _instructionUIPresenter.UpdateMessage("4.三つ目のアンカーを生成します");
            await _instructionUIPresenter.OnTriggerProceed().First();

            var thirdAnchor = await CreateAnchorTask();

            _instructionUIPresenter.UpdateMessage("5.一度セッションを終了します");
            await _instructionUIPresenter.OnTriggerProceed().First();

            await _spatialAnchorManager.ResetSessionAsync();

            _instructionUIPresenter.UpdateMessage("6.アンカーが配置されていることを確認します");
            await _instructionUIPresenter.OnTriggerProceed().First();

            await GraphAnchorsTask(new[] { firstAnchor, secondAnchor, thirdAnchor }, Color.blue, new Vector3(0.08f, 0.2f, 0.08f));

            _instructionUIPresenter.UpdateMessage("7.もう一度セッションを終了します");
            await _instructionUIPresenter.OnTriggerProceed().First();

            await _spatialAnchorManager.ResetSessionAsync();

            _instructionUIPresenter.UpdateMessage("8.一つ目のアンカーを画像情報から検知します");
            await _instructionUIPresenter.OnTriggerProceed().First();

            var locatedFirstAnchor = (await LocateAnchorsTask(new[] { firstAnchor }, Color.green, new Vector3(0.2f, 0.08f, 0.08f))).ToList();

            Assert.IsTrue(locatedFirstAnchor.Count == 1);

            _instructionUIPresenter.UpdateMessage("9.残り二つのアンカーを接続情報から検知します");
            await _instructionUIPresenter.OnTriggerProceed().First();

            await LocateNearAnchorsTask(locatedFirstAnchor[0], 2);

            _instructionUIPresenter.UpdateMessage("10.セッションを終了します");
            await _instructionUIPresenter.OnTriggerProceed().First();

            _anchorObjectPresenter.CleanAllAnchors();
            _spatialAnchorManager.DestroySession();
        }