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-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
  #2  
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 09:19 AM.


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