0
$\begingroup$

Rosanswers logo

hi, I'm trying to run a ROS application on an embedded device, specifically a Freescale i.MX53 Cortex A8 processor. I figured I'd try something simple like the "talker" and "listener" sample code, and have the "talker" run on the Cortex and "listener" run on Ubuntu. (I've compiled and ran talker and listener on Ubuntu and it works). I've only had a little experience with ROS and zero experience cross-compiling anything.

there is an eclipse-based IDE for developing application for the Cortex that came with the application kit. so there is a folder that the executables for the compilers.

from what I can tell, you need to add a rostoolchain.cmake file to $ROS_ROOT. I've done that and here is the contents:

# An example for using the gumstix arm-linux toolchain is below.
# Copy these lines to $(ROS_ROOT)/rostoolchain.cmake to try them out.
#
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_C_COMPILER /usr/local/DigiEL-5.9/x-tools/arm-cortex_a8-linux-gnueabi/bin/arm-cortex_a8-linux-gnueabi-gcc)
set(CMAKE_CXX_COMPILER /usr/local/DigiEL-5.9/x-tools/arm-cortex_a8-linux-gnueabi/bin/arm-cortex_a8-linux-gnueabi-g++)
set(CMAKE_FIND_ROOT_PATH /usr/local/DigiEL-5.9/x-tools/arm-cortex_a8-linux-gnueabi/bin)
 #Have to set this one to BOTH, to allow CMake to find rospack
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

when I make, I get thousands of errors that make no sense to me.

So, I figure that I should repeat something that has been advertised as working, which is to cross-compile for Gumstix (which also uses a Cortex processor). I did :

  1. sudo apt-get install gcc-arm-linux-gnueabi

  2. sudo apt-get install g++-arm-linux-gnueabi

  3. modified the cmake file:

    An example for using the gumstix arm-linux toolchain is below.

    Copy these lines to $(ROS_ROOT)/rostoolchain.cmake to try them out.

    set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_C_COMPILER /usr/bin/arm-linux-gnueabi-gcc) set(CMAKE_CXX_COMPILER /usr/bin/arm-linux-gnueabi-g++) set(CMAKE_FIND_ROOT_PATH /usr/bin) #Have to set this one to BOTH, to allow CMake to find rospack set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

when I make, I only get 1 error:

/opt/ros/fuerte/lib/libroscpp.so: file not recognized: File format not recognized
collect2: ld returned 1 exit status
make[3]: *** [../bin/talker] Error 1
make[3]: Leaving directory `/home/mvalvo/fuerte_workspace/sandbox/beginner_tutorials/build'
make[2]: *** [CMakeFiles/talker.dir/all] Error 2
make[2]: Leaving directory `/home/mvalvo/fuerte_workspace/sandbox/beginner_tutorials/build'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/mvalvo/fuerte_workspace/sandbox/beginner_tutorials/build'
make: *** [all] Error 2

Can you offer any guidance on this?

thanks, Mike


Originally posted by mvalvo on ROS Answers with karma: 11 on 2013-08-06

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

It looks like you're trying to compile on top of the native binary installation that you already have installed.

The basic problem is that you're trying to build ARM binaries that link against the ROS libraries that are compiled for x86. Your environment is "dirty" in the sense that it is trying to link against binaries with the wrong architecture.

You need to do a complete cross-compile of Fuerte from source; you can get started with the Fuerte installation from source instructions, but you'll probably want to use google to look around for advice from other people at well. http://www.ros.org/wiki/fuerte/Installation/Ubuntu/Source

Cross-compiling Fuerte is not something that I would recommend for someone new to ROS, Linux and CMake; I would strong suggest upgrading to a newer version of ROS that has better ARM support instead.

If you're ok using Groovy, you may want to look into the binary builds of Groovy for Ubuntu ARM: http://ros.org/wiki/groovy/Installation/UbuntuARM


Originally posted by ahendrix with karma: 47576 on 2013-08-06

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by mvalvo on 2013-08-06:
I don't understand your comment. I should probably mention that I am a novice to ROS, linux, and CMake. in the folder ~/fuerte_workspace/sandbox/beginner_tutorials, there is a Makefile. I do "make clean" and then "make". Is that not the regular compile syntax? I have to use Fuerte, so Groovy is not an option. how do I know if I have a "dirty" environment? how do I make it "clean"

Comment by ps4321 on 2013-08-12:
I have the exact same issue on Groovy. The cross-compilation does not (always?) use the target files, but the host files. Also in some cases it doesn't even add the necessary include path (e.g. for boost).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.