Configuring devices

Adding a device

To add a device to your VR system description, simply go to the Devices tab, and click the '+' button to dispay the Add Device window :

MiddleVR supports the following devices :

Keyboard, mouse, joysticks

Keyboard, mouse and all available joysticks are automatically added by the DirectInput driver when MiddleVR is initialized :

VRPN Tracker

VRPN is an open-source project that handles lots of different VR devices. VRPN requires that you configure a server with the devices that you want to use. Read more about VRPN on our knowledge base.

MiddleVR can handle VRPN trackers, axis and buttons. This section describes the configuration of trackers. For axis and buttons, see below.

Once the VRPN server is up and running, you must specify in MiddleVR the address and optionally the port of this server, the number of trackers that you want to use, and optionally modify the way axis are applied.

Table 5.1. VRPN Tracker options

AddressAddress of the VRPN server, plus the name of a particular device on this server. Examples : Tracker0@localhost, Tracker1@192.168.1.99, Kinect@LabPC.Moulinsart.fr. You can also specify the port of the server : Tracker0@localhost:3884, Tracker1@192.168.1.99:3886. The default VRPN port is 3883.
IndexA device, such as a Polhemus 3D tracker, can send data of multiple 3D trackers through one device. For example Tracker0@localhost can represent 10 different trackers, also named channels. Index specifies the starting index of the device.
Number of trackersAfter specifying the starting index, you can also specify the number of trackers (devices) to use. For example, an index of 0 and a Number of trackers of 3 will result in the usage of channels 0,1,2. A starting index of 4 and a 2 trackers will result in the usage of trackers 3 and 4.
NameName prefix for each tracker.
Right/Front/UpAxis calibration. See "VRPN Axis Calibration" below.
ScaleA factor to be applied on each tracker value. This value must be not null and positive. One can find it useful to adapt VRPN values with the dimensions of the current virtual world.
Wait for dataShould the driver wait until a new data arrives ? This can be useful in case your tracker sends updates at the same refresh rate as your display. It means that for each frame you know you'll have a new update, and not miss an update.

Once the VRPN trackers are added, you will immediately be able to see if the data are streamed correctly :

If the VRPN server is not reachable, you will probably see the following error in the log window :

For more information about troubleshooting VRPN, see Troubleshooting VRPN on the knowledge base.

VRPN Trackers axis calibration

The representation of 3D information in space is not normalized. Sometimes moving a tracker from the user to the screen can be seen as an increase of value on the Z axis, sometimes as a decrease of value on the Y axis. This is dependant on the way the device reports its data and how the driver that interprets this data exposes it to VRPN.

One easy way to configure the axis of a VRPN device is first to add it without modifying the existing Right/Front/Up definition. Then go to the 3D nodes tab, assign the device to any node, for example the HandNode.

Now try to move the 3D tracker to the right, to the front (going away from the user towards the screen), and upwards. If the 3D node moves correctly, you're lucky, your calibration is done.

If this is not the case, you will have to write down some information :

- start by moving the 3d tracker to the right. By looking at the 3D node X,Y,Z, find out which one of these axis is moving by the largest amount. Most of the time when you're moving to the right, it's the X axis that is moving the most. Please also note if, when moving to the right, the axis is increasing or decreasing. For example, if the X axis is increasing, write down: Right : +X. If it's decreasing, write: Right : -X.

- repeat this step for front (away from the user, towards the screen) and up.

You will end up with something like :

- Right: +X

- Front: +Z

- Up: -Y

Now remove the existing VRPN tracker and recreate it by specifying the axis calibration.

Kinect trackers (Microsoft SDK)

MiddleVR will create 3D trackers based on the skeleton of the user.

Note: Starting with MiddleVR 1.2, the Kinect orientations are also applied. To disable the rotations check the 3D nodes options.

You can find a ready-to-use configuration file that will automatically assign all the trackers to the corresponding 3D nodes. This configuration file is located here: data/Config/Kinect.vrx.

Tracker Simulator - Gamepad

MiddleVR is able to simulate a 3D tracker with an official Microsoft XBOX 360 gamepad. This is useful if you don't have a real 3D tracker available, or simple if you want to navigate with a Gamepad.

For the moment only an official XBOX 360 gamepad will work.

