Some info about using a P5 Glove

Discussion of tools and products that add VR physicality. Samples include VR treadmills, special hand controllers, gesture technology and more.
Post Reply
WiredEarp
Golden Eyed Wiseman! (or woman!)
Posts: 1498
Joined: Fri Jul 08, 2011 11:47 pm

Some info about using a P5 Glove

Post by WiredEarp »

Hi guys

I thought I'd drop some of my P5 Glove stuff here, in case its of any use to anyone (I'll probably drop some other utilities i've written over the next few weeks, as I'm trying to tidy up old stuff I no longer use, and so may as well put it all out there).

Some brief info about the P5 Glove - the glove itself is a pretty good device for the price. I bought mine for about $40 each, so its hard to beat in terms of a capacitive finger glove for VR purposes (I bought them a year or two apart as well, so the price didn't seem to have changed much). It has an 'outside in' style, which means that you can use it perfectly well while holding a joystick or flight yoke. It DOES have several limitations which I'll cover now, along with their solutions (and some software I had to write to make mine work).
Outside in style P5 Glove.JPG
1) One of the main limitations of the P5 Glove, is that it ONLY returns updates when its in the tracking area tracked by the base. I believe it shouldn't be hard to remove the base totally, and replace it with an Arduino to read the fingers directly, but its not really necessary, as there is a cheap workaround. Simply position a flashing IR source to face the sensor on the base. I use an old TV remote control with the button held down - i keep meaning to do something less kludgy (flashing IR circuit or similar), but it works fine for my purposes. The only problem with this method is that the flashing speed of the remote I use is not as high as it should be, meaning I get less FPS on the finger updates than I get with having the glove in the tracking area (the glove has flashing LED's on it). This isn't really a problem for me, but simply using a faster flash rate on the emitter should increase the speed (i suspect the P5 glove sends an update every 'flash').
Once you have done this, you will then be able to use the P5 glove in any location, regardless of what the tracking base sees.

2) I was very unhappy with the tracking ability of my P5 Glove (it was just too jittery to be of much use to me). Also, my glove would not work with ANY of the existing P5 drivers, glovePIE, etc - it would simply crash when I attempted to use it. Eventually, I traced the problem down to the thumb of my P5 Glove being slightly faulty/jittery, and I suspected the crash was being caused by data being sent out of range to the drivers. Unfortunately, this meant I also couldn't recalibrate it using the existing utilities either (which I wanted to try to see if it fixed the thumb values) so I had to write my own. Hence, the little P5HydraMouseDriver app I wrote, which allowed me to use a Razer Hydra circuitboard for tracking, instead of having to use the built in drivers. The problem here, was I needed to stop the P5 Glove showing up as a hardware mouse, and interfering with my new mouse emulation. To do this, you can simply need to disable the mouse driver that shows up in Device Manager after you connect the P5. This will stop the original tracking system from fiddling with your mouse.
Hydra gamegun and tracker unit.JPG
After writing the mouse driver, I eventually purchased another P5 Glove, which turned out to have much better tracking and doesn't crash, but I still prefer using my driver for my purposes (mainly, using the glove in the 3D cockpits of various flight sims, because its very nice to be able to simply reach out a hand and click switches with your index finger, rather than having to find the mouse). I don't really use VR for my sims yet, but once I have my DK2, I'll be looking forward to using it in VR as well, in which case it will be even more necessary for me, since I won't be able to see the mouse to grab it.

SOME NOTES ABOUT THE RAZER HYDRA
I've had some annoying issues with my Hydras since last year. In fact, I've had serious enough issues that I pretty much can no longer recommend the Hydra to anyone. Specifically, they are extremely unreliable. I've had 3 sets of them - the first one I destroyed by pulling a trace off the board when doing a mod :oops: . The second one, I split the boards off, did Janoc mods on them, and used it quite successfully for a while. One board went into a gamegun, and the other board went into an enclosure that I mounted on my glove (see picture). This worked fine for a long time, but recently, when I was tidying up my code, this Hydra has developed reliability issues. It works fine sometimes, other times it glitches all over the screen. I suspect a cable issue of some kind. My 3rd Hydra I left stock, as I didn't wish to damage it as I require it for my Unity3D game/testbed that I am using nowadays to test various ideas on. However, wouldn't you know it... this Hydra ALSO has issues now (similar, glitching issues, actually). However, I have fortunately discovered this is due to a cable issue shortly after the cable exits the handset. I suspect this is a weak area. SCREW YOU, RAZER, for not making the Hydra wireless, which I believe would have prevented at least this failure. However, at least I can use my 3rd set of Hydras fine, as long as I dont kink it around this area on one of the handsets. I'm looking forward to getting my STEM system, so that I can mount one of those trackers to my glove instead.

