Skip to content
azaini49 edited this page Oct 18, 2020 · 19 revisions

Notice: You will have to use Linux or Unix-like operating system to work on RoboCup. We recommend Ubuntu (64 bit), which you can download from online. For Windows user, we recommend installing a dual boot Linux operating system on your computer. For Mac OS users you can skip this part because your operating system is based on Unix, but if you like, you can still try to install one on your computer. We do not recommend virtual machines because Linux Virtual Machine will mostly likely experience some issues with network and some specialized debugging tools.

  1. For Windows Users
  2. For Mac Users
  3. For Both: Packages and Git Setup

For Windows Users

SETTING UP LINUX

HOW TO INSTALL: go to the Ubuntu Website, http://www.ubuntu.com/download/desktop, select your computer architecture (32 or 64bits) and choose the version of Ubuntu you would like to install. We are using 16.04 / 18.04 and it works well. Read through the instructions. The website explains everything better than I do, so read carefully and follow the instructions.

Note: Windows 8/10 Users

If you have Windows 8/10 installed on your computer or if you have a UEFI motherboard, the wubi installer won’t work. You will need to dual boot your computer. Also, if you have a hybrid SATA disk, i.e, a hard drive with solid-state drive caching, you will need to go into your BIOS and turn SATA operation from RAID to AHCI.

Some tips:

For those of you who are not very familiar with Ubuntu, there are several ways to install/use it on a windows machine.

  • Dual-Boot: This is the recommended method, where you install Ubuntu alongside your windows. So when you start your computer, it will ask you which system to boot into, windows or Ubuntu. To do this you need to download the Ubuntu System image and burn it on a USB or DVD. The Ubuntu website has instructions on how to do it. Then you turn off you computer and choose to boot from the USB or DVD and the installation GUI will show up. In some cases you may get an error saying some files are missing, Google the error and most likely it can be fixed by changing the names of certain files in the USB or DVD.

  • Wubi: This is an alternative to dual-boot. You can install Ubuntu by Wubi as if you are installing a normal software on your windows machine. Wubi is the name of the installer and it can be found at: http://www.ubuntu.com/download/desktop/windows-installer This is much easier than the dual-boot method and it usually works quite well. The problem with this method is that Ubuntu is installed on the C drive of your computer so the space for it may be limited and if you windows OS runs into some problem, you will also lose your Ubuntu. Plus there may be unexpected errors due to the architecture of your computer.

  • If you are installing Ubuntu with a USB drive or DVD to make a dual-boot system, you may want to partition your computer first or at least reserve an empty place for Ubuntu in windows. When you are installing Ubuntu, in the case of 14.04, you can either use the default place (I guess it automatically looks for the biggest partition other than C drive on your computer) to install it or manually choose the place. As far as I know, going manual can be very complicated since you need to indicate places for different types of system files, so just don’t do it if you are not super familiar with Ubuntu. During the installation process, you will be asked how much space to be reserved for Ubuntu. I suggest at least 10Gbs. 20 Gbs should be enough for RoboCup and if you have a lot of space on your hard drive you can put in more.

Many problems may happen when you are installing a second OS on your computer. Most of these problems are specific with the architecture of the computer you use, so I highly recommend do some Googling before you get started. You can simply Google for installing Ubuntu on a certain type of computer to see if there is anything that you should pay attention to. And if you run into any problem in the process, Google it as well. Ubuntu is widely used so you can always find someone that knows the answer.

Installing Dependencies

After you install Linux on your computer, you need to install the dependencies: the software/libraries required to compile/run the RoboCup code. For this step, we'll just tell you outright what shell commands to execute. What these shell commands mean and how to use the things you're installing will make more sense once we start using them in the upcoming boot camps workshops.


Start your shiny new Ubuntu, run the following command in the terminal (Ctrl+Alt+T) one at a time:

