Last year, I assembled a roboruku , wrote a “driver” for linux for her, taught me how to hold different objects. And somehow forgot about it. But yesterday I was given a leap motion and I came up with a new idea - to learn how to control a roboruk by means of movements of my hands.
What you need to manage
Roboruki has:
base - can rotate clockwise and counterclockwise;
shoulder - move up and down;
elbow - move up and down;
wrist - move up and down;
claws - open and close.
For all this, the "driver" provides a simple api:
from roboarm import Arm arm = Arm() arm.base.rotate_clock(3) arm.elbow.up(1) arm.grips.open(2)
First implementation
')
Leap motion can detect hands , fingers and their direction. Therefore, I decided to tie the movement to the fingers:
Part roboruki
My hand
Number of fingers
Axis
Base
Right
4 or 5
X
Shoulder
Left
4 or 5
Y
Cubit
Right
2 or 3
Y
Wrist
Any
one
Y
Claws
Left
2 or 3
X
Nothing happened. Leap motion correctly determined when there are 1-2 fingers on a hand, but when it is greater, a random value from 1 to 5.
Second implementation
Leap motion gives the coordinates of the hands within certain limits, I have about -200 to 200 on X and from 0 to 400 on Y. I divided this area into ten equal parts and attached actions to them: