Page 1 of 1

P5 Glove finger reading DLL and Unity3d demo

Posted: Tue May 06, 2014 10:29 am
by WiredEarp
P5GloveDLL

This uses the P5Glove class I wrote for the mouse driver, and compiles it into a DLL. I wrote this so I could read my P5 Glove in Unity3d Pro. Its so basic its not even worth explaining, just drop it into your Unity project and access it (see the Unity sample here for an example of its use if you haven't used DLL's in Unity before). Note this DLL only reads the fingers positions, it doesn't bother with the sensor data from the outdated P5 sensor base.
P5GloveDLL bare DLL.rar
P5GloveDLL sourcecode.rar
P5GloveUnityTest
P5 Glove unity demo screenshot.jpg
This is a very simple example showing how to use the P5 Glove DLL in Unity. I assume you can probably use other P5 DLL's instead if you'd rather, such as the GlovePIE one (as long as they work for your glove). In it, i've taken the Sixense hand sample and put some very simple code in to make the fingers onscreen bend when you bend the P5 Gloves fingers. I haven't used the Hydra specific components (so no Hydra tracking in the example, just finger motion), so as to make it as simple as possible to understand. Just take a look at the 'P5Fingers.cs' class, and you'll see how simple it is to get finger tracking into your Unity application.
UnityDLLTest.rar

Re: P5 Glove finger reading DLL and Unity3d demo

Posted: Tue May 06, 2014 10:05 pm
by cybereality
Ha! Is the P5 making a comeback?

Re: P5 Glove finger reading DLL and Unity3d demo

Posted: Wed May 07, 2014 9:30 am
by WiredEarp
Ha! Is the P5 making a comeback?
I doubt it :D but it sure is nice to flex the fingers. I'm sure something much more capable will come along soon 8-)

Re: P5 Glove finger reading DLL and Unity3d demo

Posted: Wed May 07, 2014 12:54 pm
by Caliber Mengsk
WiredEarp wrote:
Ha! Is the P5 making a comeback?
I doubt it :D but it sure is nice to flex the fingers. I'm sure something much more capable will come along soon 8-)
http://www.mtbs3d.com/phpBB/viewtopic.php?f=145&t=19117
Working on it :D

Been having issues getting it started as of late, and have finally fixed those bugs, so hopefully can get a new video up soon with it interacting with things in a useful way. :D

Re: P5 Glove finger reading DLL and Unity3d demo

Posted: Wed May 07, 2014 3:44 pm
by Krenzo
I ordered a P5 Glove off of ebay, and I was surprised to find that each flex sensor actually has two sensors in it to track both the knuckle and the proximal joints. It's not all that bad for finger tracking.

Re: P5 Glove finger reading DLL and Unity3d demo

Posted: Wed May 07, 2014 7:24 pm
by WiredEarp
@ Caliber Mengsk: I saw your video a week or two back and it looks quite smooth. Seems slightly more accurate than one of my P5s (my other one is brand new and seems ok).

I have another glove design I wish to work on now that doesn't use resistive finger tracking (like you mentioned you were planning on moving away from). Resistive is nice to implement but I'd rather use something more reliable/less fragile for a heavy use glove. Maybe i'm just biased due to the buggy thumb on one of my P5's. Be interested to see your next version.

Re: P5 Glove finger reading DLL and Unity3d demo

Posted: Thu Dec 18, 2014 3:10 am
by erb365
Thats cool how do I make it so that if i move my hand in real life it moves the hand in unity also? I tried attaching the sixens scripts but it din't work

Re: P5 Glove finger reading DLL and Unity3d demo

Posted: Wed Jul 04, 2018 5:45 am
by WiredEarp
Well... this is a 4 year late reply, sorry erb365!

The driver only includes finger tracking, as the P5 tracking was simply too unreliable (and not 6dof) to be useable. You need to provide your own tracker.
The app I provided in another link (https://www.mtbs3d.com/phpBB/viewtopic. ... 45&t=19552) allows/allowed you to use any VRPN source as the tracker, or you can use a Razor Hydra.

Since its now 4 years later, and VR has advanced a lot, I'd simply add a SteamVR tracker. This driver should still work for reading the finger bends from a P5 glove.

Re: P5 Glove finger reading DLL and Unity3d demo

Posted: Fri Aug 10, 2018 8:56 am
by Jabberwock
I wish I knew enough about programming to write a P5 plugin for FreePIE... My glove is still working quite well, I have considered disassembling it to use the flex sensors with some kind of orientation tracker, but I did not have the heart to take it apart.

Re: P5 Glove finger reading DLL and Unity3d demo

Posted: Thu Sep 06, 2018 9:56 pm
by cybereality
You can buy flex sensors, you don't need to take the glove apart.
https://www.sparkfun.com/products/8606