leap motion

Hello!!

 

ive been a bit out of picture but now im back!!! 

Im at the moment trying to use leap motion to control the myrobotlab! does anyone have a clue on how to do it? i know have been done in the past!

 

Even if it doesnt work anymore with the changes on MRL what is the best way to implement information from an outside source (leap) into maybe the python interface? Could someone throw me a hint <) thanks alot

 

Pedro


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kwatters's picture

small sample script

 
It's not a very good example script. but it does show getting data from the leap motion:
 https://github.com/MyRobotLab/pyrobotlab/blob/master/service/LeapMotion2.py
 
Here's a link to a youtube video i did using the leap motion to control the position of the inmoov hand by using inverse kinematics to control the hand position in space.
 
https://www.youtube.com/watch?v=MAY_n_OBuVo
 
hope this helps!  
 
 
pedro's picture

this is where i got so far

this is where i got so far thanks to kwatters!! but is giving some erros

 

 

from com.leapmotion.leap.Finger import Type
# from __future__ import division

#####################################################
#
# this simple script will print in the python tab the grab strength
# of your left hand
#
# LeapMotion finger types are defined
# as the following:
# Type.TYPE_THUMB
# Type.TYPE_INDEX
# Type.TYPE_MIDDLE
# Type.TYPE_RING
# Type.TYPE_PINKY

leap = Runtime.createAndStart("leap","LeapMotion")

leap.addLeapDataListener(python)

def onLeapData(leapData):
 
 leftThumbAngle = leapData.leftHand.index

 print leftThumbAngle
 

leap.startTracking()