Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (526)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (593)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Java Library for Sixense Products  (Read 6843 times)
0 Members and 1 Guest are viewing this topic.
Offline Yoda12999

Senior Newbie


Medals: 2



« Posted 2012-09-15 03:55:22 »

Some of you may know of the 6DOF controller known as the Razer Hydra designed by Sixense. You may also know that the only way to communicate with the controller is through a set of C++ libraries (here). This is quite an inconvienience for Java developers such as myself so I have been working on a Java wrapper for the Sixense libraries for a little while now. This wrapper is in no way  complete though it is slowly getting closer. I should note that I am not a C++ programmer so if any one of you fine chaps would like to critique my code, feel free. Have fun!


Features:
~ Java methods for each function in the sixense library
~ Java methods for the Controller Manager, ButtonStates, FPSPlayerMovement, FPSViewAngles, FPSEvents and Derivatives
~ Java enums provided in place of C++ enums

Included in the zip file:
~ SixenseJava.jar: the Java end of the wrapper
~ SixenseJava32.dll: the native side of the wrapper compiled for Win32
~ SixenseJava64.dll: the native side of the wrapper compiled for x64
~ libSixenseJava32.so: the native side of the wrapper compiled for linux-i386
~ libSixenseJava64.so: the native side of the wrapper compiled for linux-x86_64
~ JavaDocs for everything implemented so far!
~ Source code for both the Java portion and native portion
~ Symbols file for SixenseJava*.dll

Goals:
~ Provide methods for other functions in the sixense_utils library
~ Provide JavaDocs for every function

GitHub
Sixense Java Library Download
Offline Danny02
« Reply #1 - Posted 2012-09-15 07:31:17 »

why not publish it on something like github, so others can easily comment/constribute to your libary
Offline Yoda12999

Senior Newbie


Medals: 2



« Reply #2 - Posted 2012-09-16 13:12:30 »

Excellent idea! I have now posted a link to the project on GitHub.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline tberthel
« Reply #3 - Posted 2012-09-16 21:40:35 »

I will need to make a game just for this.

Offline Yoda12999

Senior Newbie


Medals: 2



« Reply #4 - Posted 2013-03-13 13:35:27 »

Just a little update adding x64 support and access to the FPSEvents methods.
Offline Yoda12999

Senior Newbie


Medals: 2



« Reply #5 - Posted 2013-05-04 08:03:04 »

A few changes have been made including one that should fix the problems some people have been having with libraries not being loaded or incorrect libraries not being loaded.
Online HeroesGraveDev

JGO Kernel


Medals: 300
Projects: 11
Exp: 3 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #6 - Posted 2013-05-04 08:04:30 »

Are there native backends for Linux & Mac?

Offline Yoda12999

Senior Newbie


Medals: 2



« Reply #7 - Posted 2013-05-04 08:07:32 »

I have not pre-compiled any as I do not own a mac or a linux machine, but that is on my list of things to do. If you need them asap, feel free to download the code and compile them yourself.
Online HeroesGraveDev

JGO Kernel


Medals: 300
Projects: 11
Exp: 3 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #8 - Posted 2013-05-04 08:33:14 »

Nah, was just wondering.

But why not cross-compile?

Offline Yoda12999

Senior Newbie


Medals: 2



« Reply #9 - Posted 2013-05-06 21:31:56 »

I am only a C++ programmer by necessity so I may not know of some tool, but from what I have read cross compiling is best avoided. That being said, I have worked tirelessly over the past few days to learn how to compile this properly on Linux. The libraries are within the zip file for public consumption.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Online HeroesGraveDev

JGO Kernel


Medals: 300
Projects: 11
Exp: 3 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #10 - Posted 2013-05-06 21:33:30 »

"A small chance of failure is better than no chance of success."

- Me, just then.

Offline deepthought
« Reply #11 - Posted 2013-05-07 22:49:33 »

