CS393R: Autonomous Robots -- Naos and UT Austin Villa

CS393R: Autonomous Robots -- Using the Nao and the UT Austin Villa Codebase

All assignments for this course will be using humanoid Nao robots, the UT Austin Villa codebase, and the UTNaoTool (a tool developed by Austin Villa to develop and debug code on the Nao robots).

Initial Setup on Lab Machines

You should use these steps to obtain, setup, and run code on the lab machines and robots for the first time. Note that these steps do not work on the departmental machines. See the bottom of this page for instructions if you want to try and install the codebase on your personal Linux machine.

  1. Read the Robot Care section below.
  2. Copy and run the nao_setup script from my home directory to yours: cp /home/jmenashe/nao_setup ~ && ~/nao_setup
  3. In a new terminal window, Go to the nao build directory in $NAO_HOME/build and compile the core libraries and the tool.

  4. cd ~/nao/trunk/build
    ./compile robot tool

    Starting up the Robot

  5. Get your robot out of its locker, and place it on the ground in a sitting position. Plug it in. Turn it on by pushing its chest button. Lights should come on in the eyes.
  6. Connect to the lab wireless network as described here.
  7. In a new terminal, ping your robot by typing ping 10.202.16.XX, where XX is the robot number. This is taped on the back of the robot's head near the ear.
  8. Set up passwordless ssh for your robot:

  9. Run ssh-keygen and follow the prompts
    Run ssh-copy-id nao@10.202.16.XX using the password nao to copy your public key to the robot.
  10. Now you should ssh into your robot by typing ssh nao@10.202.16.XX. Once here, type nao stop to stop naoqi.
  11. Using the terminal you used to run the build scripts, copy your code to the robot with ./copy_robot 10.202.16.XX all
  12. Now you can go back to the terminal you used to ssh into your robot. Type nao start. The robot will eventually say interface and then vision. Once it has said vision, you know it has completely booted.
  13. Run $NAO_HOME/bin/tool and open the Files window. Select your robot ip address from the drop-down menu in the upper right corner of the skinny files window. Press the 'Playing' button to have the robot follow a simple routine in which it randomly walks and turns for a short period of time.
  14. When you're done with the robot, turn it off by holding its chest button down for ~10 seconds.

Connecting with Wireless

The robots can be accessed over wireless through either the lab machines or your personal machines. When connecting with your personal machines, you'll need to connect to the robolab wireless network. NAT and DHCP have been disabled due to the lab configuration so you won't be able to hit the outside and you'll need to use a static IP. To avoid conflicts, each team will have an allowed range. Your static IP address will be 10.202.16.XX, where team# * 10 + 100 <= XX < (team# + 1) + 100. So if you're team/locker number is 5, your range is 150-159. So the settings are:

SSID: robolab-cs393r-3.710a
IP: 10.202.16.XX
psk: [emailed with your account info]

Connecting with Ethernet

It can sometimes be advantageous to connect to the robot with an ethernet cable rather than over wireless, particularly when transferring logs, or when the wireless is down. To do so you'll need to follow these steps:
  1. Create a manual connection: IP:, Subnet Mask:, Gateway (if required): If you're running linux on a virtual machine, create this connection on the host operating system.
  2. Connect your machine with an ethernet cable to the robot. The robot's ethernet port is on the back of its head.
  3. Use the IP address 11.0.1.XX when accessing the robot, where XX is the robot number taped on the back of the head near the ear.

How to Take a Log

Following are instructions to capture logs and download them from the robot to your $NAO_HOME/logs folder. Note: your robot should be on, naoqi should be running, and the desired code should already be uploaded before following these instructions.

  1. If you've already captured logs, you may find it helpful to remove old logs from the nao. To remove all logs on the robot, open the Files window and click the "Remove Logs" button.
  2. Go to $NAO_HOME and open the tool by typing bin/tool. Click on the Log Select button.
  3. Select what you want to log in the Log Select window.
  4. Click the Send To button to send the modules to log to the robot.
  5. Click the "Logging is OFF" button to begin logging an indefinite number of frames. To log a specific number, set the integer box on the right to the number of frames you wish to log. To set a minimum delay between log frames, set the Log Frequency value to the number of seconds you want the delay to be. This can be helpful when logging raw images, as they can quickly overflow the Nao's DMA buffer and cause the robot to process frames slowly.
  6. If you've selected a frame count, logging will stop automatically. Otherwise, you must manually stop the logging process by clicking the "Logging is ON" button.
  7. In the Files window, click the "Get Logs" button to retrieve logs from the robot.

