Log in or register to post comments

Dynamical Tracker-Resources

March 21, 2012 - 1:07pm #1

Hi,

I have a game-concept where I need to download new Trackables form the internet and use them in the app. From what I understand, I need to build the trackable in advance and they are compiled into one resources.dat file. Is there a limit to trackers, cause I might need more than thousands (if users like the game). Is there a way of downloading new trackers and binding them into the installed app?

Most important question: is there a limit to the number of trackers in on resoruces.dat file? (Because I could just generate 1000 trackers and pre-install them in the app...)

Thanks for your help,
Silas

Dynamical Tracker-Resources

July 24, 2012 - 10:18am #6

There's an example of how to selectively activate and deactivate datasets at runtime in ImageTargets.cpp at line 89. The critical thing to recognize is that you need to do this in a callback that is called when the tracker has stopped.

e.g.

class ImageTargets_UpdateCallback : public QCAR::UpdateCallback
{  
    virtual void QCAR_onUpdate(QCAR::State& /*state*/)
    {
        if (switchDataSetAsap)
        {
            switchDataSetAsap = false;

            // Get the image tracker:
            QCAR::TrackerManager& trackerManager = QCAR::TrackerManager::getInstance();
            QCAR::ImageTracker* imageTracker = static_cast<QCAR::ImageTracker*>(
                trackerManager.getTracker(QCAR::Tracker::IMAGE_TRACKER));
            if (imageTracker == 0 || dataSetStonesAndChips == 0 || dataSetTarmac == 0 ||
                imageTracker->getActiveDataSet() == 0)
            {
                LOG("Failed to switch data set.");
                return;
            }
           
            if (imageTracker->getActiveDataSet() == dataSetStonesAndChips)
            {
                imageTracker->deactivateDataSet(dataSetStonesAndChips);
                imageTracker->activateDataSet(dataSetTarmac);
            }
            else
            {
                imageTracker->deactivateDataSet(dataSetTarmac);
                imageTracker->activateDataSet(dataSetStonesAndChips);
            }
        }
    }
};

 

The Java_com_qualcomm_QCARSamples_ImageTargets_ImageTargets_loadTrackerData method at line 181 will show you how to load datasets. And check out QCAR::DataSet in the API doc to see what types of storage can be used.

I imagine that you can maintain these datasets on the file system of your server, organized by their timestamp. Here's an example of how to download files and write them to the device's file system using the classes in java.io - http://www.helloandroid.com/tutorials/how-download-fileimage-url-your-device

Dynamical Tracker-Resources

July 24, 2012 - 9:05am #5

Hi David

I want to subdue my network burden by reducing the size by keeping multiple trackers on my server. Elaborating this,

1. I want to keep 7 different trackers. This will be downloaded based on timestamps. Let's assume it is for past 7 days so we keep last 7 days trackable.

2. A user will only download the trackable based on the existing trackable on device. Suppose he has not openned the app for last 3 days so last 3 days will only get downloaded.So he retains the 4 days data which already existed and lastest 3 days(Day 8,9,10) will get deleted. Its like keeping a First in last out of trackables. But it can be done only if I can have 7 different trackables.

So I want to know how to manage multiple trackable data in app.

Please help David.

Re: Dynamical Tracker-Resources

March 22, 2012 - 8:08am #4

Yes the targets need to be members of the same active dataset. There is currently no way around this. It's not a licensing restriction.

Something to keep in mind is that the more targets you have, the more computationally intensive it is to detect and track the set. So you're not going to be able to track thousands of targets simultaneously. Our recommendation of 60 reflects the practical limit.

Re: Dynamical Tracker-Resources

March 22, 2012 - 5:50am #3

Hi Kim,

this means, when I'm having two markers in different sets, I can't recognize them at the same time? This would practically make qualcomms solution useless for me :-( Is there some change towards more flexibility in sight?

Is there some kind of license model, where this kind of stuff is supported? Or some technical solution, for example, rebuild the resources on the phone? My goal is to let the user choose, which markers to track...

Thanks for your reply,
Silas

Re: Dynamical Tracker-Resources

March 21, 2012 - 7:02pm #2

You can load new datasets at runtime as of Vuforia 1.5. So at any time you could download a new dataset from the internet for use with your app (without having to recompile the app). The datasets must be created using the online TMS.

We recommend a limit of about 60 targets per dataset. Only one dataset can be activated at a time, but multiple datasets can be loaded.

- Kim

Log in or register to post comments