I'm trying to simultaneously use targets generated online via TMS while also using targets that I'm capturing locally with UDT.
At the start TMS works, but once I try a UDT capture that fails the first time and then the second attempt at UDT works. TMS does not work alongside UDT at any point though.
Hopefully you can point me in the right direction on how to setup my dataset initilizations so I can use both at the same time.
Initiate via UDTQCARUtils:
qUtils = [UDTQCARutils getInstance];
Call loadTrackTMSUDT:
case APPSTATUS_LOAD_TRACKER:
NSLog(@"APPSTATUS_LOAD_TRACKER");
// Load tracker data
[self performSelectorInBackground:@selector(loadTrackerTMSUDT) withObject:nil];
break;
This code resides in QCARUtils and have copied in the dataset initialization from UDTQCARUtils
[code]
- (void)loadTrackerTMSUDT
{
// Background thread must have its own autorelease pool
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
BOOL haveLoadedOneDataSet = NO;
if (targetType != TYPE_FRAMEMARKERS)
{
// Load all the requested datasets
for (DataSetItem *aDataSet in targetsList)
{
if (aDataSet.path != nil)
{
aDataSet.dataSet = [self loadDataSet:aDataSet.path];
if (haveLoadedOneDataSet == NO)
{
if (aDataSet.dataSet != nil)
{
// activate the first one in the list
[self activateDataSet:aDataSet.dataSet];
haveLoadedOneDataSet = YES;
}
}
}
}
// Check that we've loaded at least one target
if (!haveLoadedOneDataSet)
{
NSLog(@"QCARutils: Failed to load any target");
appStatus = APPSTATUS_ERROR;
errorCode = QCAR_ERRCODE_LOAD_TARGET;
}
}
////////// UDT
NSLog(@"UDTQCARutils: LoadTrackerData");
// 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 != nil)
{
// Create the data set:
dataSetUserDef = imageTracker->createDataSet();
if (dataSetUserDef != nil)
{
if (!imageTracker->activateDataSet(dataSetUserDef))
{
NSLog(@"Failed to activate data set.");
appStatus = APPSTATUS_ERROR;
errorCode = QCAR_ERRCODE_LOAD_TARGET;
}
}
}
NSLog(@"Successfully loaded and activated data set.");
// Continue execution on the main thread
if (appStatus != APPSTATUS_ERROR)
[self performSelectorOnMainThread:@selector(bumpAppStatus) withObject:nil waitUntilDone:NO];
[pool release];
}
[/code]
LOG
TMS works fine at start:
INFO/AR(130) 2012-12-21 15:03:52: ImageTracker: Successfully created datasetSuccessfully loaded data set.Successfully activated data set.UDTQCARutils: LoadTrackerDataINFO/AR(130) 2012-12-21 15:03:52: ImageTracker: Successfully created datasetSuccessfully loaded and activated data set.UDT fails upon first try (no TMS):
RefFreeFrame startImageTargetBuilder()#DEBUG actionButtonPressedTRYING UserTarget-1#DEBUG camera button tapped Built target, reactivating dataset with new targetRefFreeFrame stopImageTargetBuilder() Attempting to transfer the trackable source to the dataset ERROR/AR(130) 2012-12-21 15:04:57: Failed to create Trackable because the dataset is currently active. ERROR/AR(130) 2012-12-21 15:04:57: ImageTracker: Failed to activate data set because the data set is already active.UDT works on second try, but no TMS dataset active
#DEBUG actionButtonPressedRefFreeFrame startImageTargetBuilder()#DEBUG add button tapped#DEBUG badFrameQuality#DEBUG goodFrameQuality#DEBUG actionButtonPressedTRYING UserTarget-2#DEBUG camera button tapped Built target, reactivating dataset with new targetRefFreeFrame stopImageTargetBuilder() Attempting to transfer the trackable source to the dataset INFO/AR(130) 2012-12-21 15:05:12: Successfully created ImageTarget.
pPlease Post on iOS section
Hi, could you post this question in the iOS section of the Forum (you will get prompt reply from there on iOS related questions)
https://developer.vuforia.com/forum/ar-technical-discussion/vuforia-sdk/ios
Thank you.
I posted in iOS - thanks.
I posted in iOS - thanks.
Thank you.
Thank you.