Ask Your Question
2

Cross-Compiling ROS for the Nao Ubuntu 12.04 and fuerte

asked 2012-07-09 21:57:26 -0500

Markus Bader gravatar image

updated 2014-01-28 17:12:58 -0500

ngrennan gravatar image

Problem on starting the roscore on a Nao v3

Thanks to Daniel Maier there is a ros wiki page how to compile cross compile ROS for a NAO with a Geode processor. But I the description is not up-to-date and I have problems with the following constellation:

The environment

  • Ubuntu 12.04 (32bit)
  • Nao V3.x (NaoQi 1.12.5)
  • ROS fuerte

Is there someone who has a nice "how to" recipe?

My error messages

With my recipe below I am getting the following error on starting the roscore at the Nao robot:

Traceback (most recent call last):
  File "/home/nao/ros-cross/ros/fuerte/bin/roscore", line 4, in <module>
    import pkg_resources
ImportError: No module named pkg_resources

or on starting rospack

rospack: error while loading shared libraries: libboost_system.so.1.46.1: cannot open shared object file: No such file or directory

My recipe which does not work! Not yet :-)

This is my recipe but it does not work --> it differs to the original wiki-description by an other installation path and it just compiles the roscore with no extra stuff.

# set environment variables 
export ROS_CROSS_ROOT=/home/nao/ros-cross #this is where ROS will be installed to, see below
export ROS_CROSS_DIR=$ROS_CROSS_ROOT/ros #this is where ROS will be installed to, see below
export AL_DIR="$HOME/opt/v.1.12.5-RoboCup/naoqi"
export CTC_DIR="$AL_DIR/crosstoolchain" # path to Aldebaran's cross-compilation toolchain (CTC)
export GEODE_CXX=$CTC_DIR/cross/bin/i686-pc-linux-gnu-g++
export GEODE_CC=$CTC_DIR/cross/bin/i686-pc-linux-gnu-gcc
export LD_LIBRARY_PATH= # just to be sure

ll $GEODE_CXX    # just to test the path
ll $GEODE_CC     # just to test the path

sudo mkdir -p $ROS_CROSS_ROOT
sudo chown -R $USER $ROS_CROSS_ROOT
cd $ROS_CROSS_ROOT

#fuerte
rosinstall --catkin $ROS_CROSS_ROOT/ros-underlay http://ros.org/rosinstalls/fuerte-ros-base.rosinstall

cp $ROS_CROSS_ROOT/ros-underlay/ros/core/rosbuild/rostoolchain.cmake $ROS_CROSS_ROOT/ros-underlay/ros/core/rosbuild/rostoolchain.cmake.bak
echo "include(\"$CTC_DIR/toolchain-geode.cmake\")" >> $ROS_CROSS_ROOT/ros-underlay/ros/core/rosbuild/rostoolchain.cmake
echo "include_directories(\"$ROS_CROSS_DIR/ros-deps/include\")" >>  $ROS_CROSS_ROOT/ros-underlay/ros/core/rosbuild/rostoolchain.cmake
echo "link_directories(\"$ROS_CROSS_DIR/ros-deps/lib\")" >>  $ROS_CROSS_ROOT/ros-underlay/ros/core/rosbuild/rostoolchain.cmake


gedit ./ros/core/rosbuild/private.cmake
# --> replace find_file(_file_name ${file} ${PROJECT_SOURCE_DIR} /) with find_file(_file_name ${file} ${PROJECT_SOURCE_DIR} / NO_CMAKE_FIND_ROOT_PATH)

cd $ROS_CROSS_ROOT/ros-underlay
mkdir build
cd build
cmake -D CMAKE_INSTALL_PREFIX=$ROS_CROSS_DIR/fuerte ..
make install
source $ROS_CROSS_DIR/fuerte/setup.sh
rosmake ros

#rosinstall $ROS_CROSS_DIR/fuerte/stacks "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=fuerte&variant=desktop&overlay=no"
cd rosinstall $ROS_CROSS_DIR/fuerte/stacks "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=fuerte&variant=ros-base&overlay=no"

