-
Notifications
You must be signed in to change notification settings - Fork 442
Open
Description
Hello, I am trying out leapjs. I have installed the Leap Motion software already and I confirmed that it worked correctly and validly from the the Diagnostic Visualizer of the Leap Motion Control Panel. I have also placed all the files from this repository into my local directory.
However, when I run node leapjs.js, all I got is these:
$ node leapjs.js
Waiting for device to connect...
received 0 frames @ 0fps
received 0 frames @ 0fps
received 0 frames @ 0fps
received 0 frames @ 0fps
...
So could you please tell me what went wrong?
Here is what inside leapjs.js:
const Leap = require('leapjs');
Leap.loop(function(frame){
console.log(frame.hands.length);
});
var controller = new Leap.Controller()
controller.on("frame", function(frame) {
console.log("Frame: " + frame.id + " @ " + frame.timestamp);
});
var frameCount = 0;
controller.on("frame", function(frame) {
frameCount++;
});
setInterval(function() {
var time = frameCount/2;
console.log("received " + frameCount + " frames @ " + time + "fps");
frameCount = 0;
}, 2000);
controller.on('ready', function() {
console.log("ready");
});
controller.on('connect', function() {
console.log("connect");
});
controller.on('disconnect', function() {
console.log("disconnect");
});
controller.on('focus', function() {
console.log("focus");
});
controller.on('blur', function() {
console.log("blur");
});
controller.on('streamingStarted', function() {
console.log("streamingStarted");
});
controller.on('streamingStopped', function() {
console.log("streamingStopped");
});
controller.on('deviceStreaming', function() {
console.log("deviceStreaming");
});
controller.on('deviceStopped', function() {
console.log("deviceStopped");
});
controller.connect();
console.log("\nWaiting for device to connect...");
I am just starting out this, so any help is appreciated. My node's version is v8.12.0.
Metadata
Metadata
Assignees
Labels
No labels