Make a Motion - northern-bites/nbites GitHub Wiki

All of our kicks and the two standups are "SweetMoves," the Northern Bites name for scripted motions. What this means is that they are simply tuples of tuples of joint angles. That is, we specify exactly what angle each joint should have for every important stage of a complex motion. These lists can be found in behaviors/SweetMoves.py. They take the following form:

((LShoulderPitch, LShoulderRoll, LElbowYaw, LElbowRoll),
(LHipYawPitch, LHipRoll, LHipPitch, LKneePitch, LAnklePitch, LAnkleRoll),
(RHipYawPitch, RHipRoll, RHipPitch, RKneePitch, RAnklePitch, RAnkleRoll),
(RShoulderPitch, RShoulderRoll, RElbowYaw, RElbowRoll),
interpolation_time, interpolation, stiffness)

Some tips:

  • You can have the robot print out its current joint angles while you are building a move by positioning its limbs in the way you want it and then pressing the chest button 5 times.
  • Look at the Aldebaran documentation for joint angles. All of the angles specified above should make sense. If you don't know the login for this site, ask.
  • Interpolation time specifies how long the motors can take to get the robot to this specified position. Short motions can take less than a second, while longer or careful motions could take a couple of seconds.
  • Interpolation can be 1 (smoothed) or 0 (linear). Test these out to see what they do.
  • Stiffness specifies how much "give" the joints should have. Normal is usually okay.

Your Assignment

Make the robot dance! This is an example of a robotic interpretation of the macarena. Either create your own version of the macarena or find another fun dance and implement it with joint angles.

See the joint angles for the dance in the video here.

Caveat: Weird joint angles are a very good way to break robots. Please be careful that the joint angles you choose are possible without straining the Nao's motors.

How to test your motion

We have a player called pKicker (located in nbites/src/man/behaviors/players/pKicker.py) that we use for testing individual SweetMoves. Open the player's states file (located in nbites/src/man/behaviors/players/KickerStates.py) and edit the appropriate line in the 'kick' state like so: player.executeMove(SweetMoves.NAME-OF-YOUR-NEW-MOTION-HERE)

Then, save the file and install pKicker to the robot in nbites/src/man by cd-ing to this directory and using the command make cross