How to Make a Color Table

  1. Go to $NAO_HOME and open the tool by typing bin/tool.
  2. Open a log by going File->Open Log in the UTNaoTool and selecting the appropriate log.
  3. Click the Vision button in the UTNaoTool main window.
  4. Go to the Layers tab and click on one of the segmented images on the top right. Each pair of images is a different layer for the top and bottom cameras. Select the image for the camera that you wish to make a color table for.
  5. Go to the C Tables tab and check "Enable Classification".
  6. Open the Bottom/Top Table menu and click "New [Top/Bottom]" to start with a blank color table.
  7. Select a color and click on the large image. All YUV values within a ball around the pixel you've selected will be assigned to the color you selected. You can adjust the size of the ball with the dials in the C Tables tab.
  8. Save your table with the Top/Bottom Table menu.
  9. Transfer your tables to the robot using the "Send ctable" button in the Files window.


An overview of the codebase is available on the
tutorial page. This page points to the areas of the codebase that you'll be using along with code snippets to get you started.

Robot Care

The Nao robots are expensive machines that can break fairly easily from falling or overheating. Each joint needs to work precisely for the robot to move smoothly and receive input from its sensors, so even subtle damage can significantly affect the robot. Please follow these guidelines when working with your robot:
  1. Keep the robot in a sitting position with stiffness off when not in use. You can tell that stiffness is off because the joints are easily flexible. If the robot's joints are stuck with stiffness enabled due to a crash, you can kill the naoqi process to disable stiffness easily. Killing naoqi will cause the robot to collapse, so be sure you are holding the robot when you do this.
  2. Always have the robot in a sitting position when you are starting it up.
  3. Monitor the robot's battery and heat sensors and be sure to let it cool down by disabling joint stiffness when not in use, and keep it charged by plugging it in when it isn't moving.
  4. Avoid commands that move the joints excessively fast.
  5. Carry the robot by holding its abdomen. Holding it by the shoulders or extremities can wear down the joints.
  6. Whenever the robot is moving, you or your partner should be next to it, ready to catch it if it falls.
  7. If you need to stop the robot while it's in PLAYING mode, press its center chess button to put it into PENALISED. This will cause the robot to sit.
  8. Only turn the robot on when it is on the carpeted area of the lab.

Instructions for Installing the Codebase on Your Personal Linux Machine

To install the codebase on your personal machine, you should be running Ubuntu 12.04 64-bit. The code may work on other configurations with some adjustments to the setup procedure, but these aren't officially supported. The setup process will configure your machine for building and running 32-bit software, which can cause conflicts with other applications in Ubuntu. It is strongly suggested that you use a fresh Ubuntu install for this. This may be easiest to accomplish using a virtual machine.

  1. Read the Robot Care section above.
  2. Connect to the cs network through one of the ethernet ports in the lab or the cs wireless network.
  3. Create and enter the 'nao' folder in your home directory: mkdir -p ~/nao && cd ~/nao
  4. Pull the code from my folder using git: git clone ssh://[YOUR CS RES USERNAME]@adler.csres.utexas.edu/home/jmenashe/nao_pub/trunk trunk
  5. Use your csres password when prompted.
  6. Run the nao install script: ~/nao/trunk/install/install
  7. Some commands will need root or confirmation, so periodically check the script as it executes.
  8. When the script finishes, make sure everything is set up correctly by compiling the codebase in a new terminal window: cd ~/nao/trunk/build && ./compile robot tool
  9. Try running the tool to ensure that the build has completed and your libraries are configured: ~/nao/trunk/bin/tool
  10. Connect to the robolab wireless network using the SSID and password you received.
  11. Follow the steps above under Starting up the Robot.

Using Git

Git is a distributed version control system used for managing code repositories. I will be using Git in this class for distributing updates to the codebase. Say you've made some changes to the codebase and you need to pull a patch that I've put in the nao_pub repository. You would then follow these steps:
  1. cd ~/nao/trunk
  2. git add . # adds all folders in your repository to staging
  3. git commit -m "[your commit message]" # commits your changes to your local version of the repository
  4. git pull # fetches the latest version of the nao_pub repository and merges them in with your own.
If you want to undo all your changes before pulling a patch, go into ~/nao/trunk and run git checkout . There is much more that's possible with Git, but these commands will cover 99% of use cases.

Other Things You Should Know

[Back to Department Homepage]

Page maintained by Jake Menashe
Questions? Send me mail