Rigid Bodies - individual marker locations

Post Reply
Nem
Posts: 2
Joined: Tue Dec 04, 2012 3:48 am

Rigid Bodies - individual marker locations

Post by Nem » Tue Dec 04, 2012 3:54 am

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?

Seth Steiling
Posts: 1366
Joined: Fri Jun 27, 2008 11:29 am
Location: Corvallis, Oregon

Re: Rigid Bodies - individual marker locations

Post by Seth Steiling » Tue Dec 04, 2012 10:59 am

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.
Marketing Manager
TrackIR | OptiTrack

Nem
Posts: 2
Joined: Tue Dec 04, 2012 3:48 am

Re: Rigid Bodies - individual marker locations

Post by Nem » Tue Dec 04, 2012 1:42 pm

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

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

Re: Rigid Bodies - individual marker locations

Post by morgan » Wed Dec 05, 2012 12:11 pm

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

Post Reply