Log in or register to post comments

Iterate through active dataset

June 6, 2012 - 5:41pm #1

Have pity on a poor iOS developer who's a little confused by some of the Qualcomm code (We don't deal often with things like the :: scope resolution operator for example).

I need to prepare some objects to correspond with every trackable object in the active dataset. I would like to iterate through the active dataset using the trackable name as a key, and create an NSDictionary of my own objects that have various properties I need (the model I'm using for each target and other data). What's a good strategy to create a 30-60 item NSDictionary of my custom objects anytime I load a new data set?

I see things like QCAR::ImageTracker::getActiveDataSet, in the API, but I'm a bit vexed by scope and syntax issues with trying to figure out how to use this and some of the other QCAR methods. Thanks in advance.

Iterate through active dataset

November 5, 2012 - 3:48am #6


Please PM me with a link to your project and I will aim to take a look later this week.


Iterate through active dataset or load multiple markers

November 5, 2012 - 1:54am #5

NalinS, I am working on vuforia ar sdk for iOS and videoplayback example of this sdk..but when i am using more than 4 marker image in a dataset the marker tecture image is loading correctly but the tecture video player is showing a "X" ERROR icon...please help me. How can i use video playback example for atleast 20 different marker images... ???

Re: Iterate through active dataset

June 8, 2012 - 3:34am #4

Once you have a dataset you can iterate through it using getNumTrackables() to get the number of trackables, and getTrackable(i) to get the QCAR trackable itself.

In QCARUtils.mm there is a function called findImageTarget() that shows how to do this.

Hopefully this should make things clearer. If not then let me know.


Re: Iterate through active dataset

June 7, 2012 - 10:38am #3

Thanks NalinS, I've read through the guide, made some sample apps with the Vuforia libraries, and gotten familiar with the general architecture. This is more of a nuts-and-bolts type of question, created by the fact that the QCAR libraries are cross platform (not a criticism, the technology is clearly excellent).

Specifically, how do I loop through the results of getActiveDataSet? I certainly know how to access and iterate through an Objective-C collection class like NSArray or NSDictionary, but I'm confused about how to even access this QCAR method. Or is this the even the best method to build my dictionary of trackable-related objects? The sample projects I've examined make sense for a dataset with only a few trackables, but what if you have closer to the 50 or 60 limit? Certainly I don't want to use this approach (as seen in the ImageTargets app)

if (!strcmp(trackable->getName(), "NameOfYourTrackableHere")) {
// draw your object or whatever else you want to do now that this particular target has been found

I want instead to get the active trackable, and retrieve the related object from an NSDictionary of TargetObjects (just a simple model class I wrote with the 3D geometry and other data associated with each trackable item). This is much cleaner than a long list of if statements. But how do I iterate through the total active dataset and populate my NSDictionary with my TargetObjects?

Thanks again. It's magical technology isn't it? :)

Re: Iterate through active dataset

June 7, 2012 - 3:00am #2

I just wanted to check whether you have read through the developer guide at https://ar.qualcomm.at/qdevnet/developer_guide ?

It's probably worth going through this and then as an exercise creating your own trackable and using it in the image targets application as this should give you a feel for how thing might work for you.

Essentially you can have multiple datasets here, each of which can contain a number of trackables of which up to five can be tracked simultaneously.

Not that only one dataset can be active at any one time [qUtils activateDataSet:targetEntry.dataSet];

Probably your best bet is to create a dataset via the MyTrackables section of the web site an incorporate it into your app subsequently.



BTW The core QCAR code is multi platform, and hence it makes heavy use of templates, rather than being in Objective C

Log in or register to post comments