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 loadTrackerTMSUDT:
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
- (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];
}
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.
RefFreeFrame startImageTargetBuilder()#DEBUG actionButtonPressedTRYING UserTarget-1#DEBUG camera button tappedBuilt target, reactivating dataset with new targetRefFreeFrame stopImageTargetBuilder()Attempting to transfer the trackable source to the datasetERROR/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.
#DEBUG actionButtonPressedRefFreeFrame startImageTargetBuilder()#DEBUG add button tapped#DEBUG badFrameQuality#DEBUG goodFrameQuality#DEBUG actionButtonPressedTRYING UserTarget-2#DEBUG camera button tappedBuilt target, reactivating dataset with new targetRefFreeFrame stopImageTargetBuilder()Attempting to transfer the trackable source to the datasetINFO/AR(130) 2012-12-21 15:05:12: Successfully created ImageTarget.
Hi zakharm,
I will be looking at this shortly, so will try to get back to you in a few days.
N