Management roborukoy using leap motion





Last year I put together roboruku , wrote for her « driver » for linux, learn how to keep different items. And somehow forgot about it. But yesterday I brought leap motion and come up with a new idea - to learn to manage roborukoy by means of movements of his hands.

What you need to manage h4>
We have roboruki:

  • base - can be twisted clockwise and counter-clockwise;
  • shoulder - to move up and down;
  • elbow - move up and down;
  • wrist - move up and down;
  • claws - open and close.
     & lt; code class = & quot; python & quot; & gt; from roboarm import Arm arm = Arm () arm.base.rotate_clock (3) arm.elbow.up (1) arm.grips.open (2) & lt; / code & gt;  pre> 

    The first implementation h4>


    Leap motion can detect hands , fingers and their direction.
    So I decided to tie the motion of the fingers:

    Part roboruki th> My hand th> Number of fingers th> Axis th>
    Database Right 4 or 5 X
    Shoulder Left 4 or 5 Y
    Elbow Right 2 or 3 Y
    Wrist Any 1 Y < /
    Claws left 2 or 3 X It did not work. Leap motion correctly when the arm 1-2 finger, but when more - a random number from 1 to 5.

    The second implementation h4>

    Leap motion gives the coordinates of the hands within certain limits, I have about -200 to 200 X and from 0 to 400 with respect to Y. This is an area I've broken into ten equal parts, and tied them to action:

    Basis clockwise Leverage up Elbow up wrist up Open claws
    Basis counterclockwise Shoulder down Elbow down Wrist vvniz Close claws This realization was working = )

    What happened h4>
    Video result where roboruka trying to raise the box:



    A video where you can see hand movements better:



    Links h4>
    Roboruka owi robotic arm.
    Leap motion.
    «Driver».
    source code implementation.

    Source: habrahabr.ru/post/214613/