Sensor input from p5 glove?

Hi,



I am currently trying to make the Marble Labyrinth game and I have the game working on the keyboard but want to implement it on the p5 glove. Basically tilt the board using the hand. How can I set up a listener for the glove’s sensors?



Thanks!

Is your controller a standard USB joystick? In that case you should be able to access it using the jME3 joystick input system.

No, I want the orientation of the hand and position, as well as the position of each of the fingers. All together around 10 sensor values :?

Man, I haven’t played with a p5 glove in almost 10 years. I remember having to write a Java wrapper for their library and I don’t know if anyone has written a Java wrapper for it yet.



If you can get it to act like a joystick then you should be able to access it like any other joystick. It’s been so long that I don’t remember how it interfaced with regular games or even if it did.

Darn it. Is it possible to stream the sensor values over sockets and use them?

A few years ago I found this: Chapter 14. The P5 Glove

Maybe you can integrate it into your project…

Good luck with that!

@alito said:
A few years ago I found this: http://fivedots.coe.psu.ac.th/~ad/jg2/ch14/index.html
Maybe you can integrate it into your project...
Good luck with that!


Thanks alito. I was trying to integrate this code in my project but I'm having a little problem. Even after loading the library, I get the following error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: P5Library.CP5DLL.P5_Doit()Z
at P5Library.CP5DLL.P5_Doit(Native Method)
at P5Library.CP5DLL.P5_Init(CP5DLL.java:91)
at ClientPackage.Glove.(Glove.java:55)
at ClientPackage.Main.(Main.java:111)
at ClientPackage.Main.main(Main.java:85)

Searching around I found that this could be removed by adding the flag "-Djava.library.path [path/to/lib/folder]" to
your jvm call starting the program.

I'm a complete newb with Java and JME. Can someone please tell me how to do the same within the JME?

A better solution would be to import the proper libraries in your project, so you don’t need to specify to the JVM where the libraries are. Go to the project properties, libraries, and add the jars or libraries you need.

I did! I did! 8O

It’s still giving me the same error. I’ve tried everything!!

If this is on Windows then make sure the DLL and any DLLs it depends on are in the current working directory when you run the app.

They are! :cry:

The current working directory when running in the IDE is the project root folder, when running a jar with java -jar its the folder where you execute that command (e.g. “dist”).

If you are on Windows and you need a DLL, make sure you have it in the proper OS folder (windows/system or windows/system32).

Let us know if worked!

@alito said:
If you are on Windows and you need a DLL, make sure you have it in the proper OS folder (windows/system or windows/system32).
Let us know if worked!

Nonsense, jme's DLLs DO NOT go to the system32 folder.
@normen said:
Nonsense, jme's DLLs DO NOT go to the system32 folder.


I mean for the glove input, sorry if I didn't explained myself properly :)

Well yeah I don’t think that matters but I tried it too, still the same error.

@alito said:
If you are on Windows and you need a DLL, make sure you have it in the proper OS folder (windows/system or windows/system32).
Let us know if worked!


Putting things in Windows/system or windows/system32 is an ugly hack and is never required. The current working directory is always on the lib path in Windows... you don't need to pollute the windows system directories with random stuff.
1 Like
@pspeed said:
Putting things in Windows/system or windows/system32 is an ugly hack and is never required. The current working directory is always on the lib path in Windows... you don't need to pollute the windows system directories with random stuff.

You're right, I'm used to the orc techniques :D
I'll take a look later and try to make the library run, but I won't be able to test it, I don't have a P5.