VRTrack 1.0 – headtracking driver for the vr920 HMD

As I promised in New version of the vr920 headtracking driver coming soon here is the new version of my headtracking driver for the Vuzix VR920 iwear for Linux. It calculates yaw, pitch and roll from the accelerometer and magnetometer data (The device has got three of each). This makes a 3DOF tracking possible and allows you to look around in a 3D Scene.  In example you can use the driver with my stereoscopic image viewer SIV. The driver averages the sensor readings with an improved algorithm, which gives a far smoother experience than with the initial driver version. The driver package consists of a daemon which can be run in the background and for convenience a basic control application that enables one to easily tweak the various driver settings and to callibrate the device. For general Information on how to use the device with Linux see: Vuzix VR920 with Linux and active 3D stereo.

The driver provides the trackingdata in different formats to the application using it. It always writes the data to /dev/headtracking. A line read from /dev/vrtrack consists of six floats that correspond a sensor reading in this format:

yaw pitch roll x y z

Yaw, pitch and roll are angles from 0 to 360 degrees. X, y and z are always zero for the vr920, since it only supports three degrees of freedom. These values are reserved for future devices which may support six degrees of freedom, in the hope to propose a standard for tracking devices.

The driver can scale the readings and invert the axes independantly to get the needed value range for the used application and a pleasant experience.

For maximum compatibility with existing applications there are four other modes of operation available that can be enabled separately:

  • Joystick emulation
    The driver emulates a joystick device /dev/input/jsX. The readings for yaw, pitch and roll are the X,Y and Z axis of the emulated joystick. This may be used to enable basic headtracking support in games that do not natively support headtracking.
  • Mouse emulation
    The driver emulates a joystick device /dev/input/mouseX. The readings for yaw and pitch are being translated to X and Y of the mouse device, so when you look right the mouse pointer moves to the right and when you look up the pointer moves upwards and vice versa.  This may also be used to enable basic headtracking support in games that do not natively support headtracking. It can also be used to just control the mouse pointer of the window system. Controlling the viewport of the window system can also be a resonable purpose. With the new MPX extension in xorg this may be possible.
  • UDP – network
    In UDP mode the driver sends the tracking data via network as UDP unicast. The approach to send the data out via network makes the language used for writing the application independant from the language used for developing the driver. The packet sent to the clients contains the three angles, yaw, pitch and roll and x,y and z as 32 bit fixed point in Q16.16 format. This mode may i.e. used to control flightgear.
  • Multicast – network
    In multicast mode the driver sends the tracking data via network as UDP multicast, thus many clients may read the data, which makes parallelization more possible, i.e. one could use one machine for rendering and another machine for calculations. In addition to this, the approach to send the data out via network makes the language used for writing the application independant from the language used for developing the driver. The tracking data sent to the clients contains the three angles, yaw, pitch and roll and for easy usage a viewmatrix, one can directly use with scenegraph libraries. If you intend to develop an application using the headtracking of the VR920 see the file democlient.cpp included in the download for details on how to get the data into your application. This mode is used by the stereoscopic image viewer SIV.
Below is a screenshot of the control application during callibration of a vr920 device:

control_app

Important note: During calibration make sure that the display of the device is displaying something. Since the displays not only showing a blue screen influences the sensor data (at least with my device) you’ll end with wrong calibration else. You may use i.e. nvidia-settings to ensure this. For detailed usage instructions see the readme included in the download.

Download:

I decided to publish the driver under the creative common noncommercial license. You may download the full source from here: vr920-driver(source) (4821 downloads ) , an x86_64 binary from here: vr920-driver(x86_64 binary) (4222 downloads ) , or an i686 binary from here: vr920-driver(i686 binary) (4378 downloads ) . An Archlinux PKGBUILD provided by Feilen is available here: aur.archlinux.org More binary/distribution specific formats may be available in the future. The x86_64 binary has been build on an up to date gentoo system, the i686 binary on ubuntu hardy. For the i686 binary you may install libconfig++ i.e. libconfig++8_1.3.2-2 from here: libconfig++ If none of the binaries works for you, you may have to build from source…

You need to have libusb, libconfig++, libfuse and libcurses installed on your system. For ubuntu users I included the small shell script ubuntu_install_deps.sh that installs the dependencies. Maybe it works also for for other Debian-based distributions. Gentoo users just have to make sure that  libusb, ncurses, fuse, and libconfig have been emerged. Your kernel version has to be at least 2.6.31 and you must have cuse enabled in your kernel.

Footnote:

If you like the driver, feel free to link to www.mygnu.de. If you developed an application using the tracking data provided by the driver please leave a comment, because then I can review the application and eventually write about it. To request commercial licenses contact us at info(at)mygnu.de. Well, if you just want to support our work on MyGNU.de use the donate button 😉

best regards

Jürgen

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
Loading...

New version of the vr920 headtracking driver coming soon

