Beispiel #1
0
        private void OnDevicePoseStatusChanged(TrackableBehaviour.Status arg1, TrackableBehaviour.StatusInfo arg2)
        {
            sessionInfoString = $"OnDevicePoseStatusChanged: {arg1} - {arg2}";

            Logger.LogFromMethod("VuforiaSessionManager", "OnDevicePoseStatusChanged", sessionInfoString, DebugMode);

            if (arg1 != TrackableBehaviour.Status.NO_POSE)
            {
                if (!trackingStarted)
                {
                    trackingStarted = true;
                    Logger.LogFromMethod("VuforiaSessionManager", "OnDevicePoseStatusChanged", "Tracking Started!.", DebugMode);
                    trackingStartedCallback?.Invoke();
                }
                else if (currentStatus == TrackableBehaviour.Status.NO_POSE)
                {
                    Logger.LogFromMethod("VuforiaSessionManager", "OnDevicePoseStatusChanged", "Tracking Restored!", DebugMode);
                    trackingRestoredCallback?.Invoke();
                }

                if (onAfterReset != null)
                {
                    Logger.LogFromMethod("VuforiaSessionManager", "OnDevicePoseStatusChanged", "Emitting 'OnAfterReset' event.", DebugMode);
                    onAfterReset.Invoke();
                    onAfterReset = null;
                }
            }
            else if (currentStatus != TrackableBehaviour.Status.NO_POSE)
            {
                Logger.LogFromMethod("VuforiaSessionManager", "OnDevicePoseStatusChanged", "Tracking Lost!", DebugMode);
                trackingLostCallback?.Invoke();
            }

            currentStatus = arg1;
        }
Beispiel #2
0
    void OnTrackableStatusInfoChanged(TrackableBehaviour.StatusInfoChangeResult statusInfoChangeResult)
    {
        m_PreviousStatusInfo = statusInfoChangeResult.PreviousStatusInfo;
        m_NewStatusInfo      = statusInfoChangeResult.NewStatusInfo;

        HandleTrackableStatusInfoChanged();
    }
Beispiel #3
0
    void OnDevicePoseStatusChanged(TrackableBehaviour.Status status, TrackableBehaviour.StatusInfo statusInfo)
    {
        //Debug.Log("OnDevicePoseStatusChanged(" + status + ", " + statusInfo + ")");

        //if (status == TrackableBehaviour.Status.TRACKED)
        //{
        //}
    }
 private void Start()
 {
     theTrackable  = GetComponent <TrackableBehaviour>();
     lastStatus    = theTrackable.CurrentStatusInfo;
     petController = transform.parent.GetComponent <PetController>();
     parent        = transform.GetChild(0).gameObject;
     HUD.SetActive(false);
 }
    void OnTrackableStatusInfoChanged(TrackableBehaviour.StatusInfoChangeResult statusInfoChangeResult)
    {
        this.m_PreviousStatusInfo = statusInfoChangeResult.PreviousStatusInfo;
        this.m_NewStatusInfo      = statusInfoChangeResult.NewStatusInfo;

        Debug.LogFormat("Trackable {0} {1} -- {2}",
                        mTrackableBehaviour.TrackableName,
                        mTrackableBehaviour.CurrentStatus,
                        mTrackableBehaviour.CurrentStatusInfo);

        HandleTrackableStatusChanged();
    }
