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
LoadTrackables and AddTrackables Issue
-
- Posts: 609
- Joined: Tue Mar 19, 2013 5:03 pm
Re: LoadTrackables and AddTrackables Issue
Hi Jeff,
Could we see a sample of your code?
Could we see a sample of your code?
Dustin
Technical Support Engineer
OptiTrack | TrackIR | SmartNav
Technical Support Engineer
OptiTrack | TrackIR | SmartNav
Re: LoadTrackables and AddTrackables Issue
I'm hitting the tracking API through a managed wrapper, but here are the relevant pieces of code:
When screen loads I call:
This in-turn calls:
The actual tracking tools methods are called via a DLLImport like so:
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
When screen loads I call:
Code: Select all
_algorithmCoordinator.LoadTrackablesFile(Trackables.RIGID_BODY_1);
_algorithmCoordinator.AddTrackablesFile(Trackables.RIGID_BODY_2);
Code: Select all
public void LoadTrackablesFile(String trackableDefinition)
{
HandleReturnValues(NPTrackingTools.TT_LoadTrackables(trackableDefinition));
}
public void AddTrackablesFile(String trackableDefinition)
{
HandleReturnValues(NPTrackingTools.TT_AddTrackables(trackableDefinition));
}
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);
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
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.