Note: This tutorial assumes that you have completed the previous tutorials: Adding ROS to the Image.
(!) Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

Yocto: Setup on the Galileo Board

Description: Set up on the Galileo Board

Tutorial Level: INTERMEDIATE

Next Tutorial: Adding Packages from the host Adding packages from the host

ROS setup on the Galileo board

The commands in this section are executed on the Galileo board itself. (SSH to the card)

The current version of ROS for openembedded puts all the ROS files in /usr. This causes some severe performance issues when ROS has to search this entire directory tree. This launch time can be reduced by editing /usr/lib/python2.7/site-packages/rospkg/rospack.py and making the loop in the list_by_path function (near line 41) look like this:

    ...
    for d, dirs, files in os.walk(path, topdown=True, followlinks=True):
        print "ROSPACK Checking directory %s                                       \r" % d,
        [dirs.remove(di) for di in dirs if di[0] == '.']
        [dirs.remove(di) for di in dirs if di == 'src' and d=="/usr"]
        [dirs.remove(di) for di in dirs if di == 'etc' and d=="/usr"]
        [dirs.remove(di) for di in dirs if di == 'include' and d=="/usr"]
        [dirs.remove(di) for di in dirs if di == 'locale' and d=="/usr/lib"]
        [dirs.remove(di) for di in dirs if di == 'perl' and d=="/usr/lib"]
        [dirs.remove(di) for di in dirs if di == 'perl5' and d=="/usr/lib"]
        [dirs.remove(di) for di in dirs if di == 'terminfo' and d=="/usr/share"]
        [dirs.remove(di) for di in dirs if di == 'man' and d=="/usr/share"]
        [dirs.remove(di) for di in dirs if di == 'oprofile' and d=="/usr/share"]
         if PACKAGE_FILE in files:
             ...

TODO: Make this into a patch that can be applied on the host before build. TODO: Also fix the c++ version of rospack.

Edit the file /usr/lib/python2.7/site-packages/roslaunch/launch.py, and change _TIMEOUT_MASTER_START to 20:

_TIMEOUT_MASTER_START = 20.0 

Create the the setup file setup_clanton.sh:

export ROS_ROOT=/usr
export ROS_MASTER_URI=http://clanton:11311
export CMAKE_PREFIX_PATH=/usr
export ROS_OS_OVERRIDE=debian:wheezy
source /usr/share/rosbash/rosbash

Execute it with:

bash
touch /usr/.catkin
source ~/setup_clanton.sh

Edit /etc/hosts to look like this:

127.0.0.1       clanton.localdomain             clanton

Make rosout:

rosmake rosout
mv /usr/lib/ros* /opt/ros/lib

Now you should be able to run roscore:

roscore

Previous: Adding ROS to the image | Next Adding packages from the host

Wiki: IntelGalileo/IntelGalileoYoctoSetupOnGalileo (last edited 2014-02-10 01:50:49 by JonStephan)