Vizard 7 » Reference » Input Devices » Position and Orientation Trackers » WorldViz PPT/VRPN
7.6

WorldViz PPT/VRPN

VRPN is the recommended way for connecting to PPT data within Vizard.  It is designed to support more markers and faster updates (such as that available with a PPT-H system) than the serial protocol.  

Initialization

Within PPT studio, to send data over VRPN, just add the VRPN7 output plug-in and press "Talk".  

Example

The following code will add the VRPN plug-in and connect to a marker in Vizard.

vrpn = viz.add('vrpn7.dle')
tracker = vrpn.addTracker('PPT0@hostname',0)

The first argument in the <vrpn>.addTracker method refers to the PPT machine.  This always begins with "PPT0@" followed by the host name or IP address.  The second argument in the vrpn.addTracker method indicates the sensor number.  Here, sensors are counted from 0 so the line above connects to marker 1 as named in PPT Studio.

 

The following will connect to markers 4 and 5 as named in PPT Studio.

vrpn = viz.add('vrpn7.dle')
tracker = vrpn.addTracker('PPT0@hostname',3)
tracker2 = vrpn.addTracker('PPT0@hostname',4)

The following uses the link command to link the viewpoint with the tracker.

view = viz.MainView
viz.link(tracker, view)

Using Intersense orientation data with PPT positional data

For many PPT users a combination of PPT for position and Intersense for orientation is used to aquire 6DOF data.  There are two standard setups for doing this.

 

1.  Connect the Intersense to the PPT machine, add the Intersense post-process plug-in PPT and stream 6DOF data into Vizard over VRPN.

 

2.  Connect the Intersense to the Vizard rendering machine, send PPT position data over VRPN and get Intersense orientation data using Vizard's Intersense plug-in.

Stream 6DOF data from PPT into Vizard using the Intersense post-process plug-in

The example code above applies whether you are streaming position or 6DOF data from PPT into Vizard.  If your marker in PPT has orientation data associated with it then that will be available to the tracker object you add in Vizard.  To align the Intersense with PPT use the reset function built into the Intersense plug-in in PPT Studio.

Send PPT position data over VRPN and use orientation data from an Intersense connected to the Vizard rendering machine.

The following example code shows how to merge position data from PPT and orientation data from Intersense into a single tracking object and then link this to the viewpoint.  Aligning the Intersense with PPT is done on a keypress after the user faces PPT north.

#Connect to PPT over VRPN
vrpn = viz.add('vrpn7.dle')
posTracker = vrpn.addTracker('PPT0@hostname')

#Connect to Intersense on local machine running Vizard
isense = viz.add('intersense.dle')
oriTracker = isense.addTracker()

#Create a 6DOF tracker by merging position data from PPT with
#Orientation data from Intersense
headTracker = viz.mergeLinkable(posTracker,oriTracker)

#Link viz.MainView with headTracker
headlink = viz.link(headTracker, viz.MainView)

#Once the user is facing PPT north pressing the 'r' key will align
#Intersense's coordinate system with PPT's coordinate system
vizact.onkeydown ('r', oriTracker.reset)