Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: fluctuhon on February 14, 2014, 12:23:24 PM

Title: Problem with Vuforia
Post by: fluctuhon on February 14, 2014, 12:23:24 PM
Hello,

I have some issues with Vuforia (v2.8.7), Playmaker (v1.7.7.f6) and Unity (4.3.4f1)
The playmaker events "VUFORIA / TRACKING FOUND" and VUFORIA / TRACKING LOST" seem to work randomly.
When i'm trying to track an image, Unity and vuforia can recognize it (the log says "Num trackables detected: 1" and the AR camera is following the image) but the event only triggers 1 out of 30 times..
I have the vuforia playmaker proxy in my scene and the vuforia trackable script in my image target (i also tried to desactivate the default trackable event script, same result)
I used vuforia with playmaker for another project without a single problem, but it was in Unity 3, is there a problem with unity 4 ?

Thanks in advance
Title: Re: Problem with Vuforia
Post by: xunxun on February 15, 2014, 12:56:38 PM
I'm even not able to import Playmaker proxy with Vuforia 2.8.7

==
Assets/PlayMaker Vuforia/Scripts/PlayMakerVuforiaProxy.cs(60,37): error CS1501: No overload for method `GetTracker' takes `1' arguments
===

Please update Add-On.

Unity 4.2.2 + PM 1.7.7 + Vuforia 2.8.7
thanks
Title: Re: Problem with Vuforia
Post by: fluctuhon on February 15, 2014, 02:17:03 PM
This issue can be fixed, it has been solved here : http://hutonggames.com/playmakerforum/index.php?topic=5817.0

My case is really strange and really random.. Sometimes it works, sometimes (often) it doesn't. I don't want to downgrade to unity 3 just because of that :/
Does anyone have an idea ?
Title: Re: Problem with Vuforia
Post by: xunxun on February 15, 2014, 10:11:18 PM
Please try this method. Simply, it's calling LOST/FOUND event from script

just few edit in DefaultTrackableEventHandler.cs

input this line into private void OnTrackingFound(). It looks like

Code: [Select]
//….
using HutongGames.PlayMaker;
public PlayMakerFSM myFSMtracking;
// drag and drop the FSM that has public "FOUND TARGET" and "LOST TARGET" events in inspector

Code: [Select]
private void OnTrackingFound()
    {
//Playmaker Event Trigger FOUND TARGET
myFSMtracking.Fsm.Event ("FOUND TARGET");
//... original code

}

and this if you want to recipe LOST target event

Code: [Select]
private void OnTrackingLost()
    {

myFSMtracking.Fsm.Event ("LOST TARGET");
//... original code
}


it works well and reliably for me.
Hope this helps.
Title: Re: Problem with Vuforia
Post by: fluctuhon on February 16, 2014, 07:58:30 AM
Thank you for your answer,

This seems to work more often than before, but it still not works every time..
I really can't understand why, maybe it's a more general problem with playmaker ?

EDIT : I tried downgrading to playmaker 1.5, Same problem
Title: Re: Problem with Vuforia
Post by: xunxun on February 16, 2014, 12:01:50 PM
did you try to detect multi-targets? if so, how many are they?
Title: Re: Problem with Vuforia
Post by: fluctuhon on February 16, 2014, 12:15:44 PM
I only have 1 image target in my scene, but i do have multiple images in my data set (20 images). These images can be pretty similar, so maybe vuforia is confused because of that
Title: Re: Problem with Vuforia
Post by: xunxun on February 16, 2014, 12:32:19 PM
did you use Makers? For some similar images, it's recommended that you should cover them by Makers then using "maker detector" is much faster and get results as expected.
Title: Re: Problem with Vuforia
Post by: fluctuhon on February 16, 2014, 12:42:58 PM
Are you referring to that : https://developer.vuforia.com/resources/dev-guide/frame-markers ?
I'm not sure what to do with that and how i'm suppose to use it with playmaker

Thank you again for your time and your answers :)

EDIT : Ok, i think i understand how this works. I'll try to use markers within my images and i'll see what happens. I'll let you know ;)
Title: Re: Problem with Vuforia
Post by: fluctuhon on February 17, 2014, 10:12:05 AM
I tried using markers : Same problem : the markers are detected but the playmaker event is not responding...
Title: Re: Problem with Vuforia
Post by: jeanfabre on February 17, 2014, 10:20:02 AM
Hi,

 Hopefully, I'll have time to look at this properly. I don't think it's a problem with PlayMaker, but more likely a change in Vuforia that broke the bridge I created.

bye,

 Jean
Title: Re: Problem with Vuforia
Post by: Playnoob on March 26, 2014, 06:51:16 AM
I'm bumping this thread, as I'm having the same issues - Using the playmaker Vuforia TrackingFound / TrackingLost is not triggering animation events consistently. - Sometimes it works, sometimes it does'nt.

(This maybe related however...and i'm only guessing here...  if Vuforia's "Extended Tracking" tickbox is checked.)

However, what i'd love to see is a Playmaker Vuforia interface that provides:


About the last one (Persistent Camera tracking) I'd written on the Vuforia forum and got this code from them to add. I quote:
You can enable/disable the PersisteExtendedTracking option using the C# API of the ImageTracker class; you can write a script and attach it to your ARCamera, and put this code in the script:
Code: [Select]
ImageTracker tracker = TrackerManager.Instance.GetTracker<ImageTracker>();
tracker.PersistExtendedTracking ( true ); // or false, to disable it

----
Yes, I'm embarrassed to say, I don't know the first thing on how to write the C script for this, that's why I use Playmaker ;)
Any help on how to implement the script or a Playmaker action to do this would be great.

Kind Regards.
Title: Re: Problem with Vuforia
Post by: jeanfabre on April 04, 2014, 07:21:57 AM
Hi,

 ok, done, Please redownload from the wiki. It does work better without persist on, but I guess it may be on a per case deal.

 you'll find an action to enable disable that setting, and also, it's also available in the vuforio behavior themselves, so you can check it manually on the behavior.


 Bye,

 Jean
Title: Re: Problem with Vuforia
Post by: nabilfx on May 10, 2014, 06:12:27 PM
How can I leave the Extended Tracking mode with Extended Persistent Tracking together, always ON both, in image target track.

in Unity.