rsync -zrptLv --delete-after -e "ssh" --exclude 'ros-underlay' --exclude 'boost' $ROS_CROSS_ROOT nao@IP-ROBOT:./

Thanks Max

edit retag flag offensive close merge delete

Comments

did you test running roscore in your computer within your current ros installation path before copying to the robot?

ryann2k1 gravatar image ryann2k1  ( 2013-05-20 22:13:07 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2012-09-10 13:53:17 -0500

LeonardoLeottau gravatar image

Hi, I am using the newer Nao too. I decided to install ROS electric (desktop), ubuntu 10.04 with the atom toolchain 1.12.5. Today it compiles onto the pc. Buuut, ROS still doesnt run into the NAO. I attatch you my environment path bash with two boost paths that I included and solved a similar problem with boost.

#!/bin/sh
# set some environment variables for compiling
export TARGETDIR=~ #this is where ROS will be installed to, see below
export CTC_DIR=/path/to/nao-cross-toolchain-dir/nao-atom-cross-toolchain-1.12.5.3_2012-06-03 # path to Aldebaran's cross-compilation toolchain (CTC)
export ATOM_CXX=$CTC_DIR/cross/bin/i686-pc-linux-gnu-g++
export ATOM_CC=$CTC_DIR/cross/bin/i686-pc-linux-gnu-gcc
export ROS_BOOST_ROOT="${CTC_DIR}/sysroot/usr"
export ROS_BOOST_VERSION="1.45.0"
export LD_LIBRARY_PATH= # just to be sure
echo Paths seteados correctamente...
edit flag offensive delete link more
0

answered 2012-10-09 02:05:24 -0500

Markus Bader gravatar image

updated 2012-10-09 02:12:31 -0500

Hi

I got it working but with Ubuntu 10.04 because I had the following problems

  • The rosinstall checks the current installed python version which is 2.7 on ubuntu 12.04 but on the Nao runs 2.6. I had to copy ceartain python files to the Nao
  • I was not able to force ROS to use a certain boost installation because of that many the boost lib has to copied as well.

One can use the following recipe but I would be nice to find fixes for the named problems.

Greetings
Markus


# set environment variables 
export ROS_CROSS_ROOT=/home/nao/ros-cross #this is where ROS will be installed to, see below
export ROS_CROSS_DIR=$ROS_CROSS_ROOT/ros #this is where ROS will be installed to, see below
export AL_DIR="$HOME/opt/v.1.12.5-RoboCup/naoqi"
export CTC_DIR="$AL_DIR/crosstoolchain" # path to Aldebaran's cross-compilation toolchain (CTC)
export GEODE_CXX=$CTC_DIR/cross/bin/i686-pc-linux-gnu-g++
export GEODE_CC=$CTC_DIR/cross/bin/i686-pc-linux-gnu-gcc
export LD_LIBRARY_PATH= # just to be sure

ll $GEODE_CXX    # just to test the path
ll $GEODE_CC     # just to test the path

sudo mkdir -p $ROS_CROSS_ROOT
sudo chown -R $USER $ROS_CROSS_ROOT

#fuerte
cd $ROS_CROSS_ROOT
rosinstall --catkin $ROS_CROSS_ROOT/ros-underlay http://ros.org/rosinstalls/fuerte-ros-base.rosinstall

cp $ROS_CROSS_ROOT/ros-underlay/ros/core/rosbuild/rostoolchain.cmake $ROS_CROSS_ROOT/ros-underlay/ros/core/rosbuild/rostoolchain.cmake.bak

echo "#######################    Nao CTC    #######################" >> $ROS_CROSS_ROOT/ros-underlay/ros/core/rosbuild/rostoolchain.cmake
echo "include(\"$CTC_DIR/toolchain-geode.cmake\")" >> $ROS_CROSS_ROOT/ros-underlay/ros/core/rosbuild/rostoolchain.cmake
echo "include(\"$CTC_DIR/toolchain-geode.cmake\")" >> $ROS_CROSS_ROOT/ros-underlay/ros/core/rosbuild/rostoolchain.cmake
echo "include_directories(\"$ROS_CROSS_DIR/ros-deps/include\")" >>  $ROS_CROSS_ROOT/ros-underlay/ros/core/rosbuild/rostoolchain.cmake
echo "link_directories(\"$ROS_CROSS_DIR/ros-deps/lib\")" >>  $ROS_CROSS_ROOT/ros-underlay/ros/core/rosbuild/rostoolchain.cmake

# echo "include_directories(\"$ROS_CROSS_ROOT/usr/include\")" >>  $ROS_CROSS_ROOT/ros-underlay/ros/core/rosbuild/rostoolchain.cmake   
# echo "link_directories(\"$ROS_CROSS_ROOT/usr/lib\")" >>  $ROS_CROSS_ROOT/ros-underlay/ros/core/rosbuild/rostoolchain.cmake

gedit $ROS_CROSS_ROOT/ros-underlay/ros/core/rosbuild/private.cmake
# --> replace find_file(_file_name ${file} ${PROJECT_SOURCE_DIR} /) with find_file(_file_name ${file} ${PROJECT_SOURCE_DIR} / NO_CMAKE_FIND_ROOT_PATH)


cd $ROS_CROSS_ROOT/ros-underlay
mkdir $ROS_CROSS_ROOT/ros-underlay/build
cd $ROS_CROSS_ROOT/ros-underlay/build
cmake -DCMAKE_INSTALL_PREFIX=$ROS_CROSS_DIR/fuerte  ..
make install
source $ROS_CROSS_DIR/fuerte/setup.sh
rosmake ros

rosinstall $ROS_CROSS_DIR/fuerte/stacks "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=fuerte&variant=ros-base&overlay=no"

export NAO_IP=10.0.1.203
# ssh nao@$NAO_IP mkdir -p .ssh
# ssh-keygen -t rsa 
# cat ~/.ssh/id_rsa.pub | ssh nao@$NAO_IP 'cat >> .ssh/authorized_keys'
rsync -rv /usr/lib/python2.6/dist-packages $ROS_CROSS_ROOT/ros/fuerte/lib/python2.6/ #on ubuntu 10.04
rsync -zrptLv --delete-after -e "ssh" --exclude 'ros-underlay' --exclude '3rdParty' $ROS_CROSS_ROOT nao@$NAO_IP:./

scp /usr/lib/libboost_*1.40* nao@$NAO_IP:./ros-cross/usr/lib
scp /usr/lib/libicudata.so.42 nao@$NAO_IP:./ros-cross/usr/lib
scp /usr/lib/libicui18n.so.42 nao@$NAO_IP:./ros-cross/usr/lib
scp /usr/lib/libicuuc.so.42 nao@$NAO_IP:./ros-cross/usr/lib
scp /usr/lib/liblog4cxx.so.10 nao@$NAO_IP:./ros-cross/usr/lib
scp /usr/lib/libaprutil-1.so.0 nao@$NAO_IP:./ros-cross/usr/lib
scp /usr/lib/libapr-1.so.0 nao@$NAO_IP:./ros-cross/usr/lib
scp /usr/lib/libapr-1.so.0 nao@$NAO_IP:./ros-cross/usr/lib ...
(more)
edit flag offensive delete link more

Comments

Error when executing " rosinstall $ROS_CROSS_DIR/fuerte/stacks "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=fuerte&variant=ros-base&overlay=no" but when i change "fuerte&variant=ros-base&overlay=no" to "fuerte&variant=desktop&overlay=no", it can be executed successfully. any idea?

ryann2k1 gravatar image ryann2k1  ( 2013-08-01 18:59:33 -0500 )edit

error: (Over-)Writing /home/nao/ros-nao/ros/fuerte/stacks/.rosinstall (Over-)Writing setup.sh, setup.bash, and setup.zsh in /home/nao/ros-nao/ros/fuerte/stacks ERROR in rosinstall: No 'ros' stack detected in candidates []. Please add the location of a ros distribution to this command.

ryann2k1 gravatar image ryann2k1  ( 2013-08-02 00:25:12 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2012-07-09 21:57:26 -0500

Seen: 711 times

Last updated: Oct 09 '12