$ sudo apt-get install build-essential
$ sudo apt-get install lua5.1
$ sudo apt-get install liblua5.1-0-dev (please make sure to download this specific version of lua5.1.5)
$ sudo apt-get install swig (this is necessary for running Matlab vision debugger)
$ sudo apt-get install libboost-dev
$ sudo apt-get install git-core (this is necessary to run git on your computer)
$ sudo apt-get install vim (vim is the default command line text editor on robots and it's recommended that you know basic commands for vim)
$ sudo apt-get install cmake (this is necessary for compiling library code on your computer)
$ sudo apt-get install default-jre (installing java for running some java applications for games)
$ sudo apt-get install gfortran (installing Fortran compiler)

For Mac OS Users

Installing Dependencies


Installing Homebrew Download Homebrew. Homebrew is a package management software similar to apt-get on Ubuntu, and makes staying up to date on code-related things extremely easy to do. Once you have Homebrew installed, open up a terminal and run: $ brew update $ brew install boost swig


Installing XCode You’ll also need to go download the latest version of XCode. Besides the XCode application, you also need to install Command Line Tools for XCode.


Installing LUA 5.1.5

$ curl -R -O http://www.lua.org/ftp/lua-5.1.5.tar.gz
$ tar -zxf lua-5.1.5.tar.gz
$ export LUA=/usr/local/Cellar/
$ mv lua-5.1.5 $LUA
$ make -C $LUA/lua-5.1.5 macosx test
$ sudo make -C $LUA/lua-5.1.5 install

For both MAC and LINUX

Installing Required Packages


Installing OpenBlast

$ cd ~/Documents/       (or in any other directories you would like to install)
$ git clone https://github.com/xianyi/OpenBLAS
$ cd OpenBLAS
$ make 
$ sudo PREFIX=/usr/local make install

Installing Torch

$ cd ~/Documents/
$ git clone https://github.com/UPenn-RoboCup/torch7.git
$ cd torch7
$ make prep
$ make -j4
$ sudo make install

Alternatively for torch, you can follow the official torch website for installation.


Update the Libraries

$ sudo ldconfig

Git Setup

  1. If you haven't gained the access, send us an email (or reply to our slack thread) with your gitlab account to get access to the private repo. You will need your gitlab account username to do so.

  2. Assign your computer’s SSH key with your github account. Follow the instructions here. If you don’t know what a public key/SSH key is, read the Wikipedia page: http://en.wikipedia.org/wiki/Public-key_cryptography

MATLAB

We use MATLAB mainly for vision and localization debugging. UPenn SEAS department offers free MATLAB licenses. Follow the instructions on this website to get your license.

Installing Code Base

Once you have access to our code base, follow the steps below to download our code in your computer.

If you never used github before, you should also run the following commands.

$ git config --global user.name “YOUR_USERNAME”
$ git config --global user.email “YOUR_EMAIL”

if using gitlab

$ cd ~/Documents/ (or where you'd like your repo to be)
$ git init
$ git clone https://gitlab.com/upennalizers_robocup/upenndev.git
$ cd UPennDev/ (if it exists, else ignore this step)
$ git checkout Dev2020
$ git pull

Compiling C++ Library on your machine

$ cd UPennDev/Lib/
$ make clean
$ make setup_naov4

Compiling MATLAB Library on your machine

Linux User:

$ vim ~/.bashrc
$ export PATH=$PATH:/usr/local/MATLAB/R2015b/bin/     (or your own MATLAB version)

MAC User:

$ vim ~/.bash_profile
$ export PATH=$PATH:/Applications/MATLAB_R2015b.app/bin/

NOTE There is a high probability that the following matlab steps don't work for you (based on your GCC version and Matlab version etc.) There is also a high probability that your specific UPennalizers projects don't need this set up. If it crashes don't worry, just stop here and continue to the next section. If you end up needing this we'll help you individually.

restart terminal,

$ cd UPennDev/Tools/Matlab/util
$ make (LINUX user) or $ make 15b (MAC user)
$ cd ../mex
$ make (LINUX user) or $ make 15b (MAC user)
$ cd ../colortable
$ make (LINUX user) or $ make 15b (MAC user)

COMMENT 1: For MAC User, if your xcode version is 7 or higher, follow this thread to resolve your compiling issues: COMMENT 2: Ingore the msgpack error when compiling the mex files for now. COMMENT 3: If you have a more recent version of MATLAB, be sure to update the Makefile in UPennDev/Tools/Matlab/util, for example:

16b: MATMEX=/Applications/MATLAB_R2016b.app/bin/mex
16b: all

Installing Webots Simulator (2020 onwards):

Download webots from here https://cyberbotics.com/, we use version 2019A (recommended) but you can adapt newer versions to work too (Some changes might be needed). You will need this simulator to run code remotely. Follow the instruction in UPennDev/WebotsProj/README.txt under "Setting Up Webots on a New Computer" to link your simulator with our codebase.

To compile the codebase to be setup for webots run the following

$ cd UPennDev/Lib/
$ make clean
$ make setup_webots_nao

In the future, you can alternate between

$ make setup_naov4

and

$ make setup_webots_nao

to switch between running on robots and on webots

If you have been able to complete all the steps above, congratulations, your machine is now ready for RoboCup. Please check out Connecting to Robot if you have lab access and want to learn how to connect to a robot.

Clone this wiki locally