Difference between revisions of "Nao tutorial 1: First steps"

From robotica.unileon.es
Jump to: navigation, search
Line 9: Line 9:
 
''This tutorial is targeted for version 1.10.10 of the SDK and OS. Older versions like 1.8.16 or 1.6.13 will probably not work.''
 
''This tutorial is targeted for version 1.10.10 of the SDK and OS. Older versions like 1.8.16 or 1.6.13 will probably not work.''
  
=Putting everything ready=
+
=Preparing the environment=
  
 
OK, the first thing you must do is to get a testing environment ready. By "testing environment" I mean a room with enough space, a computer running Linux (Debian or Ubuntu preferably), a network LAN connection with a router, and such. Be aware that Nao is very prone to fall if you do something wrong. Don't be afraid, but keep it in mind.
 
OK, the first thing you must do is to get a testing environment ready. By "testing environment" I mean a room with enough space, a computer running Linux (Debian or Ubuntu preferably), a network LAN connection with a router, and such. Be aware that Nao is very prone to fall if you do something wrong. Don't be afraid, but keep it in mind.
Line 17: Line 17:
 
Finally, the Ethernet socket is behind the head. You may need to open the protective hatch, or completely remove the head's cover, whichever one you prefer.
 
Finally, the Ethernet socket is behind the head. You may need to open the protective hatch, or completely remove the head's cover, whichever one you prefer.
  
=Getting to know Nao=
+
=Connecting to Nao=
  
When everything is set, press Nao's chest button once to turn it on. His eyes will start blinking red, green and blue. Then, some other blue LEDs located on his ears will do the same, and the eyes will stop blinking. Later, the eyes and chest button will come alive again with a stable white light, and the robot will tell you that it has finished loading his system. The whole process lasts about two minutes and you will get soon tired of it, I promise.
+
When everything is set, press Nao's chest button once to turn it on. His eyes will start blinking red, green and blue. Then, some other blue LEDs located on his ears will do the same, and the eyes will stop blinking. Later, both the eyes and chest button will come alive again with a stable white light, and the robot will tell you that it has finished loading his system. The whole process lasts about two minutes and you will get soon tired of it, I promise.
  
If you plugged Nao to your LAN via Ethernet, he should have gotten an IP address by now, using DHCP.
+
Now, you must connect to Nao to do some first-time configuration. It pays to have a simple router-based LAN with DHCP dynamic addressing, otherwise you will complicate your life effortlessly.
 +
 
 +
==Recovering the IP address==
 +
 
 +
We need to get the IP address Nao has bonded to. There are a couple of ways to do it, and I will enumerate them all:
 +
 
 +
===Using the router===
 +
 
 +
This is the hard way. Most routers offer an option to list the clients that are connected to it, through the web interface. Input the following command in your PC (obviously, you must be in the same LAN as Nao):
 +
 
 +
<pre>sudo ifconfig</pre>
 +
 
 +