Beispiel #6
0
 void OnDevicePoseStatusChanged(TrackableBehaviour.Status status, TrackableBehaviour.StatusInfo statusInfo)
 {
     Debug.Log("OnDevicePoseStatusChanged(" + status + ", " + statusInfo + ")");
     m_status = status;
     if (status == TrackableBehaviour.Status.TRACKED)
     {
         SetSurfaceIndicatorVisible(true);
     }
     else
     {
         SetSurfaceIndicatorVisible(false);
     }
 }
    void OnDevicePoseStatusChanged(TrackableBehaviour.Status status, TrackableBehaviour.StatusInfo statusInfo)
    {
        switch (statusInfo)
        {
        case TrackableBehaviour.StatusInfo.NORMAL:
            break;

        case TrackableBehaviour.StatusInfo.UNKNOWN:
            break;

        case TrackableBehaviour.StatusInfo.INITIALIZING:
            break;

        case TrackableBehaviour.StatusInfo.EXCESSIVE_MOTION:
            break;

        case TrackableBehaviour.StatusInfo.INSUFFICIENT_FEATURES:
            break;

        case TrackableBehaviour.StatusInfo.INSUFFICIENT_LIGHT:
            break;

        case TrackableBehaviour.StatusInfo.RELOCALIZING:
            // Display a relocalization message in the UI if:
            // * No AnchorBehaviours are being tracked
            // * None of the active/tracked AnchorBehaviours are in TRACKED status

            StateManager stateManager = TrackerManager.Instance.GetStateManager();
            if (stateManager != null)
            {
                // Cycle through all of the active AnchorBehaviours first.
                foreach (TrackableBehaviour behaviour in stateManager.GetActiveTrackableBehaviours())
                {
                    if (behaviour is AnchorBehaviour)
                    {
                        if (behaviour.CurrentStatus == TrackableBehaviour.Status.TRACKED)
                        {
                            // If at least one of the AnchorBehaviours has Tracked status,
                            // then don't display the relocalization message.
                        }
                    }
                }
            }
            break;

        default:
            break;
        }
    }
Beispiel #8
0
    void OnDevicePoseStatusChanged(TrackableBehaviour.Status status, TrackableBehaviour.StatusInfo statusInfo)
    {
        switch (statusInfo)
        {
        case TrackableBehaviour.StatusInfo.NORMAL:
        case TrackableBehaviour.StatusInfo.UNKNOWN:
        case TrackableBehaviour.StatusInfo.INITIALIZING:
        case TrackableBehaviour.StatusInfo.EXCESSIVE_MOTION:
        case TrackableBehaviour.StatusInfo.INSUFFICIENT_FEATURES:
        case TrackableBehaviour.StatusInfo.INSUFFICIENT_LIGHT:
        case TrackableBehaviour.StatusInfo.RELOCALIZING:
            break;

        default:
            break;
        }
    }
Beispiel #9
0
    void OnDevicePoseStatusChanged(TrackableBehaviour.Status status, TrackableBehaviour.StatusInfo statusInfo)
    {
        Debug.Log("PlaneManager.OnDevicePoseStatusChanged(" + status + ", " + statusInfo + ")");

        StatusCached     = status;
        StatusInfoCached = statusInfo;

        // If the timer is running and the status is no longer Relocalizing, then stop the timer
        if (statusInfo != TrackableBehaviour.StatusInfo.RELOCALIZING && this.timer.Enabled)
        {
            this.timer.Stop();
        }

        switch (statusInfo)
        {
        case TrackableBehaviour.StatusInfo.NORMAL:
            break;

        case TrackableBehaviour.StatusInfo.UNKNOWN:
            break;

        case TrackableBehaviour.StatusInfo.INITIALIZING:
            break;

        case TrackableBehaviour.StatusInfo.EXCESSIVE_MOTION:
            break;

        case TrackableBehaviour.StatusInfo.INSUFFICIENT_FEATURES:
            break;

        case TrackableBehaviour.StatusInfo.INSUFFICIENT_LIGHT:
            break;

        case TrackableBehaviour.StatusInfo.RELOCALIZING:
            // Start a 10 second timer to Reset Device Tracker
            if (!this.timer.Enabled)
            {
                this.timer.Start();
            }
            break;

        default:
            break;
        }
    }
