Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 39

How to link with ros ARM libraries when cross compiling?

$
0
0
Hello, I am cross compiling for the raspberry pi, on my Ubuntu 12.04 machine with ROS hydro. I am almost there, but am still unable to link to the proper (ARM native) ROS libraries when cross-compiling. I have a nodelet that is dependent on several ros libraries, including actionlib. I also have installed ROS on the raspberry pi natively ([Setting up Hydro on RaspberryPi](http://wiki.ros.org/ROSberryPi/Setting%20up%20Hydro%20on%20RaspberryPi)), and copied those libraries to the buildroot of my cross-compile on my Ubuntu machine (set to ~/rpi/rootfs). However, I cannot get Catkin and CMake to link to those ros libraries in the buildroot, instead it always tries to use the ones in /opt/ros/hydro. The error is: > Linking CXX shared library... > /opt/ros/hydro/lib/libactionlib.so: could not read symbols: File in wrong format collect2: ld returned 1 exit status So, the linker is trying to link with the libactionlib.so in /opt/ros/hydro, when, it should link to the libactionlib.so in my buildroot folder. I have setup a toolchain.raspi.cmake that looks like this: set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_C_COMPILER arm-linux-gnueabi-gcc) set(CMAKE_CXX_COMPILER arm-linux-gnueabi-g++-4.4) set(CMAKE_FIND_ROOT_PATH $ENV{HOME}/rpi/tools/arm-bcm2708/arm-bcm2708-linux-gnueabi/arm-bcm2708-linux-gnueabi/sysroot $ENV{HOME}/rpi/rootfs $ENV{HOME}/rpi/rootfs/e2fsprogs-1.42.9 $ENV{HOME}/rpi/rootfs/usr $ENV{HOME}/rpi/rootfs/usr/lib $ENV{HOME}/rpi/rootfs/usr/include $ENV{HOME}/rpi/ros_catkin_ws/install_isolated) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) I have also tried running the following script, before running catkin_make, to no avail: #!/usr/bin/env sh export ROS_PACKAGE_PATH=/home/uav/catkin_ws:/home/uav/rpi/ros_catkin_ws/install_isolated export ROS_ROOT=/home/uav/rpi/ros_catkin_ws/install_isolated export LD_LIBRARY_PATH=/home/uav/rpi/ros_catkin_ws/install_isolated/lib:$LD_LIBRARY_PATH export PKG_CONFIG_PATH=/home/uav/rpi/ros_catkin_ws/install_isolated/lib/pkgconfig:$PKG_CONFIG_PATH export CMAKE_PREFIX_PATH=/home/uav/rpi/ros_catkin_ws/install_isolated:$CMAKE_PREFIX_PATH Also, my catkin_make looks like this: catkin_make_isolated --cmake-args -DCMAKE_TOOLCHAIN_FILE=/home/uav/rpi/toolchain.raspi.cmake -DBoost_INCLUDE_DIR=/home/uav/rpi/rootfs/usr/include Is this an overlay issue? What do I need to do to get Catkin to link to the ROS libraries in the buildroot (for the raspi) and not in /opt/ros/hydro? Another note, I got to this point because when I tried to run the nodelet on the raspi, it could not be loaded. Another post suggested that I explicitly link to the catkin_libraries in the CMakeLists.txt of the nodelet: target_link_libraries(my_nodelet ${catkin_LIBRARIES} ) Thanks in advance!

Viewing all articles
Browse latest Browse all 39

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>