Seek your network adapter in the list (usually eth0 for the first Ethernet card, eth1 for the second...) and look for your IP address (mine is 192.168.1.101). Your router's IP will be probably the same, but changing the last number for 1 or 0 (e.g., 192.168.1.1). Open a web browser and input that IP in the address bar. Press Enter and you will be prompted for the router's username and password. You should know them, but if not go [http://www.routerpasswords.com/ here] for a list of default ones.
 +
 
 +
When you're in, seek for a menu option that will show you the connected clients. Nao's IP should be next to yours.
 +
 
 +
===Mapping the network===
 +
 
 +
Easier than the previous. You can scan the network for online hosts, using a network mapper program. For example, I will use [http://nmap.org/ nmap]. Install it:
 +
 
 +
<pre>sudo aptitude install nmap -y</pre>
 +
 
 +
And then do a ping scan over your network (change the IP as needed):
 +
 
 +
<pre>sudo nmap -sP 192.168.1.1-255</pre>
 +
 
 +
Nao will appear in the list, with something like "Host 192.168.1.102 is up (0.00018s latency)". Your own computer will be shown with no latency.
 +
 
 +
===Asking Nao===
 +
 
 +
The easier way, but you will need to get up and walk a bit. Just approach Nao and press his chest button once. It will briefly blink in green, and then Nao will beep and speak his name, internet address and battery level. If it says "I can't connect to the network", check the router and Ethernet cable.

Revision as of 12:48, 31 January 2011

Nao humanoid robot.

This article is not finished. Content may vary between days. Please, do not edit it if you're not the original author.

The purpose of this tutorial is to teach you the basic concepts of Nao. I assume that you are staring at the robot's box after (hopefully) buying it, and that you want to start making cool things with it, like conquering the world. You are wondering how to do that, but you don't even know how to plug the robot.

I will take you, step by step, through the first tasks that you should complete before going serious. Even if I will try to make it easy, certain previous knowledge is required, like basic programming and Linux concepts. Also, I would recommend you to read the official documentation and tutorials found here (section "Software") before going forth. In case of doubt, always trust them.

This tutorial is targeted for version 1.10.10 of the SDK and OS. Older versions like 1.8.16 or 1.6.13 will probably not work.

Preparing the environment

OK, the first thing you must do is to get a testing environment ready. By "testing environment" I mean a room with enough space, a computer running Linux (Debian or Ubuntu preferably), a network LAN connection with a router, and such. Be aware that Nao is very prone to fall if you do something wrong. Don't be afraid, but keep it in mind.

Place Nao somewhere in the middle of the room, so he has freedom of movement. Try to keep it apart from places or objects that could make him fall or get jammed. Also, note that you will need to plug it to the power this time (or whenever you need to recharge his battery), and to the LAN. The power connector is on Nao's back, facing downwards. In fact, you will be plugging it directly to the battery, which is behind the cover (it has 4 screws that you must remove in order to access it).

Finally, the Ethernet socket is behind the head. You may need to open the protective hatch, or completely remove the head's cover, whichever one you prefer.

Connecting to Nao

When everything is set, press Nao's chest button once to turn it on. His eyes will start blinking red, green and blue. Then, some other blue LEDs located on his ears will do the same, and the eyes will stop blinking. Later, both the eyes and chest button will come alive again with a stable white light, and the robot will tell you that it has finished loading his system. The whole process lasts about two minutes and you will get soon tired of it, I promise.

Now, you must connect to Nao to do some first-time configuration. It pays to have a simple router-based LAN with DHCP dynamic addressing, otherwise you will complicate your life effortlessly.

Recovering the IP address

We need to get the IP address Nao has bonded to. There are a couple of ways to do it, and I will enumerate them all:

Using the router

This is the hard way. Most routers offer an option to list the clients that are connected to it, through the web interface. Input the following command in your PC (obviously, you must be in the same LAN as Nao):

sudo ifconfig

Seek your network adapter in the list (usually eth0 for the first Ethernet card, eth1 for the second...) and look for your IP address (mine is 192.168.1.101). Your router's IP will be probably the same, but changing the last number for 1 or 0 (e.g., 192.168.1.1). Open a web browser and input that IP in the address bar. Press Enter and you will be prompted for the router's username and password. You should know them, but if not go here for a list of default ones.

When you're in, seek for a menu option that will show you the connected clients. Nao's IP should be next to yours.

Mapping the network

Easier than the previous. You can scan the network for online hosts, using a network mapper program. For example, I will use nmap. Install it:

sudo aptitude install nmap -y

And then do a ping scan over your network (change the IP as needed):

sudo nmap -sP 192.168.1.1-255

Nao will appear in the list, with something like "Host 192.168.1.102 is up (0.00018s latency)". Your own computer will be shown with no latency.

Asking Nao

The easier way, but you will need to get up and walk a bit. Just approach Nao and press his chest button once. It will briefly blink in green, and then Nao will beep and speak his name, internet address and battery level. If it says "I can't connect to the network", check the router and Ethernet cable.