nicholasastuart / myo-java Goto Github PK
View Code? Open in Web Editor NEWJava API for Thalmic's Myo Device
License: Apache License 2.0
Java API for Thalmic's Myo Device
License: Apache License 2.0
The method Quaternion.conjugate() returns a Quaternion with all four(!) coordinates multiplied by -1. The real part should not be changed, though. (If the method is intended to do the quationion conjugation.)
Hi,
we are using version 0.9.1 on mac OSX Yosemite 10.10.5 and we are running the HelloMyo example but the onPose method does not get called when doing poses, it always prints "REST"
Hey thank you very much for the libraries controlling the Myo. I'm doing a project creating sound from the movements of a dancer. Without your work I would not be able to pull it off personally.
I found an issue though. For me setting the LockType did not work properly. The UNLOCK_TIMED did not do anything and the UNLOCK_HOLD seems to work like UNLOCK_TIMED.
I created a workaround by changing the ENUM.
public enum UnlockType {
UNLOCK_NULL,
UNLOCK_TIMED,
UNLOCK_HOLD
}
For some reason this works for me. UNLOCK_TIMED and UNLOCK_HOLD both react properly now. Maybe something to look into?
Best,
Maarten Zaagman
Hi Nicholas,
I want to check if MyoConnect is up and running before I use it in my program.
To do that, I catch RuntimeException in initialization the new Hub() and tell user to turn on MyoConnect.
The error occurs when I initiate new Hub() again.
It cannot access myo64.dll, because it is still being used from the first, not complete, initialization. Whether is MyoConnect on or off.
Could you tell me the right way how to achieve my plan? Or can it be corrected somehow?
Thank you for your response :)
Richard
Dear Nicholas,
I'm hoping you can help me. I'm trying to connect 2 myo's to my Mac and use them to generate sound for a theatreproduction. I'm looking for a way to identify the myos on connecting and I would like to identify them by MAC adress. I see this is possible in the 0.10.0 Android SDK but not yet for your library.
Could you tell me if you have any plans to implement that feature?
I'm looking forward to your reaction.
Best,
Maarten
Hi there, I'm using your example to study how to extract EMG Data from Myo. I just copy the whole project and put in specified place in workspace. It seems I cant even run the project. I get this error:
Unable to load myo64 from system directories.
Unable to load myo32 from system directories.
Error:
java.lang.NullPointerException
at java.util.Objects.requireNonNull(Unknown Source)
at java.nio.file.Files.copy(Unknown Source)
at com.thalmic.myo.Hub.copyAndLoadX64FromTemp(Hub.java:187)
at com.thalmic.myo.Hub.loadJniResources(Hub.java:67)
at com.thalmic.myo.Hub.(Hub.java:27)
at com.thalmic.myo.example.EmgDataSample.main(EmgDataSample.java:11)
Is it because im not placing the resources at the right place? Please guide me sir.
My system using Windows 7, Eclipse Mars v4.5
Java version:
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
I'm having issues loading the library on Windows 7 (64 bit) (running Myo 0.8.1). FYI, I've also tested this in a 32-bit environment. I receive the following error message:
Unable to load myo64 from system directories.
Unable to load myo32 from system directories.
Unable to load myo64.dll from directory C:\Users\ENCOUN~1\AppData\Local\Temp.
java.lang.UnsatisfiedLinkError: C:\Users\Encounters\AppData\Local\Temp\myo64.dll: Can't load AMD 64-bit .dll on a IA 32-bit platform
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(Unknown Source)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at com.thalmic.myo.Hub.copyAndLoadX64FromTemp(Hub.java:185)
at com.thalmic.myo.Hub.loadJniResources(Hub.java:81)
at com.thalmic.myo.Hub.<init>(Hub.java:25)
at com.thalmic.myo.Hub.<init>(Hub.java:20)
at MyoOSC.setup(MyoOSC.java:92)
at java.lang.Thread.run(Unknown Source)
Unable to load myo32.dll from directory C:\Users\ENCOUN~1\AppData\Local\Temp.
A library relies on native code that's not available.
Or only works properly when the sketch is run as a 64-bit application.
Can you clarify how this issue can be solved? I must also note, similar to the loading issue on Mac (#5), files seem to be physically copied to the TEMP folders.
Thanks!
Hallo, I have the exeption:
Unable to load myo64 from system directories.
Unable to load myo32 from system directories.
Unable to load myo64.dll from directory C:\Users\Alex\AppData\Local\Temp.
java.lang.UnsatisfiedLinkError: C:\Users\Alex\AppData\Local\Temp\JNIJavaMyoLib64.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.thalmic.myo.Hub.copyAndLoadX64FromTemp(Hub.java:194)
at com.thalmic.myo.Hub.loadJniResources(Hub.java:67)
at com.thalmic.myo.Hub.(Hub.java:27)
at com.thalmic.myo.example.HelloMyo.main(HelloMyo.java:16)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
Unable to load myo32.dll from directory C:\Users\Alex\AppData\Local\Temp.
java.lang.UnsatisfiedLinkError: C:\Users\Alex\AppData\Local\Temp\myo32.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform
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.thalmic.myo.Hub.copyAndLoadWin32FromTemp(Hub.java:222)
at com.thalmic.myo.Hub.loadJniResources(Hub.java:69)
at com.thalmic.myo.Hub.(Hub.java:27)
at com.thalmic.myo.example.HelloMyo.main(HelloMyo.java:16)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
Exception in thread "main" java.lang.UnsatisfiedLinkError: Could Not Load myo and myo-java libs
at com.thalmic.myo.Hub.loadJniResources(Hub.java:71)
at com.thalmic.myo.Hub.(Hub.java:27)
at com.thalmic.myo.example.HelloMyo.main(HelloMyo.java:16)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
The file "JNIJavaMyoLib64.dll" doesn't present in path "myo-java-master\src\main\resources\x64". If i change the line number 194 in Hub.java "System.loadLibrary("JNIJavaMyoLib64");" to "System.loadLibrary("JNIJavaMyoLib");" is the exeption still there.
Could you get the correct library?
Thanks in advance
Alexey
Nicholas,
I'm starting out with the myo on java. Got WIndows 10 and JDK 8 running, but i cant load the DLL's.
I specified the -Djava.library.path=c:\tmp and placed the 64 bit DLL's there. You know of any limitations on WIndows 10?
Below is the stack trace I have, Two thing i find strange, first the name of the JNI library, it ends with 64 (and yes did a copy with that name as well) ANd it tells me its not a valid Win32 application?
Suggestions.
(And no i do not have C compiler running :-) )
Unable to load myo64 from system directories.
Unable to load myo32 from system directories.
Unable to load myo64.dll from directory C:\XXX\Temp.
java.lang.UnsatisfiedLinkError: C:\XXXX\Temp\JNIJavaMyoLib64.dll: %1 is not a valid Win32 application
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1938)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1854)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at com.thalmic.myo.Hub.copyAndLoadX64FromTemp(Hub.java:194)
at com.thalmic.myo.Hub.loadJniResources(Hub.java:67)
at com.thalmic.myo.Hub.(Hub.java:27)
at com.thalmic.myo.example.HelloMyo.main(HelloMyo.java:16)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Unable to load myo32.dll from directory C:\XXXX\Temp.
java.lang.UnsatisfiedLinkError: C:\XXXX\Temp\myo32.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1938)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1854)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at com.thalmic.myo.Hub.copyAndLoadWin32FromTemp(Hub.java:222)
at com.thalmic.myo.Hub.loadJniResources(Hub.java:69)
at com.thalmic.myo.Hub.(Hub.java:27)
at com.thalmic.myo.example.HelloMyo.main(HelloMyo.java:16)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Exception in thread "main" java.lang.UnsatisfiedLinkError: Could Not Load myo and myo-java libs
at com.thalmic.myo.Hub.loadJniResources(Hub.java:71)
at com.thalmic.myo.Hub.(Hub.java:27)
at com.thalmic.myo.example.HelloMyo.main(HelloMyo.java:16)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Hello,
I was wondering if there is some system requirements to accomplish before running the example (Hello Myo).
I'm in a 64b Windows system, and working with JRE 1.7, but when trying to make it work, I had an exception "Can't load AMD 64-bit .dll on a IA 32-bit platform". I don't know what should I do.
What I find strange, is that my console shows :
-Unable to load myo64 from system directories.
-Unable to load myo32 from system directories.
So my system is not defined neither a 32 neither a 64 bits?
Can you please help me to fix that if you have any idea?
Hey Nicholas,
unfortunately, I am also getting issue #10
I am using Windows 10, downloaded this project and imported it with maven.
I downloaded the sdk version 0.9.0 and I am still getting the error about missing myo64:
Unable to load myo64 from system directories.
Unable to load myo32 from system directories.
Attempting to find a Myo...
Connected to a Myo armband!
[ ][ ][ ][?][REST ]
[ ][ ][ ][?][REST ]
[ ][ ][ ][?][REST ]
[ ][ ][ ][?][REST ]
Can you help us?
Kind regards,
Dustin
I will add support such that this library can work on OSX.
Hello Nicholas,
First of all thank you for the awesome effort. Second I want to check with you if it's up to date with the latest API version ?
It seems event onArmSync is not working in myo-java version 0.9.0
Environment: PC, Windows 7 enterprise, Eclipse.
Myo SDK version: Windows SDK 0.9.0 (Jun 10, 2015)
Myo Connect for Windows 1.0.1 (Sep 18, 2015)
Please check
I get this error.
Attempting to find a Myo...
Connected to a Myo armband!
A fatal error has been detected by the Java Runtime Environment:
EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000006259d22d, pid=7648, tid=7184
JRE version: Java(TM) SE Runtime Environment (8.0_65-b17) (build 1.8.0_65-b17)
Java VM: Java HotSpot(TM) 64-Bit Server VM (25.65-b01 mixed mode windows-amd64 compressed oops)
Problematic frame:
V [jvm.dll+0x14d22d]
Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
An error report file with more information is saved as:
C:\Users\SkycrawlerV3\workspace\Fesca\hs_err_pid7648.log
If you would like to submit a bug report, please visit:
http://bugreport.java.com/bugreport/crash.jsp
p/s: I only update the lib(.dll) without changing the whole code.
Hi,
I tried using your library on OS X and it kept giving me the following errors:
java.lang.UnsatisfiedLinkError: no myo in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1886)
at java.lang.Runtime.loadLibrary0(Runtime.java:849)
at java.lang.System.loadLibrary(System.java:1088)
at com.thalmic.myo.Hub.copyAndLoadOSXFromTemp(Hub.java:123)
at com.thalmic.myo.Hub.loadJniResources(Hub.java:60)
at com.thalmic.myo.Hub.<init>(Hub.java:24)
at com.thalmic.myo.example.HelloMyo.main(HelloMyo.java:25)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
Unable to load myo64.dll from directory /var/folders/r2/6sjpbgvn24g9smp_25jxmhqc0000gn/T.
Exception in thread "main" java.lang.UnsatisfiedLinkError: Could Not Load myo and myo-java libs
at com.thalmic.myo.Hub.loadJniResources(Hub.java:62)
at com.thalmic.myo.Hub.<init>(Hub.java:24)
at com.thalmic.myo.example.HelloMyo.main(HelloMyo.java:25)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
I dug a little deeper and found that the Hub.java class was going into the copyAndLoadOSXFromTemp method. Within this method, it was successfully copying the myo.framework and libmyo.jnilib files into java.library.path.
I evaluated this by observing the directory structure during runtime using this:
String property = System.getProperty("java.library.path");
StringTokenizer parser = new StringTokenizer(property, ";");
File f = new File(parser.nextToken());
for(File fi : f.listFiles()){
System.out.println(fi.getName());
}
But through all of that, it still gives the exception above.
Perhaps I'm doing something wrong or I missed a step? I'm relatively unfamiliar with System.getProperty to load properties, so I can't say for sure why it's failing to read the properties given.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.