Tracker Simulator - Mouse

MiddleVR can simulate a 3D tracker with a three button mouse.

- Press middle mouse button to move forward/backward and rotate (yaw).

- Pressing the Alt key will translate left/right, up/down.

- Pressing both left and right mouse button will reset the tracker.

Tracker Simulator - Keyboard

MiddleVR can simulate a 3D tracker with key presses.

- Press Ctrl + X/Y/Z to translate.

- Press Ctrl + Alt + Y/P/R to rotate.

- Adding the Shift key will reverse translations and rotations.

SpacePoint Fusion Tracker

The PNI SpacePoint Fusion tracker is a inertial tracker that will report an absolution orientation in space, but no position.

There is no configuration for this device.

Razer Hydra trackers

The Razer Hydra has two magnetic trackers as well as a joystick and several buttons on each trackers.

GameTrak Trackers

The GameTrak trackers are an old mechanical device that reports two absolution positions but no orientation. This device is mainly used by hobbyists and is difficult to find.

TrackIR Tracker

The NaturalPoint TrackIR tracker is an infrared tracker that will report orientation and position. It requires that you have the latest version of the TrackIR sofware running.

There is no configuration required for this device.

Motion Analysis (beta)

The Motion Analysis driver requires you to run Cortex on the local machine.

Triviso Colibri

The Trivisio Colibri is an inertial sensor. It only reports orientation. It doesn't require any configuration.

Leap Motion

The Leap Motion is an optical tracking system. This driver will report one hand (one palm and five fingers).

Oculus Rift

The best way to create a configuration for the Rift is to start from the Oculus Rift predefined configurations (HMD-Oculus-Rift.vrx and HMD-Oculus-Rift-Razer-Hydra.vrx) that contain all the Rift-specific parameters ready-to-use.

The Oculus Rift can be divided into two parts: the tracking system and the display system.

The tracking system is an inertial tracker that only reports orientation. A basic usage doesn't require any configuration, but if you want to activate the Magnetometer Drift Correction you need to first calibrate the magnetometer with the Oculus Configuration Utility tool. If a calibration is saved with the "Enable Mag Yaw Correction" option checked, then the drift correction will be activated in your simulation.

Note that adding the Oculus Rift tracker in the Device panel will only add the tracker and will not configure the cameras and viewport.

To handle the Rift display system, the "OculusRiftWarping" of the side-by-side viewport needs to be enabled. This option activates the lens deformation and chromatic aberration correction. It also forces the anti-aliasing on 2 to compensate the current low resolution and offer a good user experience.

Note: Again we really encourage you to use the predefined configurations and modify them to suit your needs.

Vuzix Tracker

The Vuzix tracker is an inertial tracker. It only reports orientation. It doesn't require any configuration.

Note that adding the Vuzix tracker only add the tracker and will not configure the cameras and viewport.

SpaceMouse

A SpaceMouse is a hardware device that lets a user translate and rotate objects in 3D. As the name suggests, it also provides buttons to trigger actions.

There is no configuration required for this device.

The SpaceMouse tracker is a tracker that can be translated and rotated in 3D by a SpaceMouse device. The configuration fields are described below.

Table 5.2. SpaceMouse tracker options

Tracker translation speedA factor to be applied on the translation that comes from the SpaceMouse. This factor depends on time, hence it is expressed as linear-movement unity per second. The SpaceMouse sends arbitrary quantities so it is impossible to talk about meter per second (m/s) for example. However, the SpaceMouse control panel can also be tweaked to increase or decrease the translations that the SpaceMouse sends to software including MiddleVR, see its settings.
Tracker rotation speedA factor to be applied on the rotation that comes from the SpaceMouse. This factor is similar to the translation speed but is expressed as an angular velocity, in degrees. The SpaceMouse control panel can also be tweaked to increase or decrease the angle values it sends to software including MiddleVR, see its settings.
Tracker movements in local space

When checked, tracker movements are expressed in the local space of the tracker.

Assuming a 3D space with X to right, Y pointing forward and Z to the top, let's now consider that it is checked and that you rotated the tracker around the X axis by 45 degrees. If you then move the tracker forward, it will go along the Y axis that was rotated by 45 degrees. Said differently, the tracker will "climb".

