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

Compile roscore for ARM board

asked 2014-08-23 11:43:55 -0600

I.T gravatar image

updated 2014-08-28 01:38:41 -0600

I have previously used ROS only on PC but found the use of rosbags for offline debugging to be convenient. I would now like to use ROS to record sensor data on an embedded ARM board running Linux. I wonder if it is possible to do this without doing a full ROS install on the board?

All I would need are nodes running on the board which can publish their sensor readings to topics and then a laptop on the same network can do the rosbag recordings.

I have a cross-toolchain set up for compiling executables for the board. The following document explains how to use a toolchain to compile libraries and ROS for ARM but it is not clear how to install it on the board once it's all compiled. ftp://ftp.heanet.ie/disk1/sourceforge/c/project/ca/carm/ROS%20cross-compile%20on%20ARM.pdf

If I manage to cross compile boost, apr, apr-utils, log4cxx and ROS (as mentioned in the above document) what do I get and how do I move it (and where?) to the ARM board?

Can I then later cross compile my ROS nodes, copy them to the board and simply run them, provided roscore runs on a laptop?

I hope this makes sense.

Update: I am using a Wandboard with custom compiled Linux version 3.10.17.

edit retag flag offensive close merge delete

Comments

If your board runs Ubuntu, you can try the binary installs of ROS Hydro or Indigo for ARM. Note that you don't have to do a full install; you can choose to install only the things you need.

ahendrix gravatar image ahendrix  ( 2014-08-23 13:51:00 -0600 )edit

The board does not run Ubuntu unfortunately...

I.T gravatar image I.T  ( 2014-08-24 04:27:35 -0600 )edit

Could you provide more information on what board you're using, and what OS it runs?

GummyBear gravatar image GummyBear  ( 2014-08-25 13:55:26 -0600 )edit

I added some info about board and OS at the end of the question.

I.T gravatar image I.T  ( 2014-08-28 01:39:45 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
8

answered 2014-10-06 13:45:02 -0600

GummyBear gravatar image

updated 2014-10-07 10:34:42 -0600

I realize this answer is coming probably a month too late for you, but if you're still working on cross compiling ROS, here's a few tips:

Don't follow those instructions you found, because they are very old and outdated. I started with that document, but quickly found it wasn't relevant. Basically, you want to cross-compile a bare-bones ROS from source and then cross compile your own ROS packages. I have done this exact thing with ROS Hydro, targeting an Odroid U3 running Ubuntu 12.11. I can outline the steps for you here, but since you have a different system, details will change. The way I figured things out, you basically need to have cross-compiled versions of the dependencies for anything you want to cross-compile. At some basic level, you will install a toolchain, which should include cross-compiled standard libraries. Many dependencies you will need to build yourself, however.

Here's what you're going to need to do:

Step 1. Install your cross compiling toolchain. I don't know anything about the Wandboard, but it may use the same cross compiler toolchain that I used for the Odroid; I know the beaglebone uses the same one (g++-arm-linux-gnueabihf)

Step 2. Cross compile ROS dependencies. For bare-bones ROS Hydro, I needed the following dependencies: boost (1.56.0), Python (2.7.3), Bzip2, Poco, uuid, libtinyxml. Depending on what ROS packages you need, you might have different dependencies.

Step 3. After you cross compile all of those packages, you need to cross compile ROS. You basically just follow the building ROS from source instructions ( http://wiki.ros.org/hydro/Installatio... ). The only major difference that you will have is when you build, you want to pass in a toolchain.cmake file, which will instruct cmake to use the cross compiling tools instead of your typical system tools. For a bare-bones ROS, use the following rosinstall_generator and wstool commands to get the necessary source code (modified for your needs, of course):

$ rosinstall_generator ros_comm <ros_pkg_1> <ros_pkg_2> ... <ros_pkg_n> --rosdistro hydro --deps --wet-only --tar > hydro-my_ros_config-wet.rosinstall

$ wstool init -j8 src hydro-my_ros_config-wet.rosinstall

Now, when you build ROS, you should use a rostoolchain.cmake file that looks something like this:

#File rostoolchain.cmake
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++)
set(CMAKE_FIND_ROOT_PATH /path/to/cross/compile/build/environment)

# 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)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

This file just tells cmake how to look for things it needs. Think about CMAKE_FIND_ROOT_PATH as the starting point for your system. Cmake won't search down any path that doesn't begin with CMAKE_FIND_ROOT_PATH. So if you have boost libraries installed on your system under /usr/lib and you also cross compiled boost to /home/user/crosscompile/boost/. If your CMAKE_FIND_ROOT_PATH is set to /home/user/crosscompile, then it can find the cross compiled boost, which is what you need if you want to cross ... (more)

edit flag offensive delete link more

Comments

@GummyBear I want to cross compile my custom ROS packages.Is it must cross compile ros,at first? My board can run roscore,but it achieve not by cross-compiler.Can I cross compile my own package wthout cross-compiling roscore?

Alice63 gravatar image Alice63  ( 2015-04-20 22:51:40 -0600 )edit

Alice, your custom ROS packages depend on ROS libraries, so you need the ARM version of those libraries to cross compile your packages. If you don't want to cross compile roscore, you could probably copy the ARM version of ROS to your build machine and link to that. I haven't tried that myself.

GummyBear gravatar image GummyBear  ( 2015-04-21 09:02:08 -0600 )edit

@GummyBear Hello again! I'm now at this again (one year later), but this time with an Odroid board. I posted a follow up question to this here

I.T gravatar image I.T  ( 2015-10-15 13:35:26 -0600 )edit

Thanks for your considerate guideline Have a nice day :)

collin gravatar image collin  ( 2016-12-29 23:55:54 -0600 )edit

Do you cross compile Python as well?

tanasis gravatar image tanasis  ( 2018-01-11 05:53:11 -0600 )edit
0

answered 2014-08-28 02:04:16 -0600

ahendrix gravatar image

This page has a number of Ubuntu images for the Wandboard: http://www.armhf.com/download/ - It should be relatively easy to follow the UbuntuARM instructions and get ROS up and running on top of one of those within a few hours.

This thread on the Wandboard mailing list has a few more suggestions about Ubuntu images to try.

Note that there are only builds of ROS for armhf - all of the recent ARM chips have hard-float support and armel was too slow to do anything interesting, so it has been phased out.

edit flag offensive delete link more

Comments

Thanks, but I wish to install ROS without changing the OS on my board, so this does not really answer the question...

I.T gravatar image I.T  ( 2014-08-28 05:44:20 -0600 )edit

Given that the Wandboard has a nice i.MX6 processor, it should be powerful enough to compile ROS onboard. It takes a little longer, but the setup is much simpler.

Or, if you're already building your own custom Linux, you should be able to use that toolchain to cross-compile ROS.

ahendrix gravatar image ahendrix  ( 2014-08-29 12:37:00 -0600 )edit

Question Tools

5 followers

Stats

Asked: 2014-08-23 11:43:55 -0600

Seen: 7,736 times

Last updated: Oct 07 '14