Realtime Linux

From Control Systems Technology Group

Revision as of 16:16, 30 October 2010 by Cstwiki (Talk | contribs)
Jump to: navigation, search

Author(s): Jeroen de Best, Koen Meessen
Source: Techunited: How to turn Hardware into Football

This document describes how to get the robots of Tech United to play football. It begins with installing a development PC, devpc.


How to install a devpc

This chapter describes in detail all the consecutive steps needed in order to get a fully operational development PC called devpc.

Install Ubuntu 8.10

Get a Ubuntu 8.10 live CD put it in your CD tray, boot your system from CD and select Install Ubuntu 8.10 to your hard disk. At the first step choose your language (English) and select 'Forward'. At the second step choose your time-zone. The time-zones are sorted by continent. Choose Europe, Amsterdam and select 'Forward'. At the third step choose your keyboard settings. You can try the settings in the lower area of the setup screen. The default is U.S. English, U.S. English. Select 'Forward'. At the fourth step you are asked to prepare the disks. Choose for the manual option here and select 'Forward'. Now watchout, because in the following steps you are going to erase your entire harddisk! Consecutively, select each partition and delete those partitions by clicking 'Delete partition'. After deleting all partitions select 'free space' and click 'New partition'. First make a primary partition of 4096 megabytes which is located at the beginning. Use this partition as a swap partition. This can be chosen in the 'Use as' drop down menu. Select 'Ok'. Secondly, make a primary partition of the remaining size which is located also at the beginning. Use this partition as an ext3 partition. This can be chosen in the 'Use as' drop down menu. The mount point should be '/'. Now, all disk space is partitioned. Turn on the 'Format?' option for the ext3 partition and select 'Forward'. At step number five, do not Migrate Documents and Settings and select 'Forward'. At the sixth step you should fill in the form about who you are. In our case the login name and username are robocup. The password for robocup is Robocup. Make sure that the name of your computer is devpcX, where X stand for the number of the devpc. Tick the Login Automatically option. The installation will take approximately 15 minutes. After installation, reboot the system.

Wireless internet at the TU/e

If you have a wireless ethernet adapter, you will be asked to give a default keyring password after rebooting. Just apply it without giving any password and accept the warning about the weak password. You can get wireless connection to the internet by clicking the network applet in the top right corner of the screen. Choose tue-wpa2. A screen with settings appears. Set the following settings:

Wireless Security: WPA & WPA 2 Enterprise
Authentication: Protected EAP (PEAP)
Anonymous Identity:
Ca- Certificate: /usr/share/ca-certificates/mozilla/GTE_CyberTrust_Global.crt
PEAP Version: Version 0
Inner Authentication: MSCHAPv2
Username: <your TU/e user name>
Password: <your TU/e password>

Accept the settings and you will be connected to the wireless TU/e network.

Switch to basic appearance

At this moment we shutdown the fancy graphics environment. Therefore, go to System, Preferences, Appearance, Visual Effects and set these to none. This turns of all the fancy desktop features, which are unneccesary.

Change root password

Now we should change the superuser/root password by typing. This can be done using a so-called terminal, which can be started from Applications, Accessories, Terminal. A white screen will appear with a command line prompt. To change the root password type the following.

robocup@devpcX:~$ sudo passwd root

Type your own password when asked as follows

[sudo] password for robocup:

and enter the new root password ****** twice when asked as follows

Enter new UNIX password:
Retype new UNIX password:

Now your root password is updated.

passwd: password updated successfully

Install additional packages

At this point, be sure to have a working internet connection. If so, open Synaptic Package Manager from System, Administration, Synaptic Package Manager. Type the password Robocup to enter the package manager. Click the top right 'Reload' button to update the package list. Now double-click or right-click and select 'Mark for Installation' for the following packages. You can find these packages fast by selecting one of the packages (single-click) in the top right package list and type the first letters of the package you are searching for.

csh (needed for matlab engine)
gcc-4.1 (needed for compatibility with mex)
glade-3 (needed for GUIs)
kernel-package (needed for kernel compilation)
libgd2-noxpm-dev (needed for gd functionalities)
mc (file browser midnight commander)
nfs-common (needed to mount wtbfiler)
ntp (needed for synchronizing clocks)
ntpdate (needed for synchronizing clocks)
openssh-server (to access from a remote computer)
sun-java6-bin (needed for java)
subversion (needed for svn version)
bison (needed for comm)

Apply to install the packages. Agree the license agreement of Java, select 'Forward'. These packages will be needed during the following steps or will be needed in combination with the Tech United software.

Change gcc and g++ version

On your system there are now two versions of gcc, namely 4.1 and 4.3. Since the mex command of Matlab cannot cope with the 4.3 version we have to use the 4.1 version. The current version will probably be 4.3. To check this type the following

