Skip to content
This repository has been archived by the owner on Jun 18, 2022. It is now read-only.

Getting Started

Peter Schmidt edited this page Sep 18, 2016 · 13 revisions

Setting up your OS

The OS that currently works without any problems or further changes is Ubuntu 14.04.1 LTS 64-bit (the long-term release one). Use anything else at your own risk!

Note: 14.04.02 works, 14.04.03 makes offnao segfault, and 14.04.04 has this issue.

You can run the OS natively on its own partition, or in a VM, it is recommended to have at least a 30Gb partition. On Windows, good VM's are VMWare (which CSE students get for free) and VirtualBox.

Setting up a github account

  • Create yourself a github account: https://github.com/signup/free

  • Install your ssh public key into your github account at https://github.com/account/ssh.

    Note: If you don't have one you can make one by running: "ssh-keygen -t rsa" (without ") The key will be placed in ~/.ssh/id_rsa.pub

  • Set up your git settings to correspond to your github account

    git config --global user.name "Firstname Lastname"

    git config --global user.email "your_email@youremail.com"

Setting up the build environment

Before you begin you need to have a few dependencies installed namely: cmake and developer versions of zlib & glib. Try:

# Should have CMake 2.8.12.2, earlier versions tend to have other issues
sudo apt-get install cmake zlib1g-dev libglib2.0-dev

# Extra libraries for 64 bit.
sudo apt-get install libc6-i386 lib32z1-dev libstdc++6:i386 libbz2-1.0:i386 libfreetype6:i386 libglib2.0-0:i386 libsm6:i386 libxrandr2:i386 libfontconfig1:i386

Get our repository and run the build script by copy and pasting the following:

git clone git@github.com:UNSWComputing/rUNSWift-2015-release.git rUNSWift
cd rUNSWift
bin/build_setup.sh

NOTE: You will probably need a CSE login, or some other way to get the LINUX_CTC_ZIP file originally from Aldebaran into your rUNSWift/ctc directory.

This will:

  • Set up your .bashrc with some robocup environment variables.
  • Add your ssh key to the image on the robots.
  • Download the cross toolchain (CTC) and generate some Makefiles.
  • Do an initial release and debug build.

This can take a long time, maybe half an hour, so now is a good time to go do something else.

Setting up an Eclipse IDE Project

You can edit the code from Eclipse CDT. The benefit is it is easier to navigate around the code and you get pre-compiled error warnings as you write the code. The steps are:

  • Download and install Eclipse CDT here.
  • Run eclipse CDT.
  • Choose File - Import - C/C++ Existing Code as Makefile Project - Select Linux GCC as Toolchain - Choose the runswift code project path
  • Done!

Final Steps

If you have followed the above steps without any issues then go you should be able to run offnao:

~/runswift/build-release/utils/offnao/offnao

Syncing with the robot

You may find Networking and Passwords useful here.

Make sure the robot you are syncing with has been set up - check Robot Statuses. If you are syncing with Tank:

nao_sync <args> tank

or

nao_sync <args> -b build-relwithdebinfo tank

The first is for normal execution, the second is if you want debugging symbols (it will sync from the build-relwithdebinfo directory instead, so make sure you run 'make' there instead of in your build-release directory). You should learn more about the other nao_sync flags with nao_sync --help. Typically, you will run nao_sync -rad tank to sync runswift and remove old files.

Running the code

You can either:

  • ssh into the robot with ssh nao@tank.local and run the 'runswift' command, or
  • Load runswift by triple tapping the robot's chest or sliding your finger across the touch panels on it's head from front(eyes) to back(fan)

Either way, after doing this you will need to double tap the chest to make it stiffen its body, and then toggle to penalized/playing modes with single taps of the chest.

There is more information on the button press interface and indicator lights at Button Presses For Nao.

Summary

So basically, from now on your build process will be something like:

  1. <Make changes to code>
  2. cd build-release; make;
  3. nao_sync -rad tank
  4. Launch the robot through button presses
  5. (Depending on what you're doing) Connect to the robot via Offnao and track its progress