Page 1 of 1

LoadTrackables and AddTrackables Issue

Posted: Tue Jun 18, 2013 11:29 am
by jeffweber
I've created two seperate RigidBody files (.tra files) each containing a single Rigid Body exported from Motiv.

When I try to track both rigid bodies in my application by calling TT_LoadTrackables(RBFile1.tra) first, then calling TT_AddTrackables(RBFile2.tra) only the Rigid Body from the 2nd file I load seems to get tracked. (TT_GetTrackableCount() is 1)

If I switch the order in which I load the files, the last one I add/load is always the only one that is tracked.

Am I missing something?

I expected that both rigid bodies would be tracked and TT_GetTrackableCount() would return 2

-Jeff Weber

Re: LoadTrackables and AddTrackables Issue

Posted: Tue Jun 18, 2013 12:21 pm
by NaturalPoint-Dustin
Hi Jeff,

Could we see a sample of your code?

Re: LoadTrackables and AddTrackables Issue

Posted: Wed Jun 19, 2013 5:38 am
by jeffweber
I'm hitting the tracking API through a managed wrapper, but here are the relevant pieces of code:

When screen loads I call:

Code: Select all

        _algorithmCoordinator.LoadTrackablesFile(Trackables.RIGID_BODY_1);
        _algorithmCoordinator.AddTrackablesFile(Trackables.RIGID_BODY_2);
This in-turn calls:

Code: Select all


        public void LoadTrackablesFile(String trackableDefinition)
        {
            HandleReturnValues(NPTrackingTools.TT_LoadTrackables(trackableDefinition));
        }

        public void AddTrackablesFile(String trackableDefinition)
        {
            HandleReturnValues(NPTrackingTools.TT_AddTrackables(trackableDefinition));
        }
The actual tracking tools methods are called via a DLLImport like so:

Code: Select all

        [DllImport("NPTrackingToolsx64.dll")]
        public static extern int TT_AddTrackables(String filename);

        [DllImport("NPTrackingToolsx64.dll")]
        public static extern int TT_LoadCalibration(String filename);
As mentioned in my previous post, calling LoadTrackables then AddTrackables will result in only the rigid body from the AddTrackables call to be tracked.

If I export multiple rigid bodies into a single file and call LoadTrackables with that file path, then I am able to track multiple rigid bodies but I'd prefer, in certain intances, to keep my rigid bodies in seperate files and load the trackable as I need it.

Thanks for the help.

-Jeff

Re: LoadTrackables and AddTrackables Issue

Posted: Thu Jun 20, 2013 10:42 am
by beckdo
This issue with the API has been resolved. Thank you for reporting it. The fix will be included in the next production release of the software. If you need an unstable build to test with before that please contact support and we can get you something.