Q: Do you support Polhemus devices?

I would like to use a Polhemus device (Fastrak). Is there support for it?

A: There is a Fastrak driver available on IRIX for VR Juggler 1.0. The Fastrak driver in VR Juggler 2.0 Alpha 2 and beyond works on a variety of platforms.

We do not have direct access to Polhemus devices. As such we are not able to write or debug one. We have had a driver submitted for Fastrak, but it only works on IRIX with VR Juggler 1.0. We have not been able to test it ourselves.

The driver has been ported to compile in the new Gadgeteer framework, and it has been tested and improved. Within Gadgeteer, the Fastrak driver makes use of the VPR abstractions for threads and serial ports so that it compiles on all supported platforms including Windows.

A: VR Juggler 2.0 alpha and VRPN

Yes, it is possible to use Polhemus devices with VR Juggler 2.0 alpha.

Here are some instructions for setting up VRPN with VR Juggler under Unix.

Firstly, download the VRPN sources from:

ftp://ftp.cs.unc.edu/pub/packages/GRIP/vrpn

Unzip and compile, following the instructions in vrpn/README.Compiling:

		  Go to quat (cd quat)
					 For Unix: make -f Makefile.remote.[yourarch]
					 For Cygwin: make -f makefile
		  Go to vrpn (cd ../vrpn)
					 Edit Makefile to uncomment your architecture
					 gmake
		  Go to client_src
					 Edit Makefile to uncomment your architecture
					 gmake
		  Go to server_src
					 Edit Makefile to uncomment your architecture
					 gmake

Then copy vrpn/server_src/[yourarch]/vrpn_server, vrpn/server_src/vrpn.cfg, and vrpn/client_src/[yourarch]/vrpn_print_devices to a convenient directory (i.e. ~/vr/vrpn/). [yourarch] is the architecture you selected in the Makefile (i.e. pc_linux).

Edit ~/vr/vrpn/vrpn.cfg to reflect your configuration (example configs are commented in this file). For example, a Fastrak master/slave system with the master connected to /dev/ttyS0 and the slave connected to /dev/ttyS1 communicating at 115200 would have the two lines:

vrpn_Tracker_Fastrak	 Tracker0	/dev/ttyS0		115200
vrpn_Tracker_Fastrak	 Tracker1	 /dev/ttyS1		 115200

A Flock of Birds system with 4 sensors connected to a single serial port would have the line:

vrpn_Tracker_Flock	  Tracker0		  4		 /dev/ttyS0		115200

Run the following command to start the server (or create a script file with this): =~/vr/vrpn/vrpn_server -millisleep 1=

You should end up with the output:

Reset Completed (this is good)

If not, check the error messages and make sure the right serial port is specified, and that the serial port has the correct permissions.

From another command prompt you can then print values from the tracker via the command (CTRL-C to quit):

~/vr/vrpn/vrpn_print_devices -nobutton -noanalog -nodial -notext Tracker0@localhost

The following assumes that the VRPN server and client are on the same machine. This doesn't have to be the case, and if the VRPN server is on a different machine than VR Juggler, then instead of Tracker0@localhost use Tracker0@vrpn_server_hostname

The next thing that needs to be configured is VR Juggler. An example configuration file Follows. (Vrjconfig in VR Juggler 2.0 alpha 1 seems not to like this configuration file, and hence use a text editor to modify it.):

<?xml version="1.0" encoding="UTF-8"?>
<ConfigChunkDB>
  <InputManager name="Input Manager">
	 <driver>${VJ_BASE_DIR}/lib/gadgeteer/drivers/VRPN_drv.so</driver>
  </InputManager>
  <proxyAlias name="VJHead">
	 <aliasName>VJHead</aliasName>
	 <proxyPtr>Head Proxy</proxyPtr>
  </proxyAlias>
  <proxyAlias name="VJWand">
	 <aliasName>VJWand</aliasName>
	 <proxyPtr>Wand Proxy</proxyPtr>
  </proxyAlias>
  <PosProxy name="Head Proxy">
	 <device>Tracker0</device>
	 <unit>1</unit>
	 <position_filters>
		<PosXformFilter name="Position Filter">
		  <pre_translate>0.0</pre_translate>
		  <pre_translate>0.0</pre_translate>
		  <pre_translate>0.0</pre_translate>
		  <pre_rotation>0.0</pre_rotation>
		  <pre_rotation>0.0</pre_rotation>
		  <pre_rotation>0.0</pre_rotation>
		  <custom_scale>1.0</custom_scale>
		  <dev_units>1.0</dev_units>
		  <post_translate>0.0</post_translate>
		  <post_translate>0.0</post_translate>
		  <post_translate>0.0</post_translate>
		  <post_rotation>-90.0</post_rotation>
		  <post_rotation>-90.0</post_rotation>
		  <post_rotation>0.0</post_rotation>
		</PosXformFilter>
	 </position_filters>
  </PosProxy>
  <PosProxy name="Wand Proxy">
	 <device>Tracker0</device>
	 <unit>0</unit>
  </PosProxy>
  <Vrpn name="VrpnMaster">
	 <trackerServer>Tracker0@localhost</trackerServer>
	 <buttonServer>Button0@localhost</buttonServer>
	 <numTrackers>4</numTrackers>
	 <numButtons>0</numButtons>
	 <etrans>1</etrans>
	 <pretranslate>0</pretranslate>
	 <pretranslate>1</pretranslate>
	 <pretranslate>1</pretranslate>
	 <prerotate>90.0</prerotate>
	 <prerotate>0.0</prerotate>
	 <prerotate>90.0</prerotate>
	 <prescale>1</prescale>
	 <prescale>1</prescale>
	 <prescale>1</prescale>
	 <postscale>1</postscale>
	 <postscale>1</postscale>
	 <postscale>1</postscale>
  </Vrpn>
</ConfigChunkDB>

This sets the first unit on the tracker as the wand and the second unit on the HMD. The rotations in the above setup file are appropriate for the Fastrak system:

http://www.westco.co.nz/daniel/vrj/coordsystems.jpg

Add vrpn.config to the config files that you load when running VR Juggler applications. This should be all that is required to run VR Juggler with VRPN… YMMV.

Back to: LiveFaq