RB_CameraCount

Post Reply
kjjohnsen
Posts: 12
Joined: Mon Oct 01, 2007 12:39 pm

RB_CameraCount

Post by kjjohnsen »

Why is it that the result of RB_CameraCount() does not become valid until about 1 second after I initialize the rigid body toolkit? Is there any way to make this instantaneous?

This works:
RB_InitializeRigidBody(); RB_LoadProfile(np_calib_file.c_str());
RB_LoadDefinition(np_rigid_file.c_str());
RB_StartCameras();
Sleep(1000);
int numCams = RB_CameraCount();

This doesn't work:
RB_InitializeRigidBody(); RB_LoadProfile(np_calib_file.c_str());
RB_LoadDefinition(np_rigid_file.c_str());
RB_StartCameras();
int numCams = RB_CameraCount();
beckdo
Posts: 520
Joined: Tue Jan 02, 2007 2:02 pm

Re: RB_CameraCount

Post by beckdo »

The camera initialization takes some time, as you've observed. The library doesn't force the application level to wait for initialization. Unfortunately there isn't a function to stall execution until the cameras are ready. You can poll the RB_CameraCount() wait for it to become non-zero and optionally time out if a certain amount of time passes.

We're actively updating the RB API currently for version 2.0 of the Tracking Toolkit. There is more comprehensive support during initialization.

If you're interested email support@naturalpoint.com for access to the beta build of v2.0 of the Tracking Toolkit. It's a big jump over the RB Tool & Calibration Tool.
Post Reply