robocup@devpcX:~$ su
root@devpcX:/home/robocup# gcc --version
root@devpcX:/home/robocup# g++ --version

Now we alter the link gcc and g++ to point to the 4.1 versions. This is done as follows

robocup@devpcX:~$ su
root@devpcX:/home/robocup# cd /usr/bin
root@devpcX:/usr/bin# ln -sf gcc-4.1 gcc
root@devpcX:/usr/bin# ln -sf g++-4.1 g++

Check the versions again to make sure that the correct version 4.1 is now used.

Install Matlab 2007b

Now we will install Matlab 2007b. Therefore we will access to the wtbfiler of the TU/e. Note that this is only possible if you are at the TU/e or having a VPN connection with the TU/e. Make sure you have a working internet connection, preferably wired to speed up the installation process. Open a Terminal and proceed as follows

robocup@devpcX:~$ su
root@devpcX:/home/robocup# mkdir /mnt/temp
root@devpcX:/home/robocup# mount /mnt/temp
root@devpcX:/home/robocup# mkdir /usr/local/matlab75
root@devpcX:/home/robocup# cd /mnt/temp/Unix-Software/matlab2007b/license
root@devpcX:/mnt/temp/Unix-Software/matlab2007b/license# cp license.dat /usr/local/matlab75
root@devpcX:/mnt/temp/Unix-Software/matlab2007b/license# cd ../DVD1
root@devpcX:/mnt/temp/Unix-Software/matlab2007b/DVD1# ./install

Choose the matlab root directory as /usr/local/matlab75. During installation cut the license at the begin and at the end where it is indicated (cut including the begin and end comments). Select the option Create symbolic links to MATLAB scripts in: /usr/local/bin. The installation will approximately take 30 minutes. Now we change the matlab command to work with the installed java package. Therefore edit the file /usr/local/bin/matlab. Open a Terminal and open the file as follows

robocup@devpcX:~$ su
root@devpcX:/home/robocup# cd /usr/local/bin
root@devpcX:/usr/local/bin# gedit matlab

Add the following at line 183 just after all the comments

export MATLAB_JAVA=/usr/lib/jvm/java-6-sun-

Save and close the file. Now you can start matlab. Always start matlab as a superuser/root so

robocup@devpcX:~$ su
root@devpcX:/home/robocup# matlab

Change mex options

In this section we change the options for the matlab function mex in order to be able to build the Tech United software lateron. If matlab is started type the following

>> mex -setup

Choose for option 2, Template Options file for building gcc MEX-files. Matlab reports that a file is created in the folder /root/.matlab/R2007b. Check if it is placed in the prementioned folder. If this is not the case, you probably did not start matlab as a superuser and therefore the file is placed in /home/robocup/.matlab/R2007b, which is incorrect. If this is the case restart matlab as a superuser and do the same again. Open the file /root/.matlab/R2007b/ with the editor of matlab and remove the -ansi option from the CFLAGS options on line 57 and 65. Add the option -W on line 57 and 65 to show warnings during compilation. Save and close the file.

Install linux kernel

Since the Tech United software is based on the linux kernel we need to install this kernel. Therefore, make sure to have a working internet connection. Open the webbrowser Mozilla and go to the FTP site and download the file linux- to your desktop. Extract the file by right-clicking and chosing extract here. To move the folder linux- from your desktop to /usr/src open a Terminal and type

robocup@devpcX:~$ su
root@devpcX:/home/robocup# cd Desktop
root@devpcX:/home/robocup/Desktop# mv linux- /usr/src

Now obtain the .config file needed for the compilation of the kernel from another devpc and put it into the folder /usr/src/linux- Now your are ready to compile the linux kernel. Here we will make debian packages of the kernel, *.deb files, such that they can be easily installed and uninstalled from your current installation. Open a Terminal and proceed as follows

robocup@devpcX:~$ su
root@devpcX:/home/robocup# cd /usr/src/linux-
root@devpcX:/usr/src/linux- make-kpkg --initrd binary-arch

The compilation will approximately take one hour. After that, two debian packages are created in /usr/src, namely linux-image- and linux-headers- Open the file browser Nautilus from Places, Computer and go to /usr/src/ and double-click the first one. Enter the password and install the package. Do the same for the second one. Finally, restart your PC. During rebooting you will see that there are now two more GRUB options from which the default is now the new linux kernel Once booted, you can check the kernel version in a Terminal

robocup@devpcX:~$ uname -r

It should be


In the startup script set the maximum transfer unit of the GigE ethernet card to 9200 kilobytes. This can be done as

robocup@devpcX:~$ su
root@devpcX:/home/robocup# ifconfig eth0 mtu 9200

where eth0 is the GigE ethernet port.

Personal tools