Connecting a NAO robot

The aim of this post is to control robots using TiVIPE software. A robot, a computer, a router or internet switch, and 2 ethernet cables are required. The document describes in short steps how these components are connected, started, and checked. In addition the steps needed to get check every connection and to get the software working properly within TiViPE are described.

Connecting the hardware

The following steps are useful to take

  1. Verify that router, computer, and robot are connected to a power supply.
  2. Take a short (3 meter) ethernet cable and connect one side to the computer and the other side to one of the yellow connectors of the router, see Figure 1a.
  3. Take a longer (7 or 10 meter) ethernet cable and connect one side to the robot (Figure 1b) and the other side to a yellow connector of the router.
  4. You might have disconnected your ethernet connection from your computer, since there was only one ethernet connection. If so, connect this one to the blue connection of the router. If not, disconnect the cable. In case an internet connection is required, you might want to connect it to the blue connection of the router. The blue connection is the so-called wide area network connection (WAN).
  5. switch on the router. Verify that the router is on (blinking leds).
  6. switch on your computer. Verify that the cable is properly connected, this can be seen by an illuminated or blink led on the router and usually on the computer just below the connected cable.
  7. switch on the NAO robot by pressing the chest button, and wait until the robot is ready. It says “On I gnuck” or so and the LEDs of the eyes are white-blue. This make take approximately one minute.

(a)router1
(b)nao ethernet

Figure 1: (a) A router (ASUS RT-N66U) At the left most position is the power supply, right to it is the power switch. The right most yellow colored connections are used to connect computer with a robot. The blue connection is used to connect the router to a wide area network (WAN) this is the connection used to the internet. (b) Head of the NAO robot. The hatch at the backside needs to be removed to be able to connect an ethernet cable to the robot.

Checking the connections

The connections are set up properly if computer and the robot which contains an ’embedded’ computer have obtained an internet address by protocol, the so-called IP address. Every computer in a computer network gets a unique address. Mostly it is used in a local network that often starts with 192.168.0.xxx, 192.168.1.xxx, or 192.168.2.xxx. where xxx is a number between 0 and 255. The router in Figure 1, has by default IP-address 192.168.1.1. The user can use a web browser to log on to the router and configure the router. Note it is handy to use a sticker with passwords at the bottom of the router. All machines connected to the router in that case start with 192.168.1.xxx.

Checking your computer

Under windows there are different ways to check the IP-address. One of them is to click the internet connection icon at the right bottom of the screen to verify if there is a connection, or right click the icon and ‘Open the network center’, Figure 2a. In this window retrieve information by clicking on the ‘Details’ button, Figure 2b. The connection details provide the ip address, Figure 2c.

(a)connection1
(b)connection2
(c)connection3

Figure 2: (a)Right clicking on the network icon at the bottom of the screen and slecting ‘Network and Sharing Center’ yields this window. (b) Connection status. (c) Network connection details provides the IP address.

Another approach is using the command line tool. To open the command window goto the ‘Windows’ start button and type

cmd

Select the cmd icon and right click the mouse to run ‘cmd’. In the command window type:

ipconfig /all

as illustrated in Figure 3.

(a)cmd1
(b)cmd2

Figure 3: (a) Start a command window. (b) the result of typing ipconfig /all. In the example the computer has ip-address 192.168.1.251.

Checking the robot

Press NAO chest button for a second or less. The robot will provide information by saying name, ip-address, and battery status. In case of failure the robot will say “can’t connect to the internet”. In the example the robot used IP-address: 192.168.1.55 (wireless) and 192.168.1.145 (wired), but it is highly likely that yours has a different address.

Connecting TiViPE to a remote machine

The connection made from one machine to another (which might be a robot), is performed by setting up a remote link. The first time a connection is set up a key is generated and hence the first time one needs to use the command window as given in Figure 3.

plink

After the command window has been opened. The following commands need to be typed:

cd c:\TiViPE
vars.bat
plink nao@192.168.1.145

Type the appropriate ip-address. When it is the first time a key is created and the user has to enter ‘y’ followed by ‘return’ in the command window. Next the password

nao

needs to be given. This logs you in on the NAO robot. Congratulations a connection to the robot has been established. Being on the robot type

