Javadoc link

This service will use the hand tracking capabilities of the Leap Motion device with the power of the SDK v2.

leapmotion gif

In order to get it working properly :

1) Install the LeapMotion Software from here : 
Windows: https://www.leapmotion.com/setup 
Linux :
sudo dpkg --install Leap-2.3.1+31549-x64.deb
sudo leapd

2) Install and start the LeapMotion service from the MyRobotLab Runtime tab (just like you do with the other services ) MRL VERSION 1.1.1045 or higher 

References:

Example code (from branch develop):
leap = runtime.start('leap','LeapMotion')
 
python.subscribe('leap', 'publishLeapData')
 
def onLeapData(data):
    # print(data)
    leftHand = data.leftHand
    rightHand = data.rightHand
    if leftHand:
        print("left",leftHand.thumb, leftHand.index, leftHand.middle, leftHand.ring, leftHand.pinky)
    if rightHand:
        print("right",rightHand.thumb, rightHand.index, rightHand.middle, rightHand.ring, rightHand.pinky)

mryosoo

9 years 2 months ago

Hey man! nice work on the leap motion. I just want to ask. If i want to do it in a python script only with no myrobotlab, what will i modify with the code?

laia

8 years 7 months ago

Hello,

how can I get the angles that the leap motion is setting to the servos? I can't find documentation of how the function inmoov.rightHand.startLeapTracking() works.

What I need is to do something like this:

inmoov.rightHand.index.write(leapmotionAngleIndex).
 
Thank you!
Example configuration (from branch develop):
!!org.myrobotlab.service.config.LeapMotionConfig
leftIndex:
  maxIn: 180
  maxOut: 180
  minIn: 0
  minOut: 0
leftMiddle:
  maxIn: 180
  maxOut: 180
  minIn: 0
  minOut: 0
leftPinky:
  maxIn: 180
  maxOut: 180
  minIn: 0
  minOut: 0
leftRing:
  maxIn: 180
  maxOut: 180
  minIn: 0
  minOut: 0
leftThumb:
  maxIn: 180
  maxOut: 180
  minIn: 0
  minOut: 0
listeners: null
peers: null
rightIndex:
  maxIn: 180
  maxOut: 180
  minIn: 0
  minOut: 0
rightMiddle:
  maxIn: 180
  maxOut: 180
  minIn: 0
  minOut: 0
rightPinky:
  maxIn: 180
  maxOut: 180
  minIn: 0
  minOut: 0
rightRing:
  maxIn: 180
  maxOut: 180
  minIn: 0
  minOut: 0
rightThumb:
  maxIn: 180
  maxOut: 180
  minIn: 0
  minOut: 0
type: LeapMotion