WorldViz User Forum  

Go Back   WorldViz User Forum > Precision Position Tracker (PPT)

Reply
 
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
  #1  
Old 02-08-2006, 08:44 AM
MiamiTodd MiamiTodd is offline
Member
 
Join Date: Feb 2006
Posts: 15
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
Reply With Quote
  #2  
Old 02-08-2006, 11:57 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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.
Reply With Quote
  #3  
Old 02-14-2006, 10:00 AM
MiamiTodd MiamiTodd is offline
Member
 
Join Date: Feb 2006
Posts: 15
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
Reply With Quote
  #4  
Old 02-14-2006, 10:39 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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;
The only way to get data from the PPT is either through VRPN or from the serial port using our own API. Our API is on our PPT download page.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 06:24 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC