MyoJS
MyoJS copied to clipboard
'Pose' not kept, only recognized in one frame
Hi there, First of all, a big thanks for this, too (I have been using your leap motion as3 library, good stuff).
I am having some troubles with the 'pose', seems like a gesture is recognized but it is never "kept" despite maintaining the gesture: hub.on('frame', function(frame) { var e = document.getElementsByTagName("p")[0]; e.innerHTML = "Frame id: " + frame.id + ", timestamp: " + frame.timestamp + ", pose: " + frame.pose; //this blinks when the gesture happens, correctly shows the gesture for a tiny moment }); ... hub.on('pose', function(pose) { var e = document.getElementsByTagName("p")[0]; e.innerHTML = pose; //this does exactly the same thing as the code above, only flashes the gesture, then it shows [Pose invalid] });
So what I do see is [Pose invalid], then it flashes [Pose type:4 POSE_FINGERS_SPREAD] and gets back to [Pose invalid] while still keeping my fingers open. The Visualizer in the daemon shows it correctly: the cube is yellow till I close/move my fingers. The gestures.html from your examples works the very same way as my test, basically can't do anything with the flamingo. Any ideas? Should I just wait for a POSE_SOMETHING => save it to a var and then reset it when POSE_NONE occurs? Is that the (correct) way?
Hi Thanks! Yes, this is a state issue. As you say, when the gesture is triggered - the event will be emitted once (and only in that "frame"). The problem is that (as far as I know), the Myo APIs do not emit any gesture states such as start/update/stop. This will have to be built/determined into the MyoJS library, and will look into this!
BR, Victor