P5GloveMouseDriver application (Hydra/VRPN tracking + P5)

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

P5GloveMouseDriver application (Hydra/VRPN tracking + P5)

Post by WiredEarp »

This is a Windows mouse driver that allows you to use a VRPN device, or a Razer Hydra, to control the mouse, along with using a P5 Glove to click, right click, or 'ratchet' - which, since I never bothered implementing 'relative' mode, actually just enables or disables the mouse emulation.

To use, mount a Hydra or VRPN device to your P5 Glove (in a location where the interference is not too bad), run the driver, and click 'Start'. There are various options you can change, such as changing which finger on the glove you can use to click/rightclick/ratchet, adjustment of the mouse sensitivity in X and Y, or changing the sensitivity threshold at which the P5 glove considers a finger to be 'clicking'. You can also change the Y axis if required (VRPN uses a different handed coordinate scheme to the Hydra). You'll need the Hydra drivers running to use the Hydra mode. To use the VRPN mode, simply run your VRPN server for the appropriate device and it should pick it up (if you need help with this, let me know - VRPN looks confusing when you first see that configuration file, but its really extremely simple to use).

When using it, you can bend the 'ratchet' finger, and once the finger hits the sensitivity threshold, it will turn the mouse emulation on. This means that you can be flying a plane in FSX, reach forwards, bend your little finger, then click virtual controls in the cockpit. It really does help immersion to use realistic motions to manipulate virtual controls!
P5HydraMouseDriver screenshot.png
Since you probably want to set the centre point of absolute mode so that its at a comfortable location/distance, simply put the glove in the location you wish to be the 'center', then press button 'B'. You'll hear a sound effect that will tell you that a new center position is now set.

If you wish to recalibrate your P5 Glove, you can use the standard drivers (if they work for you) - or, you can use this driver as well. Simply press and hold the 'A' button for 3 seconds. When you release it, it will go into calibration mode (you'll hear a sound effect). Move the fingers through the range of motion you desire. After this, press button 'A' again, and it will save the calibration (and you'll hear another sound effect). Calibration is actually saved into the P5 Gloves hardware (its not a software thing). Unfortunately, I couldn't use RawDeviceInput to do this (its read only), so I actually used HIDAPI for the calibration routine (I could have used direct DDK, but HIDAPI seemed much tidier, at the cost of a DLL). I might either try and statically compile it into the app later, or rewrite it to use the DDK, which wasn't really much more complex (would have meant an extra .cpp file though) if I feel that it would be better to remove the need for the HIDAPI.DLL file.
I would like to thank Jason McMullan and the other people who contributed to the older libp5glove driver for the P5, as I stole the values to trigger the calibration routine from this library.

If you have any problems or questions, let me know. Actually, anyone have any advice for the best place to upload software nowadays, since I hear SourceForge is no longer so good?
P5GloveHydraMouseDriver Win32 executable.rar
P5HydraMouseDriver sourcecode.rar
You do not have the required permissions to view the files attached to this post.

User avatar
3D Angel Eyes (Moderator)
Posts: 11394
Joined: Sat Apr 12, 2008 8:18 pm
Which stereoscopic 3D solution do you primarily use?: S-3D desktop monitor

Re: P5GloveMouseDriver application (Hydra/VRPN tracking + P5

Post by cybereality »

Awesome. Still have the P5 in the closet somewhere. Never got to do anything with it really.

Post Reply

Return to “Physical VR Tools”