Nao Motion Tutorial - Playing and Recording

Playing Animations and Setting Posture

  1. First, import the necessary functions from the SIC framework:

from sic_framework.devices import Nao from sic_framework.devices.common_naoqi.naoqi_motion import NaoPostureRequest, NaoqiAnimationRequest
  1. Connect to the Nao (computer must be connected to the same network)

nao = Nao(ip="NAO_IP_HERE")

  1. Set posture or play animation

  • To set the posture:

    • Second argument is the speed (NOTE: setting the speed too high may result in an error)

nao.motion.request(NaoPostureRequest("Stand", 0.5))
  • To play an animation:

If you are playing a standing animation, make sure you put the Nao in a standing posture beforehand

nao.motion.request(NaoqiAnimationRequest("animations/Stand/Gestures/Hey_1"))

A list of all Nao animations can be found here.

A complete script for this tutorial can be found here: demo_nao_motion.py

Recording and Playing Custom Animations

  1. First, import the necessary functions from the SIC framework:

  1. Connect to the Nao (computer must be connected to the same network)

nao = Nao(ip="NAO_IP_HERE")

  1. Specify which Nao parts you want to record (NOTE: a ‘chain’ is a group of body parts, or a link of joints):

    1. The full list can be found here

  1. Set the stiffness of these parts to 0 so that you can move them

  1. Start the recording

    1. Set a ‘record_time' variable. This is how long it will record the Nao’s motion before saving it.

    2. It is recommended to include a message to indicate when to start moving the Nao

  1. Save the motion, give it a name

  1. Play the recording back

    1. Set the stiffness of the limbs to 0.7 so that the motors can move them

A complete script for this tutorial can be found here: demo_nao_motion_recorder.py