LoadTrackables and AddTrackables Issue

Post Reply
jeffweber
Posts: 6
Joined: Tue Jun 18, 2013 10:51 am

LoadTrackables and AddTrackables Issue

Post by jeffweber » Tue Jun 18, 2013 11:29 am

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

NaturalPoint-Dustin
Posts: 612
Joined: Tue Mar 19, 2013 5:03 pm

Re: LoadTrackables and AddTrackables Issue

Post by NaturalPoint-Dustin » Tue Jun 18, 2013 12:21 pm

Hi Jeff,

Could we see a sample of your code?
Dustin
Technical Support Engineer
OptiTrack | TrackIR | SmartNav

jeffweber
Posts: 6
Joined: Tue Jun 18, 2013 10:51 am

Re: LoadTrackables and AddTrackables Issue

Post by jeffweber » Wed Jun 19, 2013 5:38 am

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

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

Re: LoadTrackables and AddTrackables Issue

Post by beckdo » Thu Jun 20, 2013 10:42 am

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.

Post Reply