Dive Immersive Guide
Overview & Default Scripts | Immersive |
Configuration Guide |
Source Code
Dive3.3x supports several new hardware configurations, the VR4
helmet, fastrak and CrystalEyes glasses. This has (hopefully) been
done in such a way that other devices are easy to support (a Sony
Glasstron helmet has been used and also logitech trackers are
support).
Essentially you still run vishnu, but with a configuration file
that supports a HMD video format, and with the relevant tracker
files.
This discussion concerns the immserive support for Dive
3.3x. Previous supported versions include 3.0.13 and 3.1 and
3.2. Only the latter is documented
.
Default Scripts
To use the immersive configuration an example helper script dive_hmd/ has been
provided. This is installed in
/cs/research/vr/starship/common/irix/bin.
There are several parts to this scripts, and they are
meant as examples for users to copy and edit for their own
purposes. The stages are:
+
- Check that the DIVEPATH variable is set. If not then set it to the default.
- Extend the DIVEPATH with the directories where UCL data customisations are stored (/cs/research/vr/starship/common/vr/dive/local3.3/data).
- Start the fastrakserver and buttonserver processes (see below).
- Switch the video to stereo or hmd output
- Run the application
- Switch the video to normal
From within the immersive system, the application can be quit by
pressing all the buttons on the 3D mouse simultaneously.
Display
The video side of the hmd support is very
simple, since the process need only render into two viewports that
correspond to the position where the video format combiner has
determined the HMD input will be taken from. We do in fact use the
same video format combinations as the dvs support
(dvs_vr4.cmb/dvs_vrs_mono.cmb). See the default scripts above for
example of how to switch the video.
Tracking
Two new processes are introduced, fastrakserver and
buttonserver. These run indpendently of the dive process
(hmd/diva), and do the actual reading of the physical device
involved. The dive process makes a socket connection to both of
these processes and registers interest in receiving events when
new data is read. This is done so that in theory more than one
dive process can read the device at a time, and also so that a
single dive process can read more than one of a particular device.
fastrakserver
fastrakserver reads the fastrak box and does the coordinate
conversion to virtual world space. The current version requires a
configuration file to specify the rotation and scale parameters
for this conversion.
Parameter list:
- -s int serial port number ( 0 = /dev/ttyd1 etc.)
- -b int baud rate (e.g. 19200, 38400)
- -n int number of trackers enabled on fastrak box (2 by default, 4 maximum).
- -p int port number to report data on (1960 by default)
- -c file absolute reference to configuration file
The configuration file has the following format:
line 1: %s\n
fastrakserver version check line current versions are:
%s =
line 2: %s\n
Indication of whether matrices should be reported
row major or column major. String match either
%s =
line 3-5: %f %f %f\n %f %f %f\n%f %f %f\n
Pre-rotation matrix for sensor 0
line 7-9: %f %f %f\n %f %f %f\n%f %f %f\n
Pre-rotation matrix for sensor 1
line 11-13: %f %f %f\n %f %f %f\n%f %f %f\n
Pre-5otation matrix for sensor 2
line 15-17: %f %f %f\n %f %f %f\n%f %f %f\n
Pre-rotation matrix for sensor 3
line 19-21: %f %f %f\n %f %f %f\n%f %f %f\n
Transformation from tracker coordinate system to world
coordinate system
line 23: %f %f %f\n
Units scale mapping tracker to world
line 23: %f %f %f\n
Position offset from tracker to world
There are several configuration files provided. These allow for
different devices to be used for the hand tracked device. Examples:
- dive-vtx-rhand-head.conf - normal 2 tracker configuration: VR4 helmet and Divison 3D mouse in right hand.
- dive-vtx-rhand-head-lhand.conf - 3 tracker configuration: VR4, and both hands
- dive-vtx-rhand-head-torso.conf - 3 tracker configuration: VR4, right hand and torso.
Note, that if the fastrakserver is reconfigured to support more or
fewer trackers, the dive_configure file will have to be be changed
also, so that dive knows which limbs are being tracked, and how many
devices to ask for.
buttonserver
Reads the 8-bit serial device.
Parameter list:
- -s int serial port number ( 0 = /dev/ttyd1 etc.)
- -b int baud rate (e.g. 19200, 38400)
- -p int port number to report data on (1960 by default)
In order to test the fastrak or button servers, there are two programs in
/cs/research/vr/starship/common/vr/dive/local3.2/appl
fastrakclient and buttonclient, that implement the
client interfaces that dive uses to poll the respective servers.
Misc.
If problems do occur, they are more than likely to do with
conflicts for the device (more than one server trying to read the
same device) or the device itself is not responding (use readfastrak or readbutton to test this).
fastrakserver and buttonserver can of course be replaced by any
other process that can report equivalent data. For example,
xstealbuttonserver is a replacement for buttonserver that steals
all X mouse click events and sends them to dive. This is useful
when very rapid response to button presses is required.
Interaction
Vehicle Operation
The fastrak vehicle operates a number of interaction metaphors. It
supports the virtual treadmill metaphor, and various options for the
navigation and picking metaphors.
Miscellaneous
The only restriction is that in hmd stereo mode, you are not allowed
to change the viewpoint (i.e. the viewpoint variable is ignored), and
this option is disabled on the menus. This is because the left and
right eye objects in the body are used to determine the parameters of
the stereo display, and shouldn't be moved relative to the body.
diva_hmd process more than the usual parameters found in a
dive_configure file. Each process runs a different configure file:
Configure Files Options
Using simple_configure as an example, the extra options are:
display_type mono
fastrak_host genesis
fastrak_socket 1960
fastrak_freq 20
fastrak_tags RIGHTHAND HEAD
button_host genesis
button_socket 1962
button_freq 20
button_tags RIGHT_BUTTON MIDDLE_BUTTON LEFT_BUTTON TOP_BUTTON BOTTOM_BUTTON
stereo_win 0 52 640 972 0 486 640 486 0 0 640 486
move_dir look
move_mode planar
fastrak_on 1
vtm_init_on 0
vtm_record_on 0
torso_rotation 0
visor_depth 1.8
By option the parameters are:
- display_type - the type of display that ucldiva will
enable. hmd = hmd stereo. mono = "normal" vishnu, i.e. single
window. "stereo" = full screen stereo shutter glasses.
- fastrak_host - the name of the machine where the fastrak server is running.
- fastrak_socket - the port number of the fastrak server
- fastrak_freq - the expected frequency of reporting (not used).
- fastrak_tags - a list of "realistic" names for tags. This
maps the device number onto logical body element. I.E. in
simple_configure, received 0 is the right hand, 1 is the head. Valid
tags recognised by the dive process are (XXXXXX). Useful if the
fastrak devices have to be re-arranged,
- button_host - host where the button server is running.
- button_socket - port where the button server can be found.
- button_freq - expected frequency of reporting (not used).
- button_tags - logical names for buttons on the button
device, in order of reporting. Again, the buttons have an order, and
this option maps the button number on to logical button type. Again, useful, if the device is reqired.
- stereo_win - configuration for stereo rendering. This
defines the viewports where the hmd process will render the left and
right views. The 12 floats correspond to top-left of rendering window,
width and height of rendering window, top-left of viewport of left-eye
view within the window, width and height of viewport of left-eye view,
top-left of viewport of right-eye view within the window, width and
height of right-eye view.
- move_dir - fastrak vehicle defines several basic
interaction metaphors. This option determines the direction of
movement. THe options are point/look/aim.
- move_mode - move_dir is one of flying/planar/superman, and
this defines whether motion is in free direction, constrained to the
plane, or toggled by a joystick button.
- fastrak_on - sets whether the fastrak vehicle is on by
default upon initialisation.
- vtm_init_on - sets whether the VTM is on by default.
- vtm_record_on - sets whether the VTM data recording is on
by default.
- torso_rotation - used by the fastrak vehicle when the
torso is being tracked. Specifies whether we constrain the torso
rotation to the horizontal plane or not. This is useful since placing
the torso tracker accurately is very hard. (1 = free position of torso; 0 = "fake" rotation)
- visor_depth - gives an explicit depth for the visor when
using stereo shutter glasses. This is necessary since the default
visor depth is far too close. This can be disabled by specifying
visor_depth <= 0. Note that elements on the visor appear to be the
same size whatever the visor depth.
Also the following options are changed by default:
- vehicle_speed - walking speed is quite slow
- motion_* - no reduction is visual quality when moving
Again these are example scripts, and users should consider creating
their own to support their preferred options.