Getting started with the NAO robot - utwente-interaction-lab/interaction-lab GitHub Wiki

Getting started with the NAO robot

NAO is a small humanoid robot, often used in commercial and educational settings. It has a lot of degrees of freedom in its body and limbs, making it ideal for complex animations and gestures. Although its face cannot display facial expressions, people have had some success using body poses, gaze, eye colours to convey emotions and robot states.

The NAO robot is programmed through a graphical editor "Choregraphe", which also includes a built in virtual version of the robot. The main developer website by Aldebaran and Softbanks contains a wealth of information on using and programming the robot. Here, we focus on the basics to get you started with your own project.

Installing Choregraphe

Go to the main documentation page for NAO and go to the download page for your operating system: https://www.aldebaran.com/en/support/nao-6/downloads-softwares

images/nao/download.png

Scroll down and download the latest Choregraphe Setup (2.8.x)

images/nao/download-2.png

Install the downloaded file (the default settings should be fine). You may see images of other robots like Pepper being used during the installation process, this is normal.

images/nao/installation.png

Launch Choregraphe after installation. You may get several popups from your firewall, make sure you allow all programs access on the network (e.g. qilaunch.exe, naoqi.exe, choregraphe-bin.exe). If you don't do this, Choregraphe will not work correctly and you will need to manually update your firewall rules later (or disable it)!

images/nao/firewall.png

If you are not connected to a real, physical NAO robot, you may get a connection error. Just click OK to ignore this for now.

images/nao/connection-error.png

Working with Choregraphe

Choregraphe is a visual flow-diagram editor. You program your robot by linking together a series of action boxes to form the logic of your interaction.

During corona times, working with a physical NAO is not possible. Instead, you can use the built-in virtual NAO. There are some limitations you must keep in mind when using the virtual NAO:

  • It can not be easily distributed as part of an online experiment, instead you should create interactive videos and distribute them to your participants or users (for example, using H5P software).
  • It does not support speech synthesis. Instead, you can use an external text-to-speech engine to generate speech audio files, and edit this into your interactive video (for example, Google text-to-speech or Amazon Polly to name a few)
  • It (obviously) does not support any sensors like touch, or microphones for speech recognition. If doing a live interaction with the virtual robot, you can fake the sensor input by directly remote controlling the robot's responses. Or in the case of an interactive video, you can offer the user multiple-choice selections for providing user input.

When Choregraphe has started, you will see an empty project.

images/nao/new-project.png

It might be necessary to configure to use a (virtual) NAO robot, instead of the default Pepper robot. Go to Edit -> Preferences in the menu bar and click on tab Virtual Robot and select NAO H25 (V6) and press OK. Press OK again if you are asked to restart the robot. If you choose to use a virtual robot, please keep in mind that not all functions are accessible, such as object recognition or age estimation.

images/nao/select-virtual-robot.png

Click on Connection -> Connect to virtual robot from the menu bar. You should now see a virtual version of the NAO appear in the Choregraphe editor.

images/nao/connect-virtual.png images/nao/connected.png

Connecting to a physical NAO

If you want to use the physical Nao, start by removing the hatch on back of the head of Nao to plug the ethernet cable. Connect the other end to your router or laptop. Press the center button on Nao's chest to have him tell you its IP-address. Enter this in the search bar of your browser to access Nao's Web page. It will ask you for a user name and passowrd.

images/nao/connect-physical.png

If they haven't been set before, the default is 'nao' for both input boxes. If you enter the right credentials, you will access Nao's Web page where you can adjust some settings, such as its language, volume or connect it to the Wi-Fi. If the Nao has not been configured before, please use configuration guide provided by Aldebaran.

images/nao/connected-physical.png

To connect your Nao to the Wi-Fi (which is strongly recommended when Nao is supposed to move), press the global icon. Tap on the Wi-Fi network that you would like to connect to and if necessary, enter the credentials. Click the 'Connect' button. If you have succesfully connected to the network, you can remove the ethernet cable and continue working without it.

images/nao/connected-wifi.png

Now move to Choregraphe and click 'Connection -> Connect to...' and select your Nao.

Start programming Nao

Make your first program by letting NAO dance. First, in the Box libraries area, navigate to Entertainment -> Dances -> NAO and drag the Disco dance to the main editor canvas. It now appears as an action box that you can use in the flow of your program. The 'Box libraries' area contains folders with pre-programmed actions grouped according to their functions. For example, the movement folder consists of actions to make Nao move or switch position. It is also possible to create your own box library using the 'new box library' button. Box libraries are especially useful for repetitvely used actions.

images/nao/add-dance.png

Then you must connect this action box to the flow of the program, by connecting its onStart trigger to the main onStart. Do this by dragging a line from the top-left play icon in the main editing canvas to the play icon in the Disco action. If there's no follow-up action, you can also connect the 'onStopped' trigger to the main 'onStopped' on the top-right of the screen.

images/nao/connect-dance.png

Some action boxes allow you to adjust parameters. In order to see the default parameters or adjust them, click the tool on the bottom-left of the box. A window will open that shows you the paramaters available for that action to adjust.

images/nao/adjust-parameters.pngimages/nao/adjust-available-parameters.png

By double-clicking an action box, you will open the script editor or a timeline window. This depends on which action you double click. Animations will open a timeline screen, while logics and the like open the script editor.
The script editor allows you to adjust the code to your wishes. The timeline screen enables you to create your own animations as well. If you would like to learn more about how to create animations, please visit the reference provided at the bottom of this page.

Now play your script by pressing the play button in the main toolbar or by pressing F5. You should see the virtual robot performing a dance.

images/nao/play.png images/nao/dancing.png images/nao/dancing.gif

Next steps

Head over to the official documentation for more details on moving the robot's joints and creating and editing animations. In case you prefer watching videos over reading, this playlist hepls you through the basic principles of programming Nao using Choregraphe.

While editing animations it may help to turn autonomous life off.

images/nao/autonomous-life.png