Log in or register to post comments

Why OnTrackerStarted gets called only when script is attached to ground plane stage

October 5, 2018 - 7:01am #1

Hi everyone,

I am new to Vuforia. Sorry if i am asking an obvious question. 

I have been trying to figure out how can i inform user when device tracking is lost. For example, when you go in front of a white wall you can not track device position anymore. For that i have tried a lot of things including TrackableBehaviour.Status but that is not what i want i just wanna see when ARCamera position is not updated, At the end i have found out that : 

 

void Start()

   {

        DeviceTrackerARController.Instance.RegisterTrackerStartedCallback(OnTrackerStarted);

    }

void OnTrackerStarted()

    {

        Debug.Log("OnTrackerStarted() called.");

      

        PDT = TrackerManager.Instance.GetTracker<PositionalDeviceTracker>();



        if (PDT != null)

        {

            if (!PDT.IsActive)

                PDT.Start();

            Debug.Log("PositionalDeviceTracker is Active?: " + PDT.IsActive);

        }

    }

 

when i use the code above  OnTrackerStarted function is called only if i attach this script to Ground Plane Stage. It confuses me a lot why is this the issue. Similar thing happens when you want to initiate positional device tracker manually. If the script is not attached to ARCamera you can not do that either. I would be happy if you can enlighten me on this issue. Thank you in advance.

Log in or register to post comments