exit

to quit. The whole procedure is illustrated in Figure 4.

(a)plink1
(b)plink2
(c)plink3
(d)plink4

Figure 4: Step by step login procedure. In case it is not the first time the given IP-address is used, the key has been generated already and the user can login immediately. Otherwise the key is generated and the user needs to type ‘y’ before logging in.

TiViPE

TiViPE requires a key to be created in advance, hence the plink procedure needs to be performed for every uniquely created IP-address the first time only.  Within TiViPE this IP-address is provided in a list of remote machines. The list can contain other remote machines that do not necessarily need be present at the moment. If TiViPE is unable to connect it will give a message that it was not able to connect to that particular IP-address, so we can create multiple addresses upfront if desired. Adding remote machines is illustrated in Figure 5. The command

plink nao@192.168.1.55 -pw nao

automatically logs on to the robot, allowing the TiViPE environment to send and retrieve data to and from the robot.

(a)RobotControl4
(b)RobotControl5

Figure 5: One row is added to the remote hosts tabloid. The shell command is ‘plink -t -l nao -pw nao’, the hostname is ‘192.168.1.55’, the initialization command is ‘source $HOME/.profile. A unique port number needs to be given, starting from 4000, and a unique color to distinguish between the remote machines.

Streaming Video

Streaming video within TiViPE is a simple construction of 2 modules, where the top module called ‘FrameGrabber’ is executed on the robot as indicated by the yellow lower left rectangle, and is connected via a light green connection (a socket connection) that can be obtained by right clicking on the connection to the animation unit called ‘YUV16Animate’. The exact parameters are given in Figure 6. Since the NAO robot contains 2 cameras, one in the nose and one in the mouth, it is a simple exercise to duplicate both modules, and change the device number of the FrameGrabber module from 0 to 1. Note to toggle all modules to red colored modules by clicking on the right mouse button on the icon.

(a)video3
(b)video4
(c)video5
(d)video1
(e)video2

Figure 6: Streaming video obtained from the camera’s on the NAO robot and displayed on the screen of the local computer. (a) The TiViPE network. (b) The parameters used for the FrameGrabber module on the left. Change the device number to 1 for the right FrameGrabber module. (c) The parameters for both YUV16Animate modules. (d-e) Simultaneous recordings from top-nose and bottom-mouth camera’s.

Hello World Robot Example

This is done by the construction of a  “Hello world” robot example is given. The robot says “Hello world” using an internal text to speech (TTS) module. An illustration of the hello-world program is given in Figure 7.

(a)RobotControl1
(b)RobotControl2
(c)RobotControl3
(d)RobotControl3a
(e)RobotControl3b
(f)RobotControl3c
(g)

Figure 7: NAO robot says: “hello world”. (a) TiViPE program to control one NAO robot. (b) String command that is generated and send to the robot module. (c) Parameters used for the robot module. (d) Press execute on the string module to start the program. (e) The robot module provides execution information. press its messages rectangle to obtain the information (f). The robots says hello world (g).

In this Figure 7 blocks ‘CommandString’ and ‘NaoRobotN’ are used. The first module runs locally on the PC while the second is executed on the robot. The first module generates a string command: “say (hello_world)”. This string is send to the the ‘NaoRobotN’ module, interprets the string command, and processes the actions the robot is supposed to do.

Wireless robot connection

The NAO robots have a web interface that can be used to configure the robot. Relevant information can be obtained also using this web interface. In Figure 8, the Mozilla web browser has been used to configure a wireless connection. By connecting the robot via a wireless connection the IP-address given was 192.168.1.55. This IP address needs to be ‘finger printed’ as illustrated in Figure 4 and added to TiViPE as illustrated in Figure 5. Once the wireless connection has been configured properly the ethernet wire (wired connection 192.168.1.145) can be removed and the robot can move freely utilizing the wireless connection.

(a)nao0a
(b)nao0
(c)nao1
(d)nao2
(e)nao3
(f)nao4
(g)nao5
(h)nao6

Figure 8: The NAO robot interface.

The Login and password for every NAO robot is

nao

Type this for both login and Password and click the ‘Login button in the browser.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.