Beispiel #10
0
    void OnDevicePoseStatusChanged(TrackableBehaviour.Status status, TrackableBehaviour.StatusInfo statusInfo)
    {
        Debug.Log("GroundPlaneUI.OnDevicePoseStatusChanged(" + status + ", " + statusInfo + ")");

        this.statusCached     = status;
        this.statusInfoCached = statusInfo;

        string statusMessage = "";

        switch (statusInfo)
        {
        case TrackableBehaviour.StatusInfo.NORMAL:
            statusMessage = "";
            break;

        case TrackableBehaviour.StatusInfo.UNKNOWN:
            statusMessage = "Limited Status";
            break;

        case TrackableBehaviour.StatusInfo.INITIALIZING:
            statusMessage = "Initializing Tracker";
            break;

        case TrackableBehaviour.StatusInfo.EXCESSIVE_MOTION:
            statusMessage = "Move slower";
            break;

        case TrackableBehaviour.StatusInfo.INSUFFICIENT_FEATURES:
            statusMessage = "Not enough visual features in the scene";
            break;

        case TrackableBehaviour.StatusInfo.RELOCALIZING:
            statusMessage = "Point camera to previous position to restore tracking";
            break;

        default:
            statusMessage = "";
            break;
        }

        StatusMessage.Instance.Display(statusMessage);
        // Uncomment the following line to show Status and StatusInfo values
        //StatusMessage.Instance.Display(status.ToString() + " -- " + statusInfo.ToString());
    }
    private void Update()
    {
        if (theTrackable.CurrentStatusInfo == lastStatus)
        {
            return;
        }
        if (theTrackable.CurrentStatusInfo == TrackableBehaviour.StatusInfo.NORMAL)
        {
            petController.LoadPetByTarget(parent, theTrackable.TrackableName);

            lastStatus = theTrackable.CurrentStatusInfo;
            HUD.SetActive(true);
        }
        else if (theTrackable.CurrentStatusInfo == TrackableBehaviour.StatusInfo.UNKNOWN)
        {
            petController.UnloadPetByTarget(theTrackable.TrackableName);

            lastStatus = theTrackable.CurrentStatusInfo;
            HUD.SetActive(false);
        }
    }
Beispiel #12
0
 void OnDevicePoseStatusChanged(TrackableBehaviour.Status status, TrackableBehaviour.StatusInfo statusInfo)
 {
     Debug.Log("OnDevicePoseStatusChanged(" + status + ", " + statusInfo + ")");
 }
    void OnDevicePoseStatusChanged(TrackableBehaviour.Status status, TrackableBehaviour.StatusInfo statusInfo)
    {
        Debug.Log("GroundPlaneUI.OnDevicePoseStatusChanged(" + status + ", " + statusInfo + ")");

        string statusMessage = "";

        switch (statusInfo)
        {
        case TrackableBehaviour.StatusInfo.NORMAL:
            statusMessage = "";
            break;

        case TrackableBehaviour.StatusInfo.UNKNOWN:
            statusMessage = "Limited Status";
            break;

        case TrackableBehaviour.StatusInfo.INITIALIZING:
            statusMessage = "Point your device to the floor and move to scan";
            break;

        case TrackableBehaviour.StatusInfo.EXCESSIVE_MOTION:
            statusMessage = "Move slower";
            break;

        case TrackableBehaviour.StatusInfo.INSUFFICIENT_FEATURES:
            statusMessage = "Not enough visual features in the scene";
            break;

        case TrackableBehaviour.StatusInfo.INSUFFICIENT_LIGHT:
            statusMessage = "Not enough light in the scene";
            break;

        case TrackableBehaviour.StatusInfo.RELOCALIZING:
            // Display a relocalization message in the UI if:
            // * No AnchorBehaviours are being tracked
            // * None of the active/tracked AnchorBehaviours are in TRACKED status

            // Set the status message now and clear it none of conditions are met.
            statusMessage = "Point camera to previous position to restore tracking";

            StateManager stateManager = TrackerManager.Instance.GetStateManager();
            if (stateManager != null)
            {
                // Cycle through all of the active AnchorBehaviours first.
                foreach (TrackableBehaviour behaviour in stateManager.GetActiveTrackableBehaviours())
                {
                    if (behaviour is AnchorBehaviour)
                    {
                        if (behaviour.CurrentStatus == TrackableBehaviour.Status.TRACKED)
                        {
                            // If at least one of the AnchorBehaviours has Tracked status,
                            // then don't display the relocalization message.
                            statusMessage = "";
                        }
                    }
                }
            }
            break;

        default:
            statusMessage = "";
            break;
        }

        //StatusMessage.Instance.Display(statusMessage);
        // Uncomment the following line to show Status and StatusInfo values
        //StatusMessage.Instance.Display(status.ToString() + " -- " + statusInfo.ToString());
    }
