VRPN 06.04

VRPN main page

Obtaining VRPN

VRPN Support

Installing and Testing

Compiling and Modifying

Client code

Server code

Troubleshooting

Connections

Logging and Playback

Shared Objects

Sound

Clock Synchronization

Text Messages

Doxygen documentation

VRPN on PDAs

Coming attractions & suggestions

UNC-specific information

Magellans, Joysticks and Others

The Magellan and Spaceball are Analog and Button devices that report 6 analogs (three for translation and three for rortation) and several buttons. The UNC Joystick is an Analog and Button device; it reports 7 analog channels (values -1.0 <--> 1.0) to any vrpn_Analog_Remote connected, and 2 buttons to any vrpn_Button_Remote connected. The DirectX Joystick produces several analogs, some of which are for translation and rotation and others of which are for valuators. The Radamec SPI is a camera-tracking device that produces analog values describing the pose, focus, and zoom of the camera.

Each of these devices produce raw vrpn_Analog values, which must be converted into vrpn_Tracker reports to be used to move objects or the viewpoint in the virtual world. A wrapper class called vrpn_AnalogFly has been designed to perform this function (see below).

Note that you can connect to the device (Magellan or other) as both a vrpn_Button device and as a vrpn_Tracker device; enabling you to read both the buttons and tracker reports. If the device has analogs that are not used for tracking, you can also connect to it as a vrpn_Analog and read these.

vrpn_AnalogFly

The vrpn_AnalogFly object is both a client and a server object; it is a client for one or more vrpn_Analog devices and it is a server that emits vrpn_Tracker reports. It can optionally also connect to a vrpn_Button (which is used to reset the transformation to the identity).

There are two modes of vrpn_AnalogFly devices, one of which is an absolute tracker (analog values correspond directly to position and orientation) and the other of which is a differential tracker (which is velocity-controlled and will continue to fly in a certain direction so long as the value is nonzero). The Radamec SPI is an absolute tracking device, while most others are differential devices.

One analog channel is associated with each axis (X, Y, Z) and rotation about each axis (RX, RY, RZ). For each axis, the value is converted to a position (meters) or speed (meters/second) for absolute trackers; or into an orientation (revolutions) or angular velocity (revolutions/second) by first subtracting an offset, then thresholding it to see if it is far enough from zero, then (if it is) scaling it and taking it to a power (to allow nonlinear speedup as the stick is pushed far from center).

A button can be associated with a reset function, which will take the device back to center (identity transformation). The device will also recenter when the first connection is made to the server it is running on. (Centering has no effect on absolute AnalogFlys.)

See comments in the file server_src/vrpn.cfg.SAMPLE for a description of how to launch a vrpn_AnalogFly on top of several different vrpn_Analog devices from within the standard server application. See the source code for the server (server_src/vrpn.C) for an example of how to create an AnalogFly and hook it up to the Analogs and Button from within source code.

vrpn_JoyFly

The vrpn_JoyFly class has been superceded by the vrpn_AnalogFly class described above. vrpn_JoyFly is a Tracker; it translates the output of a vrpn_Joystick into reports for any vrpn_Tracker_Remote connected. It currently uses the Walkthrough convention; other conventions could be added at a later date, but then a control protocol will have to be added to select which convention to use.

Brief digression on UNC joybox conventions: There are several joybox conventions in use at UNC, at least two of which are well-known by the names of the groups that popularized them: Walkthrough and Ultrasound. Each of these conventions makes perfect sense given the mindsets and assumptions of their respective groups.

  • Walkthrough: The Walkthrough mapping for the joybox assumes that the user is immersed in a three-dimensional virtual world. The right joystick controls position and orientation in the horizontal plane of the view device: moving forwards, backwards, left, right, and looking side-to-side. The left joystick controls position and orientation out of this plane: looking up or down, tilting the head side-to-side, and moving vertically.
  • Ultrasound: The Ultrasound mapping for the joybox seems to assume that the user is looking at an image (possibly with depth). The right joystick controls movement of the image in the plane of the monitor - horizontal panning, vertical panning, rotation. The left joystick controls zooming and the other necessary degrees of freedom.

Using these devices: vrpn_JoyFly normally assumes that the vrpn_Joystick is on a remote server. If you can afford to run two servers, and make an extra network trip, you probably aren't in the same field we are. As mentioned in the sample configuration file (server_src/vrpn.cfg.SAMPLE), specifying a tracker server name with an initial '*' (which is normally illegal) tells the JoyFly server to look locally for the Joystick from which it should be taking its data.