Last year I published the first version of my linux headtracking driver for the VR920 HMD here. Currently I am working on a new driver version which will have the following additional features:

  • Multiple Protocols:
    -UDP multicast (as before)
    -UDP unicast (for flightgear connection and perhaps more)
    -mouse emulation (via uinput)
    -joystick emulation (via uinput)
    -character device for direct angle readings (via cuse, will
    require a kernel >= 2.6.31)
  • Inverting of axes (to have moving the head up making the mouse pointer up or down, depending on needs)
  • Better filtering algorithm (more stable headtracking)
  • Scaling of data (i.e. to match screen size with mouse mode)
  • Customisable delay between sensor readings
  • User interface separated from the driver

With the upcoming MPX and the mouse emulation it should be possible to control the visible viewport by turning around the head. Controlling the view for games or other software that do not natively support headtracking should also be possible with the emulation.

In the current development stage most of the features are basically working so expect the new driver to be released soon.

Stay tuned for updates

Jürgen

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
Loading...

VR920 headtracking driver for Linux

As I promised in VR920 Headtracking driver development here comes a usable version of my headtracking driver for the Vuzix VR920 iwear for Linux. Again I want to thank MalMal of Vuzix Forums, from whose code I was able to learn how to read the Sensor data out of the device via USB. For general Information on how to use the device with Linux see:  Vuzix VR920 with Linux and active 3D stereo.

I managed to calculate yaw, pitch and roll from the accelerometer and magnetometer data (The device has got three of each). This makes a 3DOF tracking possible and would allow you to look around in a 3D Scene.

The driver sends the tracking data via network as UDP multicast, thus many clients may read the data, which makes parallelization more possible, i.e. one could use one machine for rendering and another machine for calculations. In addition to this, the approach to send the data out via network makes the language used for writing the application independant from the language used for developing the driver.

The tracking data sent to the clients contains the three angles, yaw, pitch and roll and for easy usage a viewmatrix, one can directly use with scenegraph libraries. If you intend to develop an application using the headtracking of the VR920 see the file democlient.cpp included in the download for details on how to get the data into your application.
Below is a screenshot of the driver during calibration:
vr920 driver screenshot
vr920 driver during calibration ( screenshot)

Usage:

./vr920 -h vr920 [-h] [-?] [-m multicast ip] [-p multicast port] [-c calibrationfile]

On the commandline you may specify a multicast address and a port to send the data to. If you choose not to define these values the driver will send the tracking data to a sane default (224.0.0.42:4242). In any case, the client using the tracking data has to join the same address with the same port. You may decide not to use real network, if you only want to use the data on the same machine. In this case you may use loopback networking.

Add the route for the multicast address to the loopback interface:  route add -host 224.0.0.42 lo

Delete the route:  route del -host 224.0.0.42 lo

After executing the driver it instantly starts to send the trackingdata. Initially it starts in “silent” mode. You may activate/deactivate the monitor mode by pressing the M key. In monitor mode the driver displays the angles for yaw, pitch and roll. By pressing the C key you can activate/deactivate the calibration mode.

In calibration mode the driver displays  the most amount of information, the angles for yaw, pitch and roll above the normalized sensor data. Below the minima/maxima of the sensors are being displayed.The calibration works similar to the windows driver, one has to turn around the HMD (with the side-pieces open) until no minima/maxima changes anymore. Afterwards turn the device forward (the direction where you want to have the center of your view) and press the Z key to set the zero direction. Once you have completed calibration press S to store the calibration for future use. Finally press the C key again to exit calibration mode.

As default the calibration is being saved to the file .vr920 in the users home. You may specify a different filename using the -c option. If you do so this file will also be in the users home. To use i.e. a global calibration file you have to specify the full path  starting with a slash.

Important note: During calibration make sure that the display of the device is displaying something. Since the displays not only showing a blue screen influences the sensor data (at least with my device) you’ll end with wrong calibration else. You may use i.e. nvidia-settings to ensure this.

Download:

