TT_GetCameraManager::GetCameraList hang the tracking

Post Reply
martinv
Posts: 13
Joined: Tue Aug 21, 2012 5:15 am

TT_GetCameraManager::GetCameraList hang the tracking

Post by martinv » Thu Jan 10, 2013 1:13 pm

A call to GetCameraList from the CameraManager will hang the tracking of the rigid body.

From the TrackingTool API, there is a function called TT_GetCameraManager.

I tried to use the function to have access to the cameras to know if they are connected or not.

I have written this function:

void HeadTrackerManager::CheckCameraStatus()
{
CameraLibrary::CameraManager* p_myCameraManager = NULL;
p_myCameraManager = TT_GetCameraManager();

CameraLibrary::CameraList CamList;
p_myCameraManager->GetCameraList(CamList);
}

The problem is when a call to GetCameraList is done, once I exit my function, both cameras are "reinitialized".
I see on both cameras the digits �spinning� and after a few seconds then the digit (on both cameras) shows nothing. After that, my application no longer tracks the rigid body. I have to restart my application to perform tracking again.

Question ) Do you have a sample application which shows how to use the GetCameralist correctly ?

Question) Is this a bug, or is there a restriction that we cannot use the GetCameraList() from the TrackingTool API ?



Note: I have used the TT_GetCameraManager with success to get the internal frequency of the OptiHub.
(This prooves that some part of the TT_GetCameraManager works.)

Here is the the function I wrote to do that:

bool HeadTrackerManager::CheckOptiHubInternalSync()
{
bool bReturnValue = false;

CameraLibrary::CameraManager* p_myCameraManager = NULL;
p_myCameraManager = TT_GetCameraManager();

if( p_myCameraManager != NULL )
{
// This works it return the name of the Optihub v2
const char* p_szName = p_myCameraManager->SyncDeviceName();

CameraLibrary::sSyncSettings mysSyncSettings;
p_myCameraManager->GetSyncSettings(mysSyncSettings);

// Note: it returns 120 when the custom sync mode is used in optihub and that we set 120
int InternalSyncGeneratorFrequency = mysSyncSettings.InternalSyncGeneratorFrequency;

int ImagerScanRate = mysSyncSettings.ImagerScanRate;

CameraLibrary::eSyncMode myeSyncMode;
myeSyncMode = p_myCameraManager->SyncMode();

bReturnValue = true;
}

return bReturnValue;
}


thank you,

beckdo
NaturalPoint Employee
NaturalPoint Employee
Posts: 520
Joined: Tue Jan 02, 2007 2:02 pm

Re: TT_GetCameraManager::GetCameraList hang the tracking

Post by beckdo » Thu Jan 17, 2013 6:13 pm

What commonly causes this problem is two different memory managers are being used. So only operations that involve heap allocation or deallocation are affected.

The Tracking Tools API is linked to the static runtime libraries. As a result you should check your project settings and ensure that your project also links to the static runtimes. Check Solution Properties->Configuration Properties->C/C++->Code Generation->Runtime Library.

Post Reply