Log in or register to post comments

Using both TMS-generated targets and UDT at the same time

December 22, 2012 - 7:36am #1

 

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 allocinit];

    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 dataset
Successfully loaded data set.
Successfully activated data set.
UDTQCARutils: LoadTrackerData
INFO/AR(130) 2012-12-21 15:03:52: ImageTracker: Successfully created dataset
Successfully loaded and activated data set.
 
UDT fails upon first try (no TMS):
RefFreeFrame startImageTargetBuilder()
#DEBUG actionButtonPressed
TRYING UserTarget-1
#DEBUG camera button tapped
 Built target, reactivating dataset with new target
RefFreeFrame 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 actionButtonPressed
RefFreeFrame startImageTargetBuilder()
#DEBUG add button tapped
#DEBUG badFrameQuality
#DEBUG goodFrameQuality
#DEBUG actionButtonPressed
TRYING UserTarget-2
#DEBUG camera button tapped
 Built target, reactivating dataset with new target
RefFreeFrame stopImageTargetBuilder()
 Attempting to transfer the trackable source to the dataset
 INFO/AR(130) 2012-12-21 15:05:12: Successfully created ImageTarget.

Hi zakharm, I will be looking

January 7, 2013 - 8:07am #4

Hi zakharm,

I will be looking at this shortly, so will try to get back to you in a few days.

N

Hi Nalin, Any new thoughts on

January 7, 2013 - 6:30am #3

Hi Nalin,

Any new thoughts on this?

Thanks!

Hi Zakram, This should be

December 24, 2012 - 12:27am #2

Hi Zakram,

This should be possible, though I will need to investigate and this may take a few days, particularly this week ;)

N

Log in or register to post comments