If we now consider that we are working in global space, then the Y axis remains flat (i.e. aligned with the global Y axis of the world). Said differently, you are moving the rotated tracker along the flat Y axis and you look towards the top. In addition, rotations are relative to the world axis but around the object pivot.


zSpace

A zSpace is a hardware device providing a 24" stereo display, passive stereo glasses and a stylus. Glasses and stylus are tracked by infrared cameras mounted on the screen in order to track their positions and rotations. The stylus is able also to vibrate and turn on its LED. It furnishes buttons and tapping events on its tip.

Several trackers are provided. They all work in the tracker space that is explained in the schema below for side and front views.

The available settings are presented below.

Table 5.3. zSpace options

Stylus LED colorThe color of the stylus LED, in RGB. Each color component can be set to 0 or 1 only. Any value in the opened range ]-1,1[ will be reinterpreted as 0. Above 1 or below -1, the value will be reinterpreted as 1. Note that the LED will not light if the color is black.
Stylus LED turned onAs the name suggest, check it to turn on the stylus LED. However you must set a LED color that is not black to see a result on the stylus.
Stylus default duration vibrationDefines the duration in seconds of the vibration of the stylus. This value is used by the setting "Fire vibration".
Stylus default duration between vibrationsDefines the duration in seconds between vibrations of the stylus. This value is used by the setting "Fire vibration".
Default number of vibrationsDefines the number of vibrations for the stylus. If 0 is given, the stylus will not vibrate. With -1, the stylus will not stop vibrations until the user ask for it explicitly. This value is used by the setting "Fire vibration".
Fire vibrationFire a vibration of the stylus. The values to be used are the values defined above with the name "default": about the vibration duration, the duration between two vibrations and the number of vibrations. Please note that this checkbox does not tell whether the stylus is vibrating but only indicates that the user fired the vibration system. However unchecking will stop the vibration immediately (if the stylus is vibrating).

VRPN Axis

VRPN Axis can represent joystick axis, sliders or other analog information.

Table 5.4. VRPN Buttons options

AddressAddress of the VRPN server, plus the name of a particular device on this server. Examples : Joystick@localhost, Mouse0@192.168.1.99, Sliders1@LabPC.Moulinsart.fr. You can also specify the port of the server : Joystick@localhost:3884, Mouse0@192.168.1.99:3886. The default VRPN port is 3883.
Number of axisNumber of axis on this device.
NameMiddleVR device name.

VRPN Buttons

VRPN Buttons represent a button with a value of true or false.

Table 5.5. VRPN Axis options

AddressAddress of the VRPN server, plus the name of a particular device on this server. Examples : Joystick@localhost, Mouse0@192.168.1.99, Sliders1@LabPC.Moulinsart.fr. You can also specify the port of the server : Joystick@localhost:3884, Mouse0@192.168.1.99:3886. The default VRPN port is 3883.
Number of buttonsNumber of buttons on this device.
NameMiddleVR device name.

Configuring the Wand

As mentionned previously, the Wand is composed of three parts :

- a 3D tracker,

- a two-axis joystick,

- a set of buttons.

You have to manually add and configure the three devices that will make up the wand. In the screenshot above, we have added a VRPN Tracker, VRPN Axis for the joystick axis, and VRPN Buttons for the buttons.

You can also use a simple joystick for the axis and buttons. You can also use mouse buttons.

You then have to specify in the Wand section, which axis and buttons devices you want to use, and the ordering of the axis and buttons.

You also have to assign the tracker to the HandNode.

Finally you have to configure the usage of the Wand in Unity.

Table 5.6. Wand options

Device for wand navigation (axis)The device that will be used to get the wand joystick axis values
Horizontal axis indexIndex of the horizontal axis of the joystick
Horizontal axis scaleScale factor that should be applied to the value of the horizontal axis
Horizontal axis valueDisplay value of the computed horizontal axis after scaling
Vertical axis indexIndex of the vertical axis of the joystick
Vertical axis scaleScale factor that should be applied to the value of the vertical axis
Vertical axis valueDisplay value of the computed vertical axis after scaling
Device for wand interaction (buttons)The device that will be used to get the wand buttons states
Button 0 indexIndex of the primary button
Button1 indexIndex of the secondary button
...