just $100? Cool I want to get one of those and pair it with an Oculus rift, and maybe a Razer tiamat 7.1! that would make a relatively inexpensive VR system compared to what's out there.

jocks rule the highschools. GEEKS RULE THE WORLD MWAHAHAHA!!
captain failure test game
Offline Yoda12999

Senior Newbie


Medals: 2



« Reply #12 - Posted 2013-05-08 00:15:06 »

Well there is a video of that:
<a href="http://www.youtube.com/v/07IwxUD8N8E?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/07IwxUD8N8E?version=3&amp;hl=en_US&amp;start=</a>

Anywho, I should mention that pre-compiled Mac libraries will not be coming until I finish wrapping the remaining few classes as I do not have a Mac (at least one running a Mac OS) and I am avoiding the annoyingness that is compiling for Mac on linux as long as possible.
Offline Estraven

Junior Newbie





« Reply #13 - Posted 2013-08-21 07:13:11 »

Thanks for this wrapper, but i need some help.

Sixense.init() throws me

1  
Exception in thread "main" java.lang.UnsatisfiedLinkError: no sixense in java.library.path


Yet I included the libs like i always do: the jar and the DLLs (I'm using windows 8 / java 6) are in a "lib" directory and
the path is defined by -Djava.library.path=./lib/

1  
System.getProperties().getProperty("java.library.path")


prints "./lib/"

Any idea ?
thanks


Offline Yoda12999

Senior Newbie


Medals: 2



« Reply #14 - Posted 2013-08-30 15:35:13 »

Sorry to take so long to reply, starting school has eaten all of my time. Anywho, just to make sure none of the basics are being forgotten, do you have sixense.dll in your libs folder? I'm not entirely sure it matters, but it should be mentioned that the library was compiled with Java 7.
Offline Estraven

Junior Newbie





« Reply #15 - Posted 2013-08-30 15:41:47 »

No problem, thanks for replying

SixenseJava32.dll and SixenseJava64.dll both are in the "lib" folder. also, i tried with java 7. Still not finding the native lib.

Meanwhile, I've found a C++ software that streams the sensor data over UDP, not optimal, but good enough for now...


OK I get it. It's looking for sixsens.dll that was provided with the Razer drivers....

now my path is set to " ./lib;C:/Program Files (x86)/Razer/Hydra "
but i get another exception...

1  
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Program Files (x86)\Razer\Hydra\sixense.dll: Can't find dependent libraries


Smiley
Offline Yoda12999

Senior Newbie


Medals: 2



« Reply #16 - Posted 2013-08-30 17:28:53 »

Don't use the libraries provided by Razer they are old and stupid. Go download the newer ones from Sixense's website and plop those next to the wrapper so that it looks like this:
1  
2  
3  
4  
5  
6  
7  
lib/
    - sixense.dll
    - sixense_utils.dll
    - SixenseJava32.dll
    - sixense_x64.dll
    - sixense_utils_x64.dll
    - SixenseJava64.dll
Offline Estraven

Junior Newbie





« Reply #17 - Posted 2013-08-30 18:17:10 »

I tried the dll from the motion creator 2. I tried the dlls from the latest Razer SDK....
nothing works........
Offline hidden_for_ages

Junior Newbie





« Reply #18 - Posted 2014-02-03 09:07:53 »

I'm also keep trying with every possible combination of dll's and nothing is working. Up to date, Sixense created two versions of drivers for Hydra (1.00 and 1.01), and one comes from Razer, so it's a kind of mess now. It would be nice if someone with working code upload package with all necessary drivers (in my case win32 ones). It would be a great help. Thanks in advance Smiley
Offline Estraven

Junior Newbie





« Reply #19 - Posted 2014-02-03 14:58:18 »

yeah,
I gave up on this one. I used a OSC streamer software that streams the hydra sensor values into a UDP localhost socket.
Not the best way, but the only way i could make it work.
That's really disapointing.
Offline hidden_for_ages

Junior Newbie





« Reply #20 - Posted 2014-02-03 16:26:04 »

I see... Actually, I did a same thing before to send data from Wiimote to Java - send data over UDP socket via GlovePIE and receive it in Java application. Thought that maybe this time it'll be much easier, but maybe I'll try to do same thing to Hydra or just write wrapper from scratch. Thanks for response in topic.
Offline Yoda12999

Senior Newbie


Medals: 2



« Reply #21 - Posted 2014-02-03 18:32:55 »

I'm sorry that it seems that so many people are having trouble with my wrapper. I haven't had much time to work on this project, but I'll recompile everything and try it on a few untested computers to try to reproduce the problem.
Offline hidden_for_ages

Junior Newbie





« Reply #22 - Posted 2014-02-04 08:49:30 »

Thanks for all your time you give this project and being interested in current problems. I'm very glad and hope that someday even more people will use Hydra in Java language. In fact, the real problem isn't your wrapper but many configurations that came up to day, creating a small mess with compatibility. Hope everything will work once again.
Offline Yoda12999

Senior Newbie


Medals: 2



« Reply #23 - Posted 2014-03-04 00:28:19 »

I have tested the library with newly downloaded libraries from Sixense and have found everything to be working. So far I have only been able to test on Windows machines but I will soon test on Linux and Mac machines as well. I have added detailed instructions on how to place the native libraries to the Readme on the GitHub and have included a test program that outputs the position and rotation of the controllers to stdout. To use the built in test program just run java -jar SixenseJava.jar in the command line with all native libraries placed in the same directory.
Offline elect

Junior Devvie





« Reply #24 - Posted 2014-08-21 16:13:46 »

Someone got it working?

I have the same exception

Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\elect\Documents\NetBeansProjects\Sixense-Java\sixense_x64.dll: Can't find dependent libraries
Offline elect

Junior Devvie





« Reply #25 - Posted 2014-08-22 18:02:32 »

Little step forward

I was using java 8 64b, switched to 32b I can load something but then I always get the exception

Quote
run:
Initializing...
sixense loaded
sixense_utils loaded
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\elect\Documents\NetBeansProjects\Sixense_Java\SixenseJava32.dll: Can't find dependent libraries
   at java.lang.ClassLoader$NativeLibrary.load(Native Method)
   at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1929)
   at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1847)
   at java.lang.Runtime.loadLibrary0(Runtime.java:870)
   at java.lang.System.loadLibrary(System.java:1119)
   at com.sixense.Sixense.<clinit>(Sixense.java:31)
   at com.sixense.SixenseJavaTest.<init>(SixenseJavaTest.java:23)
   at com.sixense.SixenseJavaTest.main(SixenseJavaTest.java:17)
