ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Catkin - ROS CrossCompiling

asked 2015-05-05 17:24:30 -0500

MarkSchmidt gravatar image

I'm currently trying to compile a simple ROS node for use on a BBB (BeagleBoard Black). The computer I'm compiling with and the BBB are both running Ubuntu 14.04 and ROS Indigo. I can compile the ros application (using Catkin) to run on my laptop and I can compile non-ROS applications (using terminal commands) that run on the BBB. Now my goal is to combine the two.

The command I use to compile for the BBB works great for files that don't include ROS.

arm-linux-gnueabihf-g++ -mfloat-abi=hard -o "$outputFile" "$CWD"/"$sourceFile"

However, the command line doesn't work quite as well when i try to use ROS. Tons of file/header dependancy issues. (If command line compiling is an approach worth trying, let me know and I'll post the errors I have here.)

Instead I was hoping to instruct catkin to use the compiler just as i did in the terminal. I tried adding the following lines to my CMakeLists.txt file in my package.

set(CMAKE_CXX_COMPILER "arm-linux-gnueabihf-g++")
set(CFLAGS "-mfloat -abi=hard")

The result is the following error

Linking CXX executable /home/user/code/ros_ws/devel/lib/leapMotionListener/leapMotionListener_node
/opt/ros/indigo/lib/libroscpp.so: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
make[2]: *** [/home/user/code/ros_ws/devel/lib/leapMotionListener/leapMotionListener_node] Error 1
make[1]: *** [project/CMakeFiles/leapMotionListener_node.dir/all] Error 2
make: *** [all] Error 2
Invoking "make -j4 -l4" failed

At this point I'm stuck where I can get further with these problems until I figure out what's going wrong. If there are any files I should put online to help let me know. Thanks for any suggestions/help/explanations, I greatly appreciate it!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-05-06 02:02:49 -0500

Wolf gravatar image

You are trying to link the roslib, compiled for your laptop architecture, with your generated arm exec (compiled for your arm architecture). If you want to cross-compile the relevant parts of ros (apparently you will at least need roscpp package) from source on your laptop and than, when cross-compiling your package you have to make sure it is linked against the other ros packages you cross-compiled before and not against the ros packages you installed to run on your laptop....

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2015-05-05 17:24:30 -0500

Seen: 2,256 times

Last updated: May 06 '15