Program NAO Robot Instruction

NAO Tutorial:

http://robotica.unileon.es/mediawiki/index.php/Nao_tutorial_1:_First_steps

Nao Programming Guide:

http://doc.aldebaran.com/1-14/dev/index.html

Choregraphe User Guide (a simulator for NAO)

http://doc.aldebaran.com/1-14/software/choregraphe/

Python:

Here is a link to download and install Python 2.7.6, which is the version we will be using

https://www.python.org/download/releases/2.7.6/

NaoQI:

NaoQI for Python:
http://doc.aldebaran.com/1-14/ref/python-api.html

NaoQI for C# (.Net)
http://doc.aldebaran.com/1-14/dev/dotnet/index.html

Pycharm (Python IDE):
This is not necessary, but suggested.

http://www.jetbrains.com/pycharm/

Pycharm is pretty easy to start up. Just pick all the default settings and start a new project. There you can create python files and start writing code. The run tab is at the top of the page.

Webots:

You can use this to simulate a robot of your own.

http://www.cyberbotics.com/download

While it is downloading, make an account. After you login, activate the 30 day trial.

Once you do that you can install the program and register it for full access. No special configuration is needed, just start webots and boom, you have a fully functional Nao robot listening on port 127.0.0.1

Installing the NaoQI

The NaoQI API allows you to remotely access the modules on the robot. The Python version (pynaoqi-python-2.7-naoqi-x.x.win32.exe) or the C# version (.Net) can be found here community.aldebaran-robotics.com

Quick start: C#

Some of you are probably familiar with Visual Studio. Install the .Net SDK and start a new project. Go to the solution explorer and right click references. Navigate to Browse and add naoqi-dotnet4.dll (C:\Program Files (x86)\Aldebaran\NAOqi.Net 1.14.1.16)

import the library

using Aldebaran.Proxies;

The IP should be set to the IP of the Nao Robot, this means that your program should include a prompt or field where your user can input the Nao’s IP. The IP can be found by briefly pressing the chest button. the number 9559 is the default port we should be listening at.

string IP = “127.0.0.1”

TextToSpeechProxy tts = new TextToSpeechProxy( IP , 9559);

MotionProxy motion = new MotionProxy( IP , 9559);

Quick start: Python

import the module (library)

from naoqi import ALProxy

IP = “127.0.0.1”

tts = ALProxy(“ALTextToSpeech”, IP, 9559)

motion = ALProxy(“ALMotion”, IP, 9559)

What is tts and motion?

We’ve named our TextToSpeechProxy and MotionProxy, motion and tss respectively. These are two of several modules that run on the Nao Robot. TextToSpeechProxy is used to make the robot speak, and MotionProxy is used to move the robot’s limbs. There are other more specialized modules that relate to movement, such as RobotPostureProxy, but for now MotionProxy should be all we need.

Useful Functions:

The functions are generally the same for C# and Python, and are members of our proxy class objects ( tts and motion ).

eg.

tts.say( “Hello, World” )

motion.post.angleInterpolation(  [“HeadYaw”], [1.0, 0.0], [1  , 2], False )

“HeadYaw” refers to the part of the body to be moved, other examples might be “Head” or “Body”. Both of these functions above are normally blocking calls, such that they pause the execution of code until the action is complete. The addition of .post before the function calls a non-blocking version of the code.

Other useful functions:

motion.getAngles()

motion.setAngles()

Essential Functions

motion.setStiffnesses(“Body”, 0.0);

motion.setStiffnesses(“Body”, 1.0);

These set the stiffness of the robot to NONE to FULL respectively. It is important to set the stiffness COMPLETELY OFF ( 0.0 ) after the execution of your code. It is also important to turn it on, at least for one of the joints such as “RArm” in order for the Nao’s motors to work.

Full Nao Simulator

The webots simulator allows you to run a virtual nao robot that you can connect to with NaoQI or Choreograph

www.cyberbotics.com/download

Leave a Reply

Your email address will not be published. Required fields are marked *