Java Result: 1
Offline elect

Junior Devvie





« Reply #26 - Posted 2014-08-22 22:36:42 »

Soooooooooooolved, I cant believed it..

I had to install the http://www.dependencywalker.com/ to detect the damned missing libraries...

- I also had to install the following

Redistributable Packages for Visual Studio 2010 x86
Redistributable Packages for Visual Studio 2010 x64
Redistributable Packages for Visual Studio 2012 x86
Redistributable Packages for Visual Studio 2012 x64
adding Internet Explorer path in the PATH environment variable

That tool saved my life, I got the x64 version working like a charm..
Pages: [1]
  ignore  |  Print  
 
 

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

toopeicgaming1999 (72 views)
2014-11-26 15:22:04

toopeicgaming1999 (61 views)
2014-11-26 15:20:36

toopeicgaming1999 (15 views)
2014-11-26 15:20:08

SHC (29 views)
2014-11-25 12:00:59

SHC (27 views)
2014-11-25 11:53:45

Norakomi (32 views)
2014-11-25 11:26:43

Gibbo3771 (27 views)
2014-11-24 19:59:16

trollwarrior1 (40 views)
2014-11-22 12:13:56

xFryIx (78 views)
2014-11-13 12:34:49

digdugdiggy (56 views)
2014-11-12 21:11:50
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!