Build Rigid Body Description for SimpleServer

NatNet, VRPN, TrackD, and Plugins
Post Reply
micsfox
Posts: 6
Joined: Mon Mar 14, 2011 11:14 am

Build Rigid Body Description for SimpleServer

Post by micsfox » Tue May 31, 2011 12:31 pm

I'd like to write an executable similar to SimpleServer to stream rigid body data so that I don't have to have Tracking Tools running.

I need to know how to build up the rigid body description in the BuildDescription method.

I was hoping that I could use "Save Trackables..." in Tracking Tools and use the information in the file created to build up the description, but I see now that it saves to a proprietary format that I cannot read in a text editor.

I'm assuming that I can use the Marker Info from Tracking Tools to infer the relative marker positions offset to some parent, but how do I create the parent? Is the parent also a marker?

Do I have to first create individual markers and add them to the MarkerSetDescription before creating a rigid body comprised of those markers? I don't see how the individual markers of the RigidBodyDescription are tied together.

micsfox
Posts: 6
Joined: Mon Mar 14, 2011 11:14 am

Re: Build Rigid Body Description for SimpleServer

Post by micsfox » Tue May 31, 2011 12:37 pm

[img:left]https://lh4.googleusercontent.com/-GLxG ... 20info.png[/img]

Image of the rigid body I would like to describe.

morgan
NaturalPoint Employee
NaturalPoint Employee
Posts: 200
Joined: Tue Jun 24, 2008 2:01 pm
Location: Corvallis, OR, USA
Contact:

Re: Build Rigid Body Description for SimpleServer

Post by morgan » Wed Jun 01, 2011 10:49 am

In NatNet, MarkerSet descriptions/data are treated separately from RigidBody descriptions/data. In your case, for streaming RigidBody, you can ignore the MarkerSet description.

RigidBody descriptions do not contain an explicit description of the associated markers. However, marker data is present in the RigidBody data. Each marker will have it own ID. So in effect the markers associated with a rigid body are "described" with each frame of RigidBody data.

For your RigidBody, it is enough to simply add the marker data to your rigidbody when sending data. From SimpleServer:

Code: Select all

pRB->nMarkers = 3;
pRB->Markers = new MarkerData[pRB->nMarkers];
pRB->MarkerIDs = new int[pRB->nMarkers];
pRB->MarkerSizes = new float[pRB->nMarkers];
pRB->MeanError = 0.0f;
for(int iMarker=0; iMarker < pRB->nMarkers; iMarker++)
{	    
     pRB->Markers[iMarker][0] = iMarker + 0.1f;	// x
     pRB->Markers[iMarker][1] = iMarker + 0.2f;	// y
     pRB->Markers[iMarker][2] = iMarker + 0.3f;	// z
     pRB->MarkerIDs[iMarker] = iMarker + 200;
     pRB->MarkerSizes[iMarker] = 77.0f;
}

That said, the recommended path for streaming trackables without using the TrackingTools interface is to use the TrackingTools API, instead of or in conjunction with, NatNet. This provides you with all the power of TrackingTools without requiring the user interface.

Is this an option for you?

Morgan

Post Reply