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 :
sudo apt-get install gcc-arm-linux-gnueabi
sudo apt-get install g++-arm-linux-gnueabi
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