Unfortunately, this means I currently need to stick a whole Hydra handset to my glove to use my mouse driver, but at least this isn't too much hassle. This also has the advantage that I don't need to use VRPN to access the Hydra's sensors, as you do if you are using a Hydra board that is Janoc modded. This is mainly useful because you can then also still use the buttons on the Hydra etc. Of course, a 3rd option would be to use a Palmer mod on the Hydra, which would then also allow you to bypass VRPN. This leads me to problem #3 with the P5 - it generates magnetic interference for about 3-6" around it. One of mine is significantly worse than the other. This means you need to be careful where you mount a magnetic sensor on the glove. With my 3rd set, I simply mounted it so that the tracking coils were further away from the glove (this helps a lot). With the circuit board mount, I had to be careful in where I positioned it, as simply a difference of a centimeter or so can mean the difference between usable sensing, or lots of glitching. I also had to add significant filtering to the Hydra tracking data to avoid jitters.
P5 with std Hydra being worn.JPG
P5 Glove with standard Hydra attached.JPG
I've recently updated the mouse driver I wrote to actually have a UI, and it now allows you to choose between VRPN or native Hydra drivers for the above reasons. This also means that you can use other VRPN devices as the tracker if you like (VRPN is great BTW, I love that I don't need to manually write my own drivers to read other devices such as Flock Of Birds etc). It also lets you do things such as adjust the finger click sensitivity of the P5 glove (for right clicking, left clicking, and ratcheting), adjust which fingers you wish to use for clicking/ratcheting, or change the Y axis used (VRPN uses a different coordinate system to Hydra). I _would_ like to thank Janoc for providing some advice about a weird VRPN issue I had last year - I'm still not sure what caused it, but going to V7.31 of VRPN seems to have resolved it, so if you ever have strange issues when crossing over axis with VRPN Hydras, make sure you have this version at least).
It also lets you use the P5's buttons to recalibrate the glove (so you don't need to use the official drivers, which didn't work on one of my P5's), and set the centre volume for the absolute mouse mode (which is the only mode implemented actually, I didn't ever find a need for relative mode, although I did put the facility to select it into the driver).
P5HydraMouseDriver screenshot.jpg
I though I'd post the code for the driver, as it might be of use to someone. It shows how to use Windows RegisterRawInputDevices's API to directly read data packets from virtually any HID device, without having to mess with DDK's or HID API's, which is rather useful IMHO. The mouse driver *does* actually make use of a HID API for the calibration routine however (HIDAPI), since I wanted to add this feature before releasing it, and RegisterRawInputDevice only lets you read. So, if you just want a simple example of how to read a HID device directly, just look at the P5Glove.h/P5Glove.cpp files which is the main class that initializes a RawInputDevice and reads the data from it. In my example, I only decode the bytes that represent finger position, because I consider the other tracking data returned in the packets fairly useless. The app itself is C++, raw Windows API code (which I prefer, since I never learnt MFC, and use C# for more complex applications) so its only 186KB. It may not be amazing code, but I have tried to go through and make sure its well commented, and it does show how to easily create a small c++ Windows app using Visual Studio and a dialog (so there is no code positioning of controls required - you can just design the GUI using the dialog editor). This is my favorite method of writing small applications that need to access hardware etc. The thread here http://www.mtbs3d.com/phpBB/viewtopic.php?f=145&t=19552 has the code and binary.

I've also been doing a bit with Unity3D the last 6 months (and feel a bit bummed now, because I'm about to switch to UE4 instead, so I guess a fair bit of what I learnt was wasted knowledge), and wanted to use my P5 Glove in there, so I took the P5Glove class and made a quick DLL with it so I could read the finger inputs in Unity Pro. I've posted this DLL code here http://www.mtbs3d.com/phpBB/viewtopic.php?f=145&t=19551 along with a very basic Unity demo showing using it with the Sixense hand class, in case anyone else wants to use a P5 Glove in Unity, and wants a simple start point.

Anyway, I hope this code dump is of use to someone besides me (and apologies for the wall of text). Many/most? people with P5's won't require this driver, since GlovePIE etc will probably do the job fine, but for the people whose P5 gloves crash with standard drivers (I've seen several people posting about the same issue mine had), or who just prefer an integrated app rather than loading scripts, then this is a potential solution for them.
You do not have the required permissions to view the files attached to this post.
Post Reply

Return to “Physical VR Tools”