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.
- Read the Robot Care section below.
- Copy and run the nao_setup script from my home directory to yours: cp /home/jmenashe/nao_setup ~ && ~/nao_setup
- In a new terminal window, Go to the nao build directory in $NAO_HOME/build and compile the core libraries and the tool.
./compile robot tool
Starting up the Robot
- 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.
- Connect to the lab wireless network as described here.
- 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.
- Set up passwordless ssh for your robot:
Run ssh-keygen and follow the prompts
Run ssh-copy-id email@example.com.XX using the password nao to copy your public key to the robot.
- Now you should ssh into your robot by typing ssh firstname.lastname@example.org.XX. Once here, type nao stop to stop naoqi.
- Using the terminal you used to run the build scripts, copy your code to the robot with ./copy_robot 10.202.16.XX all
- 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.
- 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.
- 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:
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:
- Create a manual connection: IP: 126.96.36.199, Subnet Mask: 255.255.255.0, Gateway (if required): 0.0.0.0. If you're running linux on a virtual machine, create this connection on the host operating system.
- Connect your machine with an ethernet cable to the robot. The robot's ethernet port is on the back of its head.
- 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.
- 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.
- Go to $NAO_HOME and open the tool by typing bin/tool. Click on the Log Select button.
- Select what you want to log in the Log Select window.
- Click the Send To button to send the modules to log to the robot.
- 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.
- 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.
- In the Files window, click the "Get Logs" button to retrieve logs from the robot.
How to Make a Color Table
- Go to $NAO_HOME and open the tool by typing bin/tool.
- Open a log by going File->Open Log in the UTNaoTool and selecting the appropriate log.
- Click the Vision button in the UTNaoTool main window.
- 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.
- Go to the C Tables tab and check "Enable Classification".
- Open the Bottom/Top Table menu and click "New [Top/Bottom]" to start with a blank color table.
- 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.
- Save your table with the Top/Bottom Table menu.
- 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.
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:
- 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.
- Always have the robot in a sitting position when you are starting it up.
- 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.
- Avoid commands that move the joints excessively fast.
- Carry the robot by holding its abdomen. Holding it by the shoulders or extremities can wear down the joints.
- Whenever the robot is moving, you or your partner should be next to it, ready to catch it if it falls.
- 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.
- 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.
- Read the Robot Care section above.
- Connect to the cs network through one of the ethernet ports in the lab or the cs wireless network.
- Create and enter the 'nao' folder in your home directory: mkdir -p ~/nao && cd ~/nao
- 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
- Use your csres password when prompted.
- Run the nao install script: ~/nao/trunk/install/install
- Some commands will need root or confirmation, so periodically check the script as it executes.
- 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
- Try running the tool to ensure that the build has completed and your libraries are configured: ~/nao/trunk/bin/tool
- Connect to the robolab wireless network using the SSID and password you received.
- Follow the steps above under Starting up the Robot.
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:
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.
- cd ~/nao/trunk
- git add . # adds all folders in your repository to staging
- git commit -m "[your commit message]" # commits your changes to your local version of the repository
- git pull # fetches the latest version of the nao_pub repository and merges them in with your own.
Other Things You Should Know
- When sshed into the Nao, you can type nao stop to stop naoqi, nao start to start naoqi and killall naoqi to completely kill naoqi. You know the robot is ready to use once it has said interface and vision.
- Use the scripts in $NAO_HOME/build to compile, copy, and compile_copy. They are well documented and easy to read, so usage is straight forward.
- In most cases running ./compile robot tool will take into account any changes made to the codebase for both the core libraries and the tool interface. In some advanced cases you may need to do a clean build for a particular interface. Adding the --clean option when running compile will remove all previously built objects to allow for a clean build.
- It is safe to leave the robot on as long as it is plugged in and its joints are loose (i.e. stiffness commands all set to 0). If the robot is holding a joint in place, then the joint is stiff and shouldn't be left on for long periods of time. Killing the naoqi process is a guaranteed way to turn off stiffness. Since this has the effect of turning off all joints on the robot, be sure it is in a sitting position when you do this.
- When the robot is in Initial or Finished, the right eye indicates ball visibility. If the top right eye is blue, then the ball is visible in the top camera. If the bottom right eye is blue then the ball is visible in the bottom camera. In these states the left eye indicates power and heat. If the top left eye is white, then the joints are all cool. Similarly, if the bottom left eye is white, then the robot's battery level is high. The top and bottom of the left eye will transition toward red as these conditions worsen.
- If you want to stream what the robot is currently seeing, click on the Log Select button and then select the box next to vision under the Send To button and the Vision w/ Raw box in the Log Select window. Click 'Send To' (with your robot selected from the drop down in the Files window). Then click stream on the main UTNaoTool window. You should now see streaming images in the Vision window.
[Back to Department Homepage]
Page maintained by
Questions? Send me