![]() |
|
#1
|
|||
|
|||
After reading the most recent reply I don't think that cleared up what I was trying to ask.
I know that in Vizard there is already code set up parse the vrpn data into a certain format. What I'm wanting to do is use this type of parsing in another python library other than Vizard. Is it possible to import the vrpn parsing from Vizard into another modeling package, i.e. Panda3d? Thanks, Todd |
#2
|
|||
|
|||
Hi,
Vizards sensor plugins are NOT generic python plugins. Vizard uses its own plugin architecture for accessing data from devices. What you could do is have a Vizard program running as a server and forwarding the data over a socket to your other program. But to be honest, if you are going to go through the trouble of doing this then you might as well just create a python plugin for accessing VRPN data. It would probably take just as much work. |
#3
|
|||
|
|||
Do you have any recommendations on reading to get this done? I'm trying to read through the VRPN documentation but am very unfamiliar with C++.
Am I approaching things correctly if I wanted to get the data sent from the PPT into another program that I would have to code up a plugin for python in C++ and then use that in the desired python modules? There is no way to get this data straight off the socket short of performing these reads through the VRPN 6.0.6 in another program or using the Vizard program? Thanks, Todd |
#4
|
|||
|
|||
Hi,
Have you downloaded the VRPN source code? It contains a few examples of connecting to a device and retrieving data from it. Here is a rough outline of what the code should look like: Code:
void handle_pos(void *userdata, const vrpn_TRACKERCB t) { printf("Marker %d: %.2lf, %.2lf, %.2lf\n",t.sensor,t.pos[0],t.pos[1],t.pos[2]); } //Create tracker object vrpn_Tracker_Remote *tracker = new vrpn_Tracker_Remote("PPT0@YourMachineName"); //Setup callback for when new position data comes in tracker->register_change_handler(NULL, handle_pos); //Need to call this every frame to receive data tracker->mainloop(); //Cleanup tracker when exiting delete tracker; |
![]() |
Thread Tools | |
Display Modes | Rate This Thread |
|
|