Skip to content
Adam YH Lee edited this page Jul 30, 2015 · 23 revisions

This article should get users started with ROS (ROS.org) on Gumstix COMs. The objective of this article is to introduce the ROS installation method on the Gumstix using the Yocto Project framework to users who are already familiar with ROS in desktop environment.

Why read on?

Unlike x86 systems, running ROS on embedded devices like the Gumstix used to be a challenge. Different solutions and methods became available over time, but they were difficult to setup and/or maintain. This article presents a method that is maintainable, reproducible and standardized. After following this article, you will have done these followings:

  1. Use the Gumstix package repository to install ROS on an existing Gumstix Linux system, or use the Gumstix Yocto Project to build an image from scratch that includes ROS.
  2. Run a ROS demo application that talks across the network.

Ingredients:

  • Gumstix Yocto Project The Yocto Project allows the creation of custom Linux distributions for embedded systems, including Gumstix-based systems.
  • meta-ros: Cross compiling ROS for ARM devices used to be out of question. The meta-ros layer, as a part of the Yocto Project framework, solves this problem by providing the ROS specific build framework for ARM devices.
  • roscpp-tutorials: Learning ROS with the roscpp_tutorials package is a great start - it attempts to show the features of ROS.
  • Gumstix COM (Overo, Duovero, Pepper): Your choice!
  • (Optional) Master ROS node: This could be your workstation or a 2nd Gumstix COM. ROS is a distributed system and usually robots are the clients. Note that this is optional. You can run both master and client nodes on a single Gumstix COM.

##Getting ROS on your COM There are two approaches. One-time, on-system setup will set you up with the basic ROS environment on your COM with little effort. It will use the Gumstix Package repository to install ROS. Note that not all ROS packages are available from Gumstix package repository. So it is recommended that you also try the Expert Way in the following section to build your own image from scratch.

One-time On-System Setup

  1. Get the latest image from Gumstix Getting Started. Either XFCE or the console image will work.

  2. Boot your COM, and update meta data of the package repository

    $ smart update
    
  3. Install ROS packages from the package repository

    smart install \
        packagegroup-ros-comm \ 
        python-wstool \
        python-email \
        python-distutils \
        git \
        git-perltools \
        python-rosinstall \
        rospy-tutorials \
        roscpp-tutorials \
        screen \
    

Build an image from scratch

After setting up the Gumstix Yocto Project repo, add these packages to gumstix-console-image.bb

packagegroup-ros-comm \
python-wstool \
python-email \
python-distutils \
git \
git-perltools \
python-rosinstall \
rospy-tutorials \
roscpp-tutorials \
screen \

and bitbake.

##The Fun Part At this point you can boot the COM. Make sure these environment variables are set before you go further:

export ROS_ROOT=/opt/ros/indigo
export PATH=$PATH:/opt/ros/indigo/bin
export LD_LIBRARY_PATH=/opt/ros/indigo/lib
export PYTHONPATH=/opt/ros/indigo/lib/python2.7/site-packages
export ROS_MASTER_URI=http://<<MasterNodeIP>>:11311
export CMAKE_PREFIX_PATH=/opt/ros/indigo
touch /opt/ros/indigo/.catkin

On the master node (this could be your workstation or a Gumstix), run roscore and the listener program:

    $ roscore

On another terminal:

    $ rosrun roscpp_tutorials listener

roscore is required for ROS nodes to communicate with one another. The listener app is a demo application which listens to talker.

On your COM, make sure to configure the ROS environment variables again as above, and then start the talker node!

    $ rosrun roscpp_tutorials talker

If all worked out well, you should see the following:

On your Gumstix COM

root@duovero:~$  rosrun roscpp_tutorials talker
[ INFO] [946685885.626978428]: hello world 3
[ INFO] [946685885.726984541]: hello world 4
[ INFO] [946685885.826960135]: hello world 5

On your ROS master's terminal window:

root@duovero:~$ rosrun roscpp_tutorials listener
[ INFO] [1398449577.583563416]: I heard: [hello world 3]
[ INFO] [1398449577.683447030]: I heard: [hello world 4]
[ INFO] [1398449577.783366976]: I heard: [hello world 5]

Here the talker app is sending messages to the listener app! In other words, the client node and the master node are communicating using the ROS framework.

##Where to go from here?

Guys at the BMW Car IT group have put tremendous effort into making ROS more readily available for ARM devices in the past year. You can add the ROS packages you need to the gumstix-console-image.bb like you did in the Build ROS section. I recommend exploring the meta-ros tree to see what's available. However, while they are working hard to make more ROS packages available everyday, you may not find all the necessary packages ready to go in meta-ros. In such case, you can help out the project by creating a recipe for the package, or ask nicely in https://github.com/bmwcarit/meta-ros/issues?state=open

##Getting help