Log in or register to post comments

Setting Extended tracking at runtime

May 16, 2014 - 4:36am #1

So we have finally configured our way around the new DLL and are abel to once again dynamically load in our datasets at runtime. The only remaining issue is that we want to set the Extended tracking value at runtime for our targets. 

 

I have followed the code at the bottom of this page: https://developer.vuforia.com/resources/dev-guide/extended-tracking but I end up with the error:

Type `TrackableBehaviour' does not contain a definition for `StartExtendedTracking' and no extension method `StartExtendedTracking' of type `TrackableBehaviour' could be found (are you missing a using directive or an assembly reference?)

to confirm, I am attempting this at the point where I attach my AR content to the runtime tracker.

void Attach()
	{
		Debug.Log("SEARCHING...");
		StateManager sm = TrackerManager.Instance.GetStateManager();

		IEnumerable<TrackableBehaviour> tbs = sm.GetTrackableBehaviours();

		foreach(TrackableBehaviour tb in tbs)
		{
			if(tb.TrackableName == m_Tracker_Name)
			{
                //some other things
                tb.StartExtendedTracking();

 

Setting Extended tracking at runtime

November 13, 2017 - 4:38pm #6

Hello fabiotg54,

You'll want to modify that function to no longer have arguments for trackableName or enabled and then modify the foreach loop to not check against trackableName or enabled, but instead just run the line "tb.Trackable.StopExtendedTracking();" With these changes, you'll have a simple function that takes in no arguments and just disables extended tracking on all trackables. Once this is done, you can hook this function up to a Unity button to trigger it.

Thanks,

-Vuforia Support

Setting Extended tracking at runtime

November 11, 2017 - 2:18pm #5

Hi there!

 

I'm not a programmer trying to make this works.

I'm using this code (image in attachment)

On my project I have 6 imageTargets and Vuforia is seted to show 3 per once.

What I want is to create a button to disable the Extended Tracking for all objects in scene.

What should I change in the code to make this works.

I'll appreciate your help.

 

Thanks

 

Fábio

AttachmentSize
Image icon Screen Shot 2017-11-11 at 20.14.14.png199.49 KB

Setting Extended tracking at runtime

June 9, 2014 - 6:02am #4

Developers do have access to the Trackable class,

but You need to cast the Trackable to an ImageTarget, a Multi-Target or a CylinderTarget,

depending on which specific type of trackable you are using;

practically, this means that the actual code would be (for example for an ImageTarget):

 

((ImageTarget) tb.Trackable).StartExtendedTracking();

((ImageTarget) tb.Trackable).StopExtendedTracking();

Note: you can also check what type of trackable it is, with this code:

if (tb.Trackable is ImageTarget) { ...

 

Setting Extended tracking at runtime

June 7, 2014 - 10:39am #3

I have exactly same Issue. At current Unity SDK version I cannot figure out wat to start/stop extended tracking at runtime.

 

Documentation also say this but devs dont have access to Trackable class in unity. Please help

"

If your App needs to dynamically enable / disable the extended tracking at runtime, do so by using theStartExtendedTracking() / StopExtendedTracking() API previously introduced, as illustrated in the following code example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Starts/stops extended tracking for a given trackable
public void UseExtendedTracking(string trackableName, bool enabled)
{
    IEnumerable<TrackableBehaviour> tbs =
 TrackerManager.Instance.GetStateManager().GetTrackableBehaviours();
 
    foreach (TrackableBehaviour tb in tbs) {
        // check trackable name
        if (tb.TrackableName.Equals( trackableName )) {
            if (enabled)
                tb.Trackable.StartExtendedTracking();
            else
                tb.Trackable.StopExtendedTracking();
            return;
        }
    }
}
 
"

 

Setting Extended tracking at runtime

May 19, 2014 - 5:35am #2

It looks like that the documentation is slightly incorrect here; the actual code would be:

  tb.Trackable.StartExtendedTracking(); // CORRECT

as opposed to the (incorrect) version:

  tb.StartExtendedTracking(); // INCORRECT

We will update the developer guide. Good catch !

 

Log in or register to post comments