Using With Virtual Reality Applications

No matter what framework you use, before starting your application, you will need to start the tracker server and leave it running while you are using the VR application.

The server provides a VRPN7 tracker device, by default named “Tracker0@localhost” from the perspective of a VR application running on the same computer. If you’re using any virtual reality framework with support for VRPN (which is most of them), you can use this software to provide head tracking. Details for using selected VR systems follow.

VR Juggler

If you’re using VR Juggler 2.2.x, you can use the jconf files included with the Wii Remote Head Tracking server to run a full-screen head-tracked environment, in a “fishtank VR” mode where your monitor is virtually a one-meter-wide window into the virtual world.

Vizard

You will want to configure your view to be connected to a VRPN7 device (whatever you named it, by default “Tracker0@localhost”).

Please see the Vizard documentation for more information.

Some untested code that might help is below:

If you are using viztracker.py that has an _addTracker() function:

You will want to replace the contents of def _addTracker(): with these lines:

def _addTracker():
	__main__.PORT_VRPN = 'Tracker0@localhost'
	vrpn = viz.add('vrpn.dls')
	yield vrpn

then include this code in your application

import viztracker
track = viztracker.add()
viz.link(track, viz.MainView)

(See the help page used to create this code)

If you are using a newer version of Vizard that has a __createCustomComposite function in viztracker.py:

You’ll want to create a vizsetupcfg.py file on your desktop that contains the following:

def createCustomComposite(id=0):
	viz.logNotice('Setting up to use Wii Remote Head Tracking')

	vrpn = viz.add('vrpn7.dle')

	# Modify these two lines if needed
	head = vrpn.addTracker('Tracker0@localhost')
	wiimoteBaseHeight = 1.8 # Simulated height of the Wiimote, in meters

	# Set up Vizard for full screen mode, only on the first monitor or span
	viz.setOption ('viz.fullscreen', 1)
	viz.setOption ('viz.fullscreen.monitor', 1)

	headfinal = viz.addGroup()
	headlink = viz.link (head, headfinal, enabled=False)
	import vizact
	vizact.onupdate (viz.PRIORITY_PLUGINS+1, headlink.update)
	headlink.postTrans([0,wiimoteBaseHeight,0]) # Apply translation in Y axis

	comp = VU.VUCompositeTrackers()
	comp.storeTracker(comp.HEAD, headfinal)

	comp.createAvatarNone()
	comp.defineViewpoint()
	comp.finishTrackers()
	return comp

Others

If you have used this tracker with another system, we’d be interested in adding instructions to this page! Please contact us and we’ll see what we can do!