PPT and Intersense Alignment
A typical setup for PPT users is to connect an Intersense to the Vizard rendering machine for orientation data and combine that with position data streaming from the PPT machine. Having the Intersense connected to the Vizard rendering machine is recommended when the data is applied to the viewpoint, as it will give the lowest orientation latency possible. Using this setup, it is necessary to perform the alignment between Intersense's coordinate system and PPT's coordinate system in the Vizard script. This article describes several ways of doing this.
Note: If the Intersense is connected to the PPT machine refer to the PPT documentation for aligning PPT and Intersense in PPT Studio.
Aligning the coordinate systems after the user faces PPT North:
This kind of alignment is made by either sending a reset command to the sensor or by using one of the reset modes of Vizard's built-in link objects. Both require that the user face PPT North (+Z axis) before the reset command is called. The reset settings are not preserved across multiple runs, so you need to call the reset command every time your script runs.
Sending a reset command to the sensor:
If you are just correcting for an offset in yaw, which is typically the case, then the Intersense plugin provides a resetHeading function. Here the alignment is made when the 'r' key is pressed.
oriTracker = isense.addTracker()
vizact.onkeydown ('r', oriTracker.resetHeading)
Each of Vizard's sensor plug-ins have a reset command that will reset all data values. In the case of the Intersense, that includes yaw, pitch and roll values. Use this if there is also some pitch or roll that needs to be corrected for (e.g. the device is mounted with a pitch offset on a hmd).
Using the reset command on a link:
A benefit of using the reset command on the link is that it is independent of the actual hardware. The following resets the orientation so that the current heading is virtual north. The pitch, and roll will not be affected.
#Orientation data from Intersense
headTracker = viz.mergeLinkable(posTracker,oriTracker)
#Link viz.MainView with headTracker
headlink = viz.link(headTracker, viz.MainView)
vizact.onkeydown('r',link.reset,viz.RESET_ORI_HEADING)
To reset the roll and pitch as well use the viz.RESET_ORI_LOCAL flag instead.
Hard coding the offset between Intersense and PPT
By hard coding the offset value for the Intersense you do not have to face PPT North and call one of the reset commands every time you run a script. Since the heading is based on the internal compass, the offset will need to be computed for each physical location the script is executed from. If the PPT system is recalibrated and the orientation of the workspace is changed the offset will need to be re-computed.
To use this technique, connect to the Intersense without resetting it and place it in the desired zeroed heading position. Make sure the Intersense is stationary and there is no interference. Now grab the yaw value from the stationary Intersense tracker with:
The following code creates a tracker using PPT and Intersense data and links the viewpoint to this tracker. A postEuler operator is then used on the link to zero the heading based on the yaw value retrieved.
#set eyeheight to 0 so that default eyeheight is not added
#to y position of the tracker
viz.eyeheight(0)
#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)
# Apply yaw offset to link to reach desired zero heading
headlink.postEuler([-ZERO_YAW,0,0],target=viz.LINK_ORI_OP)
The method above can also be applied to pitch and roll offsets if necessary. Just negate their offset values along with the yaw in the postEuler method.

