[Documentation] [TitleIndex] [WordIndex

Running ROS on Neo Freerunner smart phone

neoros.png

The OpenMoko Neo Freerunner is an 'OpenSource' mobile phone. Or a mini Linux PC! It's a very attractive unit for robotics. It has 400Mhz ARM Processor, 128 MB Ram and a lot of features useful on a robot (GPS, WiFi, Accelerometers, USB, Bluetooth, ...) if lightweight and very small compared to a netbook, yet it features a sufficient large display with a resolution of 640x480 pixels (For more detailed specs see here). There are different distribution available to be installed on the OpenMoko Freerunner. I usually had a QtMoko installed on the phone's flash, and a pure Debian to be booted from the µSD card. A while ago I managed to compile ROS for debian on the Freerunner and had it moving some servos talking via usb-serial to a micro controller. Recently I wanted to update the debian installation as well as the ROS on the phone to diamondback. Unfortunately the debian on freerunner installer (described here) was broken, because of dependency problems, not so suprising as the installation is based on the bleeding edge debian sid. So I looked for alternatives. The way I describe here starts with an QtMoko installation on the µSD, based on debian lenny.

Requirements:

Assuming your Freerunner is fresh out of the box, it comes with the standard operating system on the 256 Mb internal flash and the u-boot bootloader. However, later we want to boot a QtMoko installation from the µSD card, so we have to install the qi-bootloader. Don't worry about breaking something, the Freerunner has two bootloaders, one unchangeable (u-boot on NAND flash) and replaceable on NOR flash.

Flashing the bootloader and extracting the filesystem:

$ sudo apt-get install dfu-util

Now we perform the steps as described here. Download the latest versions of qi and the .tar.gz of the root file system from here. Start up the Freerunner into the NAND boot menu by pressing (and holding) the AUX button (the wide one) and pressing the power button (the small round one). Connect the phone via USB with the host. Now flash the bootloader onto the phone with:

$ sudo dfu-util -a u-boot -R -D name_of_qi_image

. The tar needs to be extracted onto the µSD card. If your PC has a card reader, insert the card, format it to ext3 (if you don't know how, install gparted [apt-get install gparted] and start it with root privileges [ALT+F2, then run gksu gparted]). If your PC does not have a card reader, you can boot into the standard operating system of the phone with the µSD card in it and work from there. After formatting extract the filesystem onto the card. At the end of this step you should put (or keep) the formatted card with the root file system extracted on it in the phone's slot.

Preperations in QtMoko:

Shutdown the phone and boot into the new system by shortly pressing the power button. If everything went fine so far the phone QtMoko will guide you through some initial setup (after a long first boot of several minutes!). Now it's time too remotely connect to the phone, except you want to spent the next hours ticking keys of the virtual mini keyboard! It is possible to connect via USB-networking (see here). As we need internet access on the phone anyway, I prefer connecting WiFi. Enter the QtMoko main menu, by clicking the Q-icon. Now hit the settings icon in the lower left and open the 'internet' entry. It's not very intuitive, but I'm sure you will figure out how to connect to your wireless LAN. Once connected open the terminal from the program menu and type 'ifconfig' if you are not sure what ip address was assigned to the phone. Check the ip for eth0. Now connect via ssh:

$ ssh root@999.999.9.999

(with your ip, of course, instead of 9's!)

When successfully connected, we need to check which debian version the QtMoko is based on. To properly install diamondback we need python2.6, which is not in debian lenny. So depending on the version of QtMoko, you might need to do the following:

$ nano /etc/apt/sources.list

Change 'lenny' to 'squeeze' for all entries. Then:

$ apt-get update and apt-get upgrade.

Now install the newer python package and other needed ones with:

$ apt-get install python2.6 python-yaml sudo

I had to mess the update-alternatives, to make python2.6 my standard python:

$ mv /usr/bin/python /usr/bin/python.backup
$ update-alternatives --install python2.6 python /usr/bin/python2.6 2
$ update-alternatives --install python2.5 python /usr/bin/python2.5 1
$ sudo ln -s /etc/alternatives/python /usr/bin/python

(see here)

Now check if it worked:

$ python --version

Should yield 2.6.

We're almost done with preparing for the installation. The coming processes will eat some memory and fail hitting the freerunner's limit of 128MB. So we must create a swapfile to allow the OS to swap around memory contents. This is done rather easy as described here. I made a 1GB file, to be sure it's large enough.

$ dd if=/dev/zero of=/swapfile bs=1024 count=1000000 #This might take 10-15min
$ mkswap /swapfile
$ swapon /swapfile

ROS Installation:

Now you should have a system on which diamondback can be installed exactly like in the normal debian instructions. For convenience you can read on here, I will summarize the basic steps.

As mentioned in the debian installation guide I had to override the OS identification string:

$ export ROS_OS_OVERRIDE=debian:squeeze

We must get some packages now:

$ apt-get install build-essential python-yaml cmake subversion wget python-setuptools mercurial

Now we can call:

$ easy_install -U rosinstall

Then I chose the ROS-full installation option:

$ rosinstall ~/ros "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=diamondback&variant=ros-full&overlay=no"

The script will get some more packages and asked you for permissions. But once you see rosmake starting to compile stuff, you can definitely fetch a coffee, as this might take a while. If everything passed: Congratualtions! You now have a mini-PC running the newest version of ROS. Even running the GUI-tools like rxgraph should work. In the future I will have a look at getting the GPS working with the existing ROS packages.


2024-11-16 14:38