VRPN streaming multiple trackables
Posted: Fri Aug 19, 2011 9:57 am
Hi everyone,
I'm using the VRPN to read data from a Optitrack system, of course, using the tracking tools application. I can read data from one trackable, as shown in the example provided by NatNet (http://www.naturalpoint.com/optitrack/d ... tools.html).
My question is related to that I need to read data from more than one trackable (two, three, or more rigid bodies defined in the Tracking Tools). So, of course, the simplest way to achieve this is hardcode the same pieces of code (a callback function mainly). But this is not portable and "shareable"...I have this problem, because I want to use a class containing all the VRPN stuff, so the user only would need to define the number of trackables, and the class should do all the stuff...but the problem here is that I can not do this because I have to hardcode the callback function. My idea would be to have an array of instance of the mentioned class, but the other issue here is that the callback is a global function, so it is the same function for all the instances of the class.
Any ideas ?? Do you know if it is solved by anyone else ?
Thanks
Leonel
I'm using the VRPN to read data from a Optitrack system, of course, using the tracking tools application. I can read data from one trackable, as shown in the example provided by NatNet (http://www.naturalpoint.com/optitrack/d ... tools.html).
My question is related to that I need to read data from more than one trackable (two, three, or more rigid bodies defined in the Tracking Tools). So, of course, the simplest way to achieve this is hardcode the same pieces of code (a callback function mainly). But this is not portable and "shareable"...I have this problem, because I want to use a class containing all the VRPN stuff, so the user only would need to define the number of trackables, and the class should do all the stuff...but the problem here is that I can not do this because I have to hardcode the callback function. My idea would be to have an array of instance of the mentioned class, but the other issue here is that the callback is a global function, so it is the same function for all the instances of the class.
Any ideas ?? Do you know if it is solved by anyone else ?
Thanks
Leonel