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.
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.
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…
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
March 23rd, 2009 at 3:13 pm
Very cool! I’m going to have to try this out tonight.
You’re SIV jps viewer also sounds very interesting.
I’ve been using a simple stereo pair viewer for my viewing needs. It only supports .ppm files though. I was looking into the jps format and found your site by accident. This is my lucky day. 🙂
http://www-users.cs.umn.edu/~wburdick/geowall/viewer.html
March 23rd, 2009 at 11:40 pm
I also stumbled over the viewer you mentioned, but since most stereo images are in jps format it did not statisfy me. The only jps viever for linux I found is gqview (with patch), but it does not support quad buffered stereo (needed for the VR920). Well, and from viewing the source it seemed not that easy to integrate headtracking into the viewer (which I am currently working on for SIV). So I decided to write SIV…
On the other side SIV has far more library dependencies to statisfy…
I hope the driver works for you. It would be nice if you could leave some feedback after you tried the driver, since I can only test it with my device and “my” earth magnetic field.
Thanks,
Jürgen
March 24th, 2009 at 4:04 pm
I tried your driver last night and it seems to work. 🙂 I use Debian Sid X86-64 and built it from your source.
I’m happy to give feedback. What sort of information is useful to you? I don’t presently know much about magnetometers or accellerometers but I will look into it.
Last night, I believe I saw movement on all the axes.
I have a win2k machine available that can be used for comparison with the vuzix driver.
I haven’t used the vr920 much on windows, but I was never able to get a perfect calibration for the head tracking. In the game Doom3, if I were to look straight up, the view would move a little to side as well. I think the crosshair was also a little shakey. Maybe other programs are better or perhaps I’m just bad at calibration ;).
I think I read somewhere that more expensive HMD headtrackers have another sensor in addition the accellerometers and magnetometer. Gyroscopes?
I know a little C. I would like to learn how to use your driver.
Thanks for your hard work!
March 24th, 2009 at 11:12 pm
I’m glad to hear the driver works for you. Thanks for the feedback. Most interesting would be to know how good calibration works and how smooth and precise the movement is. If you have suggestions how to improve the driver, they are also welcome 😉
Well, for judging how good calibration works and how smooth and precise the movement is, it will probably not be enough to see the data from the output. Best for this would be an application that uses the tracking data for view manipulation. Perhaps you can try to build SIV on your machine. If the actual version runs on your system (dependencies), the future version with headtracking support will also. So when the new version is ready you could check the movement, then.
For learning how to use the driver have a look at the source file democlient.cpp. It should be quite easy to read.
In short:
– create a multicast socket
– in the main loop read the struct TrackingData from the socket
– close the socket when finished
Reading the data from other programming languages should also work, but can be a bit problematic (i.e. little vs. big endian in java). Perhaps I should also provide a java democlient…
Jürgen
April 5th, 2009 at 4:36 pm
[…] Update: My VR920 headtracking driver is now available here: VR920 headtracking driver for Linux […]
April 5th, 2009 at 11:08 pm
The new version of SIV is available now, so if you like, you may try the driver with it.
Jürgen
April 6th, 2009 at 8:48 pm
[…] HMD. For this you will need (in addition to the device ) the headtracking driver, I published in VR920 headtracking driver for Linux. You may watch a video (demo_siv_headtracking_vr920) of me using the viewer with enabled […]
April 24th, 2009 at 4:57 am
Hi, Jürgen, I want to try your Linux driver, but link to sorce is not working now, some php errors apeared instead driver source.
April 24th, 2009 at 9:24 am
I’m sorry for the inconvenience. Downloading works again.
July 16th, 2009 at 11:53 am
wow how cool that you have wrote here how to acess an VR920 videoeywear on linux. Respect …
July 17th, 2010 at 11:13 pm
You made me want to buy one of those glasses.
Thank you 😉
August 30th, 2010 at 8:31 am
Nice, did the driver work for you? Are you building some special application with the vr920 on linux?
September 6th, 2010 at 8:35 pm
Congrats for the initiative and good work!
I’m thinking about how to make flightgear and vr920 come to an agreement (at least compromise) on:
– 3D stereo (I have no clue about this, where do I start? flight gear itself? openscenegraph? nvidia driver? xorg?)
– Head tracking (for this maybe writing a ‘fake joystick’ driver to receive the data your driver sends out…)
September 6th, 2010 at 10:33 pm
export OSG_STEREO_MODE=ANAGLYPHIC;export OSG_STEREO=ON
September 7th, 2010 at 11:21 pm
I tried flightgear in quad bufferred stereo mode with openscenegraph-2.8.2. This did not work (no stereo display and wrong graphics). (see comment 2 of http://www.mygnu.de/index.php/2010/03/flightgear-2-0-0-on-gentoo/ ). Anaglyph stereo works, but is not the right way for me, with a device like the vr920 there should be true stereo (export OSG_STEREO_MODE=QUAD_BUFFER fgfs), which fails with flightgear. From my experiences the bug should be in openscenegraph or flightgear. I have no idea where one could start to search for it. I don´t suspect the driver to be responsible for it, since I used quad bufferred stereo in some linux projects (with and without openscenegraph) and never had this problem. As I wrote, when flightgear works in stereo I´d like to implement the headtracking feature for flightgear. It should be straight forward, the same approach I used in SIV, my jps viewer. Get the data from the driver via the multicast socket and use it to rotate the osg camera. If you´re interested in how it works, look at the SIV source (VR920TrackingManipulator.cpp). A fake joystick driver can only give half of the experience. In my opinion the major problem of tracking technology is that there is no manufacturer independent interface (like we have for joysticks) for it, so an application has to support each tracking device seperately. But I also don´t have an idea where to start to bring such a standard on its way. Perhaps if others involved in tracking driver development read this and agree to work together on it, this could be the right way to start.
November 5th, 2010 at 2:30 am
[…] 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 […]
May 8th, 2012 at 5:41 pm
I have problems to complie the source on my Ubuntu 11.10. I installed all needed packages but always get this error: http://nopaste.info/d816553a72.html
Can you tell me what the problem is?
May 8th, 2012 at 6:02 pm
Hi fabske,
I am not able try this out, since my only ubuntu system is still running 10.04 LTS. With the 10.04 version the driver compiles, as well with a current gentoo linux. Well, in the comment http://www.mygnu.de/index.php/2011/03/vrtrack-1-0-headtracking-driver-for-the-vr920-hmd/comment-page-1/#comment-3938 Rodrigo Ventura proposed a patch for the Makefile. I assume he has gotten the same error as you. Thus I suggest to try his way, and please report afterwards if it worked for Ubuntu 11.10. Could you also post the output of pkg-config fuse –cflags –libs, please (there are two minus characters before cflags and libs, cut and paste from the web browser will not work)?
Jürgen
May 9th, 2012 at 11:35 am
Hi Jürgen! 🙂
I dont know exactly how to patch, but as I see the difference is just:
g++ -Wall `pkg-config fuse –cflags` -O2 -o vrtrack vrtrack.cpp `pkg-config fuse –libs` -lpthread -lconfig++ -lusb
If I enter this in my bash I still get the same error..
pkg-config fuse –cflags –libs:
-D_FILE_OFFSET_BITS=64 -I/usr/include/fuse -pthread -lfuse -lrt -ldl
All: http://nopaste.info/0a7d74e5e8.html
May 9th, 2012 at 12:01 pm
Hi fabske,
please try to include stddef.h. There seems to be the offsetof macro missing, which is defined there. Probably it gets included as a dependency on my systems or is defined somewhere else, also. Does this work?
Jürgen
May 9th, 2012 at 1:43 pm
Indeed! I needed to include #include and to change the Makefile and now it works! 🙂
More or less.. I have other goggles, mine is called WRAP 920! 🙁
I changed now product ID to 0x014b in the vrtrack.cpp but get an error:
USB error: could not set config 1: Device or resource busy
Propably the usb_interrupt_read() is making trouble?
May 9th, 2012 at 1:44 pm
Indeed! I needed to include and to change the Makefile and now it works!
More or less.. I have other goggles, mine is called WRAP 920!
I changed now product ID to 0x014b in the vrtrack.cpp but get an error:
USB error: could not set config 1: Device or resource busy
Propably the usb_interrupt_read() is making trouble?
May 9th, 2012 at 1:53 pm
Good to know that this works. I am sorry, but the Wrap 920 is not supported by the driver, yet. Since I do not have any of these, there is nothing I can do about this at present. Perhaps I can do something in the near future, but this is not sure yet. Once I can tell more there will be news on the blog.
Jürgen
May 9th, 2012 at 4:48 pm
The Wrap 920 should work, but there seems to be a bug. Every 3 sec the goggles turn off and on 🙁
http://micolous.id.au/archives/2011/04/17/vuzix-wrap-920-vga-linux/
Seems to be related with the HID driver.