I decided to publish the driver under the creative common noncommercial license. You may download the full source from here: [download#7], an x86_64 binary from here: [download#8] , or an i686 binary from here: [download#15]. More binary formats may be available in the future. You need to have libusb, libconfig++ and libcurses installed on your system. Libconfig++ is being used to store the calibration data and libcurses for the user interface. The x86_64 binary has been build on an up to date gentoo system, the i686 binary on ubuntu hardy. For the i686 binary you will need to install libconfig++ i.e. libconfig++6_1.3.1-1 from here: libconfig++ If none of the binaries works for you, you may have to build from source…

New version available here.

Building from source:

For building from source unpack the zip and cd to vr920 and run make. If you use a binary based distribution, make sure you have the devel version of the needed libraries installed on your system.

Future Plans:

In the future I plan to extend the jps viewer I published in SIV – a stereoscopic jps viewer for Linux to use the tracking data from the driver, so one can look around the scene by turning his head.

Update: New version of SIV with headtracking support is available at: SIV-1.0 released

Footnote:

If you like the driver, feel free to link to www.mygnu.de. If you developed an application using the tracking data provided by the driver please leave a comment, because then I can review the application and eventually write about it. To request commercial licenses contact us at info(at)mygnu.de. Well, if you just want to support our work on MyGNU.de use the donate button 😉

best regards

Jürgen

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
Loading...

VR920 Headtracking driver development

I made some progress in developing a Linux driver for the Vuzix VR920 iwear headtracking. Thanks to MalMal on Vuzix Forums I was able to learn how to read the Sensor data out of the device via USB. I managed to calculate yaw, pitch and roll from the accelerometer and magnetometer data (The device has got three of each). This makes a 3DOF tracking possible and would allow you to look around in a 3D Scene. Also a use as X11 input device would be possible. One could move the window one sees on a virtual Desktop by turning his head. For this we would need a new X11 input driver which  maps the tracking data to the  viewport of the virtual screen. How about full HD with 640×480 displays? 😉

The driver sends the tracking data as UDP multicast, thus many clients may read the data, which makes parallelisation more possible, i.e. one could use one machine for rendering and another machine for calculations.

The calibration works similar to the windows driver, one has to turn around the device until no values increase anymore.

I still have to improve the calibration mechanism. It still lacks the set zero feature. Also I have to make movements appear more smooth. Well, these are more or less minor problems and I should solve them soon. So expect to see a download ready version soon on mygnu.de.

Stay tuned for updates.

Jürgen

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

Vuzix VR920 with Linux and active 3D stereo

I recently received my VR920 3D stereo glasses from USA. A detailed review of the device can be found here : Introducing the Vuzix iWear VR920. A photo of the VR920 can be seen below:

VR920 HMD

The device of course works flawlessly using Windows. The situation under Linux is a bit different, due to missing driver support from the manufacturer, as usual.

Stereo vision works at least with nvidia quadro boards, probably also with others. I.e. Ati FireGL should work, but I never tried this. Setting this up was easy. I only had to start a second XServer and add the line

Option “Stereo” “1″

into the screen section of its xorg.conf. With this setting you get a different image for both eyes and thus real stereo vision if your application supports quad-bufferred stereo. It is important that the screen resolution is between 640×480 and 1024×768 and the refresh rate is 60 Hz. The xorg.conf you are using for this must not use the composite extension. For disabling the Composite extension append the following to the xorg.conf:

Section “Extensions”
Option         “Composite” “Disable”
EndSection

Sadly this also prevents the use of compiz, hopefully Nvidia fixes the incompatibility between stereo and the composite extension some day.

For starting the xserver i use the following little script, which opens 2 xterms and starts the program (given as parameter with arguments) in one of them.

#!/bin/bash

/usr/X11R6/bin/X :1 -dpi 96 -xf86config ./xorg.conf.3d -auth /var/gdm/:1.Xauth vt8 &
DISPLAY=:1.0
export DISPLAY
sleep 5
icewm&
hotkeys&
xterm -fn 9×15&
xterm -fn 9×15 -e $@&

The headphone gets detected as alsa device:

usb 2-2: new full speed USB device using uhci_hcd and address 8
usb 2-2: configuration #1 chosen from 1 choice
generic-usb 0003:1BAE:0002.0002: hiddev0,hidraw1: USB HID v1.00 Device [Icuiti Corp. VR920 Video Eyewear] on usb-0000:00:1d.1-2/input3
usb 2-2: New USB device found, idVendor=1bae, idProduct=0002
usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 2-2: Product: VR920 Video Eyewear
usb 2-2: Manufacturer: Icuiti Corp.
usbcore: registered new interface driver snd-usb-audio

cat /proc/asound/cards:

1 [ Eyewear ]: USB-Audio – VR920 Video Eyewear
Icuiti Corp. VR920 Video Eyewear at usb-0000:00:1d.1-2, full speed

I was able to get mplayer to play on the device by setting the output device to hw=1,0 .

Sadly the mixer does not seem to work. At least the mixer levels are not controllable. Perhaps any alsa developer has an idea for this? It is even more important since the mixer control wheel at the device freezes after three steps when using linux.

More important than having controllable sound is to get the integrated headtracking to work. There is a non-working driver at vuzix forums. At least it can read the sensor data from the device but does not seem to handle the data correctly. I will look into this soon.

Update: My VR920 headtracking driver is now available here: VR920 headtracking driver for Linux

Playing with the device I had to find out that there is no jps stereoimage viewer for linux. The only programm I found, which is able to read jps-images, is gqview (GQView3D). Sadly gqview is not able to display theese images using active quad-buffered stereo. Thus I decided to write my own jps viewer. It will be based upon OpenSceneGraph (OpenSceneGraph) since I have some experience in OpenSceneGraph development. Perhaps I can integrate headtracking into it. Would be really cool to view a sea panorama image in 3D by turning the head :)

Stay tuned for updates.

Jürgen

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

siteinfo

Translator