arms and hands API examples

ATTENTION!!! When planning arm movements or gesture positions, please pay attention not to hit the robot torso or both hands together. You can make sure that the gesture will not cause a collision by programming only a fraction of the gesture at a time and using slow movements. You should ALWAYS use MovePosition(...) function, which is using trajectory generators. Using direct joint value slot (val) without trajectory generator, motor will achieve the position as fast as it can. You should avoid such situations it may damaged arms or their drive mechanism.

Always start new, NO previously tested gesture from arms zero-position. If you wan to achieve by left arm following position:

  • q1 = 70 deg.
  • q2 = 75 deg.
  • q3 = 60 deg.
  • q4 = 100 deg.
  • q5 = 0 deg.

in 3s you can use this function:

robot.body.arm[left].hand.MovePosition(3s, 70, 75, 60, 100, 0);

If you are not sure that it is safe position start from small step:

robot.body.arm[left].hand.MovePosition(3s, 20, 20, 20, 20, 0);

then

robot.body.arm[left].hand.MovePosition(3s, 40, 40, 40, 40, 0);

finally

robot.body.arm[left].hand.MovePosition(3s, 70, 75, 60, 100, 0);

 

Ready to use functions with preprogrammed safe positions

Move both arms:

robot.body.arm.MoveCenterDown(3s);
robot.body.arm.MoveCenterDown2(3s);
robot.body.arm.MoveCenterCenter(3s);
robot.body.arm.MoveCenterUp(3s);

Move left arm:

robot.body.arm[left].MoveCenterUp2(3s);
robot.body.arm[left].MoveCenterUpper(3s);
robot.body.arm[left].MoveFrontCenter(3s);
robot.body.arm[left].MoveFrontUp(3s);

Move right arm:

robot.body.arm[right].MoveFrontDown(3s);
robot.body.arm[right].MoveSideUp(3s);
robot.body.arm[right].MoveSideSide(3s);
robot.body.arm[right].MoveSideDown(3s);

Stop arms:

robot.body.arm.Stop();

Set both hands to the position:

// set all finger positions (using smooth trajectiory generators) 
// f - finger, q - joint
robot.body.arm.hand.MovePosition(time, 0,0,0,
                                     140,120,0,
                                     140,120,0,
                                     140,0,0,);

Set left hand orientation (20 deg., 20 deg.)

robot.body.arm[left].hand.MoveOrientation(1s, 20,20);

 

 

EMYS and FLASH are Open Source and distributed according to the GPL v2.0 © Rev. 0.9.1, 15.05.2017

FLASH Documentation