Rigid Body ID as VRPN Sensor ID?

NatNet, VRPN, TrackD, and Plugins
Post Reply
BernhardSp
Posts: 10
Joined: Mon Apr 07, 2008 8:11 am

Rigid Body ID as VRPN Sensor ID?

Post by BernhardSp »

Hi,

If I define 2 rigid bodies with the same name and different ids is it possible to be pass these on to the vrpn client?
This would come very handy because the vrpn_TRACKERCB structure contains a member called "sensor" which I guess should contain the number of the sensor of which the data is sent from.
Data from the rigid body toolkit however always has sensor number 0.
Is it possible to configure the rigid body toolkit to send the id information over VRPN? If not would it be possible for you to add that information?

Many thank,
Bernhard
beckdo
Posts: 520
Joined: Tue Jan 02, 2007 2:02 pm

Re: Rigid Body ID as VRPN Sensor ID?

Post by beckdo »

Hi Bernhard,

Rigid Bodies are identified by their name over VRPN. I will take a look and see where the ID is in the sensor structure.

D
philipw
Posts: 4
Joined: Mon Jun 21, 2010 5:25 pm

Re: Rigid Body ID as VRPN Sensor ID?

Post by philipw »

I would also be interested in knowing how to register a single change handler for multiple trackers and getting the name or ID of it. Also, is there good API documentation for VRPN anywhere? The VRPN website isn't too helpful. Thanks.
beckdo
Posts: 520
Joined: Tue Jan 02, 2007 2:02 pm

Re: Rigid Body ID as VRPN Sensor ID?

Post by beckdo »

I believe when you register the callback handler, the first parameter in register_change_handler is 'user data'. So you can use that parameter to pass any information or reference specific to that rigid body. When the callback triggers it gives that user data back to you so you can do what you need to do with it.

This user data could be as simple as an index of what rigid body. So you could register the same callback for multiple rigid bodies and pass '1', '2', '3', etc... for the user data, and then this way you would know which callbacks were for which rigid bodies. If you needed more than a single user data value, you could pass a pointer to a more complicated structure as your 'user data' and store multiple parameters.

The VRPN site has plenty to get you going. Another good resource is the mailing list. Once on the mailing list you can ask the active VRPN community of which I am a member.
Post Reply