Aller au contenu

VRPN

Source Wikipedia : VRPN (Virtual-Reality Peripheral Network) is an open source library providing a transparent interface between a virtual reality application running on a machine, and physical devices (trackers, wand, haptic device) connected to other machines on a network.

Use in VRmaze

In VRmaze, the VRPN is a behavioral scripting component. A VRPN component is designed to receive data from a VRPN server on the network. We consider two types of data from a VRPN server:

  • Tracking data
  • Interaction data

In VRmaze Sim, VRPN data is processed directly by scripts that handle the reception of the data and its consequences on the 3D environment.

Tracking

Image title 2

The VRPN Tracker behavior script.

In VRPN it is possible to obtain the value of a tracker, that is, the position and orientation of a physical object expressed in the tracking repository. In VRMaze, it is possible to acquire the tracking data and assign it as position and orientation to a virtual object, so that the virtual object (possibly a rendering camera) has its position and orientation affected by the tracker. To do this, we use the VRPN Tracker behavior script.

This script allows to select the properties affected by the tracker and requires of course to fill in the name and address of the tracker. It also requires the information of the type of coordinates and the channel of the tracker.

Type of coordinates

The coordinate type can take two forms: the current datum, identical to the one used by Unity, with the Y axis up. The Vicon coordinate type uses an axis system in which the Z axis is up. Select the coordinate type based on your tracking system.

Tracker Channel

It is possible for the VRPN server to send multiple tracking information to the same address. To choose the right dataset VRmaze offers the possibility to choose the tracking channel.

Tracker name and address

The tracker name and address in VRmaze correspond to the name and address found in the VRPN documentation in the form trackername@trackeraddress

Coordinate Repository

VRmaze will assign the tracking data in the local repository of the virtual object.

Device

Image title 2

The VRPN Joystick Data behavior script.

VRPN manages not only the tracking data, but also the peripherals (having buttons and other joysticks). VRmaze Sim allows the integration and use of such peripherals in the form of a behavioral script retrieving all interaction data. This data is used natively by VRmaze Sim to, for example, manage interactions with tool panels or the movement of the subject in the virtual space.

Tracking a joystick

The behavior script does not perform position tracking, so in the case of a joystick tracked in space, a tracking script must be added.

Position control in virtual space

Image title 2

The Root Node Controler behavior script.

The willingness to move a subject in virtual space actually lies in moving the Cave Root Node in virtual space. VRmaze Sim provides a behavior script that allows the Cave Root Node to be moved in space in correspondence with the information gathered by the VRPN Joystick Data script.

This script allows to configure the speed of movement and orientation and has a fast movement system when the subject uses the button integrated in the device joystick. It is also possible to perform a movement in the form of an impulse whose force properties can be modified.

Interaction with 2D and 3D elements

Image title 2

The `Cave UI input event controller` declarative script.

By default, interaction in 3D space is handled by the VRPN Joystick Event Manager present by default on the camera system. This system does not provide interaction with 2D elements.

Following a declarative mode, adding a Cave UI input event controller behavior will allow to use the VRPN joystick pointing and interaction system on 2D elements. The declarative script uses tracking data and joystick button state information to operate, so it requires a VRPN Tracker script and a VRPN Joystick Data script at the same level in the protocol hierarchy structure.

Interaction Button

The Cave UI input event controller declarative script is used to configure the VRPN button that will serve as the action button for GUI management.

Behavior graphs

Behavior graphs offers some nodes allowing access to data from a VRPN server on the network or on the local machine.

Image title 2

The VRPN acquisition nodes.

VRPN acquisition nodes have common parameters:

  • Server address (machine name or IPv4 address)
  • Name of the tracked object (string)
  • Communication channel (integer)

VRPN nodes

The VRPN nodes included in the behavior graphs are totally independent from the VRPN related scripts. It is not necessary to refer to a VRPN tracker script to use the VRPN Tracker node, which has direct access to the VRPN communication system.

Multiple VRPN servers?

It is quite possible to use multiple VRPN servers within the same graph. Each VRPN node is independent of the others and will have its own connection behavior.

VRPN Analog

In addition to the parameters common to VRPN nodes, the VRPN Analog node requires the entry of a second communication channel. Indeed, this node proposes a vector 2 in output allowing to manage the joysticks having two axes.

Coordinate system

The VRPN Tracker node has an additional parameter to choose the coordinate system.

Scale factor

It is possible to convert a unit system from a VRPN server to the metric system used in VRMaze. To do this, the VRPN Tracker node has a scale factor property, defaulting to 1, which allows you to take the position coordinate and multiply it by a coefficient.