Compiling ROS on ARM

Publisher:西周以前的Latest update time:2013-12-04 Source: 21icKeywords:ROS Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

  As a software framework for mobile robots, ROS (robot operating system) has been widely used in recent years, but most applications are based on X86 architecture processors. How to combine such a powerful tool with the widely used ARM processor is a problem that many developers are eager to solve. As a beginner of ROS, I recently tried to transplant ROS to ARM. It took me four or five days, but I succeeded in the end.

  Although there are some ROS application solutions for non-X86 architecture processors, such as eros (http://www.ros.org/wiki/eros) and rosserial (http://www.ros.org/wiki/rosserial), the latter is for Arduino. I played with the former for a few days but didn't understand how to use it, so I searched everywhere on the Internet and asked some people in the ROS group. Recently, someone in the group successfully compiled the ROS source code on MK802 III. So the original method of compiling the source code directly on the target machine, although less efficient, should be feasible.

  Transplantation environment:

  PC:Ubuntu 12.04

  ARM processor: Cortex-A9

  Arm operating system: Ubuntu12.04

  ROS version: groovy

   Compilation process:

  1. Install tool software

  Start the Ubuntu operating system in the ARM board, connect it to the computer via the serial port, and use SSH to remotely control the ARM board from the PC. Then you can control the code compilation in the ARM board on the PC.

  First, follow the tutorial:

  sudo apt-get install python-rosdep python-wstool build-essential

  However, there are no python-rosdep and python-wstool packages in the Ubuntu source of arm. The installation of these two packages can be carried out according to the compilation instructions of fuerte (http://www.ros.org/wiki/fuerte/Installation/Ubuntu/Source):

  python ez_setup.py

  Install pip using easy_install: (http://www.ros.org/wiki/ROS/Installation/EasyInstallConfig)

  sudo easy_install pip

  Then install the following packages: (http://www.ros.org/wiki/fuerte/Installation/Ubuntu/Source)

  sudo pip install -U rosdep

  sudo pip install -U rosinstall

  sudo pip install -U rospkg

  Install python-wstool:

  pip install -U wstool

  redep initialization:

  sudo rosdep init

  rosdep update

  2. Download source code

  Create a folder:

  mkdir ~/ros_catkin_ws

  cd ~/ros_catkin_ws

  Download the code. I used the smallest package ros-common:

  wstool init src -j8 http://packages.ros.org/web/rosinstall/generate/raw/groovy/ros_comm

  It is said that the rush for tickets during the Spring Festival travel rush brought down GitHub. At first, I couldn't connect to GitHub's server. I tried for a day before I finally downloaded the code in the midst of the rush for tickets. [page]

  3. Compile source code

  Install the dependency packages as described in the tutorial:

  rosdep install --from-paths src --ignore-src --rosdistro groovy -y

  Then you should also install cmake (I have already installed it before, I don't know if it should be installed in this step). I downloaded the source code from the official website (http://www.cmake.org/), and then compiled it on arm. The installation method refers to the link (http://hi.baidu.com/phpbooker/item/38ca262ed599d10c73863e05). The compilation on arm is too slow, it took nearly an hour. I don't know if it can be cross-compiled on PC, so I won't go into it.

  The next step is the most important process - compilation. This process is painful and long. The main frequency of the arm board is slow. It takes about 20 minutes to compile the code once. Moreover, each error always occurs after a long time of compilation. Various dependent packages need to be installed. If you compile now, there will definitely be a lot of errors. You can deal with them step by step according to these errors. Basically, the dependent packages are not installed. The most important one is the boost library package. Because a lot of code in ROS is written in C++ and uses boost static libraries, the boost library must be installed in the ubuntu system in the arm. The boost library is the problem that I have been struggling with for the longest time. I have used various methods to install it:

  (1) Direct apt-get installation

  (2) Download the source code, cross-compile it on the PC, and then put it into the arm

  (3) Directly download the official deb package compiled for the arm architecture and install it (https://launchpad.net/ubuntu/+source/boost1.46/1.46.1-7ubuntu3/+build/3060825)

  As for the version of boost library, I have tried many, from 1.40 to 1.52, and finally the third method is reliable. After the first two methods are installed, they always report an error during the compilation process saying that a library in boost cannot be found. Open the link above, there will be a list of boost libraries:

  I downloaded and installed all the above packages one by one, and they are basically interdependent. There may still be some other dependent packages during the installation process, which can be installed using pip or easy_install.

  So far, we can finally start compiling and installing:

  ./src/catkin/bin/catkin_make_isolated --install --install-space /opt/ros/groovy

  If everything goes well, the installation will be completed in minutes.

  Add environment path:

  source /opt/ros/groovy/setup.bash

  echo "export ROS_PACKAGE_PATH=~/ros_workspace:$ROS_PACKAGE_PATH" >> ~/.bashrc

  echo "export ROS_WORKSPACE=~/ros_workspace" >> ~/.bashrc

  . ~/.bashrc

  Finally the installation is complete, enter "roscore" in the terminal to see if it runs normally. At this step, I got an error:

  what(): locale::facet::_S_create_c_locale name not valid

  Later I used Google to solve it (http://cruisever.blog.163.com/blog/static/786117572010817112310741/), adding:

  export LC_ALL="C"

  Finally it works fine. I did a simple test of the talker and listener, everything is working fine, although it is a bit slow, but the initial transplant should be completed, there should be more problems waiting for me later.

Keywords:ROS Reference address:Compiling ROS on ARM

Previous article:ARM-based multiplayer gaming platform
Next article:Design of human-machine interface for three-axis servo control system based on ARM

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号