How 2 get Postion of sensors for only upper part of skeleton

Hello all ,

i am getting all the 24 sensor positions on the client side and now i want to hold the lower part and track only the position change of upper portion of body .

In client side , like if i want to track only the position of sensor 2 what should i code in order to get that . I am not able to get as to how to get the position for a single or 2-3 sensors .

Here’s the code through which i was tracking all the 24 sensors of skeleton .


#include
#include

#include

static float xpos,ypos,zpos,yprime,xprime;
int count = 0;

void VRPN_CALLBACK handle_tracker_change(void *userdata, const vrpn_TRACKERCB t)
{
static vrpn_TRACKERCB lr; // last report
static float dist_interval_sq = (float)0.004;

if ((lr.pos[0] – t.pos[0])*(lr.pos[0] – t.pos[0]) +
(lr.pos[1] – t.pos[1])*(lr.pos[1] – t.pos[1]) +
(lr.pos[2] – t.pos[2])*(lr.pos[2] – t.pos[2]) > dist_interval_sq){
printf(“Sensor %d is now at (%g,%g,%g)\n”,
t.sensor , t.pos[0], t.pos[1], t.pos[2]);
lr = t;

}

xpos = (float)t.pos[0];
ypos = (float)t.pos[1];
zpos = (float)t.pos[2];

double norm = sqrt(xpos*xpos + ypos*ypos + zpos*zpos);
double radius = .03; // radius is 3 cm
}

int main(int argc, char** argv)
{
/* flag used to stop the program execution */
bool running = true;

/* VRPN Tracker object */
vrpn_Tracker_Remote *tracker;

if (argc != 4) {
printf(“Usage: %s sFric dFric device_name\n”,argv[0]);
printf(” Example: %s 0.1 0.1 Phantom@myhost.mydomain.edu\n”,argv[0]);
exit(-1);
}
float sFric = (float)atof(argv[1]);
float dFric = (float)atof(argv[2]);
char *device_name = argv[3];
printf(“Connecting to %s: sFric, dFric= %f %f\n”,device_name, sFric,dFric);

/* initialize the tracker */
tracker = new vrpn_Tracker_Remote(device_name);
tracker->register_change_handler(NULL, handle_tracker_change);

/* The main loop of the program, each VRPN object must be called in order to process data */
while (running)
{
tracker->mainloop();
}

return 0;
}

The portion of code which is showing all the 24 sensors are ->

if ((lr.pos[0] – t.pos[0])*(lr.pos[0] – t.pos[0]) +
(lr.pos[1] – t.pos[1])*(lr.pos[1] – t.pos[1]) +
(lr.pos[2] – t.pos[2])*(lr.pos[2] – t.pos[2]) > dist_interval_sq){
printf(“Sensor %d is now at (%g,%g,%g)\n”,
t.sensor , t.pos[0], t.pos[1], t.pos[2]);
lr = t;
}

Kindly help me how to get the position of sensor for a particular sensor like sensor 2 or sensor 3