Beispiel #14
0
    void OnDevicePoseStatusChanged(TrackableBehaviour.Status status, TrackableBehaviour.StatusInfo statusInfo)
    {
        string statusMessage = "";

        m_currStatusInfo = statusInfo;

        SetActiveMessagePutObject(true);

        switch (statusInfo)
        {
        case TrackableBehaviour.StatusInfo.NORMAL:
        {
            statusMessage = "";
            HideSnackBar();
            if (imageVideo.IsPlaying)
            {
                imageVideo.StopVideo();
            }
            break;
        }

        case TrackableBehaviour.StatusInfo.UNKNOWN:
            statusMessage = "No hay suficientes características visuales (<b>ver en botón información</b>)";
            break;

        case TrackableBehaviour.StatusInfo.INITIALIZING:
            statusMessage = "<b>Apunta</b> con tu dispositivo al suelo y <b>mueve</b> para escanear";
            break;

        case TrackableBehaviour.StatusInfo.EXCESSIVE_MOTION:
            statusMessage = "Mueve tu dispositivo mas <b>lento</b>";
            break;

        case TrackableBehaviour.StatusInfo.INSUFFICIENT_FEATURES:
            statusMessage = "No hay suficientes características visuales (<b>ver en botón información</b>)";
            break;

        case TrackableBehaviour.StatusInfo.INSUFFICIENT_LIGHT:
            statusMessage = "No hay suficiente <b>luz</b>";
            break;

        case TrackableBehaviour.StatusInfo.RELOCALIZING:
            // Display a relocalization message in the UI if:
            // * No AnchorBehaviours are being tracked
            // * None of the active/tracked AnchorBehaviours are in TRACKED status

            // Set the status message now and clear it none of conditions are met.
            statusMessage = "<b>Mueve</b> la cámara al punto anterior para restaurar la detección";

            StateManager stateManager = TrackerManager.Instance.GetStateManager();
            if (stateManager != null)
            {
                // Cycle through all of the active AnchorBehaviours first.
                foreach (TrackableBehaviour behaviour in stateManager.GetActiveTrackableBehaviours())
                {
                    if (behaviour is AnchorBehaviour)
                    {
                        if (behaviour.CurrentStatus == TrackableBehaviour.Status.TRACKED)
                        {
                            // If at least one of the AnchorBehaviours has Tracked status,
                            // then don't display the relocalization message.
                            statusMessage = "";
                        }
                    }
                }
            }
            break;

        default:
            statusMessage = "";
            break;
        }

        if (statusInfo != TrackableBehaviour.StatusInfo.NORMAL)
        {
            HideMenu();

            ShowSnackBar(statusMessage);
            if (!imageVideo.IsPlaying)
            {
                imageVideo.PlayVideo();
            }
        }
        else
        {
            if (!m_IsGroundDetected)
            {
                statusMessage = "<b>Apunta</b> con tu dispositivo al suelo y <b>mueve</b> para escanear";
                ShowSnackBar(statusMessage);
                if (!imageVideo.IsPlaying)
                {
                    imageVideo.PlayVideo();
                }
            }
            else
            {
                ShowMenu();
            }
        }
    }