Hi, I'm new to developing on Leap Motion and I'm currently using the leapJS to do some initial tests on a web browser. I can detect hands and get all the data from the leap motion, but I'm having trouble with the gestures.
I'm initializing the controller with enableGestures:true but when I process the frame, accessing the gestures object, I get an undefined. Indeed, when printing the frame object there is no 'gestures' property. This is the most basic code, copied and pasted from the examples something like:
var controller = Leap.loop({enableGestures: true}, function(frame){
if(frame.valid && frame.gestures.length > 0){
frame.gestures.forEach(function(gesture){
switch (gesture.type){
case "circle":
console.log("Circle Gesture", gesture);
break;
case "keyTap":
console.log("Key Tap Gesture");
break;
case "screenTap":
console.log("Screen Tap Gesture");
break;
case "swipe":
console.log("Swipe Gesture", gesture);
break;
}
});
}
})
But I get the error Cannot read property 'length' of undefined on the frame.gestures.length line. I read the documentation and it seems to be correct, what am I missing? Sorry for the really basic question but I'm kind of stuck with this. Thanks!