Thursday, August 7, 2008

Setting up the eee PC

For the eee PC to function as the robot's computer, it needs several things:
  1. A fully-featured development tools set, including gcc, make and the standard libraries. These are not installed by default on the stock eee Xandros system.
  2. A regular Linux desktop, with the ability to easily control settings and active devices.
  3. A working install of OpenCV - the Open Computer Vision library, which forms the basis of all my vision code.
  4. The usual extra tools, like a decent text editor, image editor, and video codecs.
The default eee PC interface is a launcher-style tabbed menu. It has a terminal and a file browser, but it's not well-suited to development use. Fortunately, there's an "Advanced Mode" which is just a version of the KDE linux desktop. Instructions for installing and invoking his mode are on the eeeUser wiki: here. Use method #1, "the Easy Way". Do not use method #4. I tried that first and it prevented the system from booting up properly.

** EDIT: The following turned out to be BAD IDEA. Correction Below. ** [ To install the dev tools, follow the instructions on this blog. The short version is to add the main debian repository for the apt-get package manager. With that as a source, apt-get can download and install the package called build-essential, which contains compilers, linkers, debuggers, build tools, and all that good stuff.] ** End Bad Idea **

Installing Debian packages can cause all sorts of incompatibilities, so don't do the above. Instead, install Xandros packages onto your Xandros-based eeePC. What logic. Anyway, the right instructions are here. Once you've set up apt-get to pull software from the Xandros repositories, you can then use the console to run the following commands:

> sudo apt-get install build-essential
> sudo apt-get install pkg-config

This will install compilers such as gcc, build tools, and all the other stuff you need to write/compile software.

Now that you have gcc and all the rest, you can download the OpenCV source from its page on sourceforge. For me, OpenCV installed without a hitch. The final glitch is that any program that uses OpenCV needs to know where to find the OpenCV runtime libraries. The installer placed the libraries in /usr/local/lib/, so I added the line:

export LD_LIBRARY_PATH=/usr/local/lib

to the end of the file ".bash_profile" in th main user's home directory. This sets up the dynamic link path so that the shell can pass this on to the executable and it can find the libraries. Now your executables will run.

2 comments:

JMSCHARFF2 said...

I don't know what problems you had with adding the debian repositories on your eee, the instructions left on my blog were for the default Xandros model and many people have followed them to get gcc and many other programs working...what errors did you recieve

Matt said...

I'm following the advice on the eeeUser wiki: http://wiki.eeeuser.com/addingxandrosrepos which states that there can be compatibility issues when using Debian packages on Xandros. If this is incorrect please explain. The major issue I had was once I installed build-essential from the debian repos, I ended up with Kernel headers that were a different version from the Kernel itself, which prevented me from compiling any modules.