Page 1 of 1

Rigid Bodies - individual marker locations

Posted: Tue Dec 04, 2012 3:54 am
by Nem
Once a rigid body is defined in tracking tools, is it possible to stream the xyz coordinates of each individual marker that makes up the body?

I am currently reading this information into matlab, and while I can get the coordinates of the rigid body without a problem, the individual markers are not so straightforward. Individual markers can be streamed and received but they don't seem to be labelled in any coherent or consistent way.

When streaming all the individual markers to matlab, is it possible to know which marker belongs to which rigid body? and to have the labelling be consistent between frames?

Re: Rigid Bodies - individual marker locations

Posted: Tue Dec 04, 2012 10:59 am
by Seth Steiling
If you are streaming via our NatNet interface, you have access to rigid bodies plus XYZ for their individual markers. If you're streaming via VRPN, it only sends 6 DOF for rigid bodies. I believe the same is true for trackd.

Re: Rigid Bodies - individual marker locations

Posted: Tue Dec 04, 2012 1:42 pm
by Nem
But is there a way to tell which rigid body an individual marker belongs to?

I can get a list of every marker being captured, but as far as I can see they're not labelled in any way that lets me know who they belong to

and yes, this is streamed via natnet into matlab

Re: Rigid Bodies - individual marker locations

Posted: Wed Dec 05, 2012 12:11 pm
by morgan
The NatNet FrameofMocap data contains all the mocap data in several different formats, depending on your use case and what type of models you have defined in your server application.

For your situation, it sounds like the sRigidBodyData structure within the frame of mocap data is what you want. It contains the list of rigid bodies, and for each rigid body -

- the # of markers associated with it
- their ids
- their positions

Code: Select all

// Rigid Body Data (single frame of one rigid body)
typedef struct sRigidBodyData
{
    int ID;                                 // RigidBody identifier
    float x, y, z;                          // Position
    float qx, qy, qz, qw;                   // Orientation
    int nMarkers;                           // Number of markers associated with this rigid body
    MarkerData* Markers;                    // Array of marker data ( [nMarkers][3] )
    int* MarkerIDs;                         // Array of marker IDs
    float* MarkerSizes;                     // Array of marker sizes
    float MeanError;                        // Mean measure-to-solve deviation
    sRigidBodyData()
    {
        Markers = 0; MarkerIDs = 0; MarkerSizes = 0;
    }
} sRigidBodyData;
In this way - you should have consistent marker ids, as well as which rigid body they belong to. I believe the SampleClient3d.cpp illustrates this.

hope this helps,

Morgan