Log in or register to post comments

Update Trackable Found/Lost Status

September 10, 2012 - 2:02am #1

How can I get the current Found/Lost Status from AR-Camera? OnTrackableStateChanged() is called only when the status changes.

But I would like to manually check if the status has changed.

My AR-Camera is always on, only the ImageTarget it is activated during of the application. So if I point the camera on the Target in the activation of the target image, OnTrackableStateChanged() can not get a new state because the target was not lost for AR-Camera. The object is not visible, because the TrackableEventHandler thinks that no target is found, because it gets the Lost-Status at the start.

How can I update the status of the camera?

Update Trackable Found/Lost Status

September 11, 2012 - 1:59pm #7

Take a look at the UpdateTrackers method in QCARManager, line 325. This shows how to iterate through the active trackables to determine their status.

Update Trackable Found/Lost Status

September 11, 2012 - 10:26am #6

If I call at the Start() the TrackableFound()-method, then when activating ImageTarget and the camera was not pointing at the target, the object is shown. 

This is also incorrect ;).

Update Trackable Found/Lost Status

September 11, 2012 - 8:20am #5

I think i get what you mean. You should try to add a call to your show function inside start. I had the same problem before I had to move away from the trackable before it could show if I only used onFound method inside onTrackableStateChanged, then i placed the onFound() inside start (after

 

mTrackableBehaviour = GetComponent<TrackableBehaviour>();

        if (mTrackableBehaviour)

        {

            mTrackableBehaviour.RegisterTrackableEventHandler(this);

        }

 so it looks like this

void Start () {

 

   mTrackableBehaviour = GetComponent<TrackableBehaviour>();

        if (mTrackableBehaviour)

        {

            mTrackableBehaviour.RegisterTrackableEventHandler(this);

        }

OnTrackingFound();

}

 

then in onTrackingFound()

//Do watever you want to do when it is found

 

Also for future reference if start is called then it means that a trackable was found. but hasnt yet been registered, so onTrackableStateChanged cannot be called yet.

Update Trackable Found/Lost Status

September 11, 2012 - 7:25am #4

Exactly, OnTrackableStateChange() is not being called when the AR-Camera start first and the Image Target is activated later with camera towards the target.

But when I point the camera not longer at the target and then i point the camera at the target again, OnTrackableStateChange()  is called and my object will be shown.

 

 

Update Trackable Found/Lost Status

September 11, 2012 - 5:55am #3

Hi Russel,

I am not sure I am entirely clear as to what you are trying to do, so let me see if I have understood correctly:

Essentially you want to know if it is possible to poll the AR-Camera to check its Found/Lost status because in your application OnTrackableStateChange() is not being called?

...and the reason it is not being called is because in your application the camera starts first and then ImageTarget is activated later on?

Any clarification would be helpful.

 

thanks,

N

Update Trackable Found/Lost Status

September 11, 2012 - 1:05am #2

Do you understand my problem?

Log in or register to post comments