ROS Learning Series and ros Learning Series

Source: Internet
Author: User

ROS Learning Series and ros Learning Series

It is not easy for Raspberry Pi to install the complete ROS. The blogger Dongfang chilon spent several days summing up the experience of installing and compiling, otherwise it is easy to take a detour.

There are installation tutorials in the ROS official forum, but they are prone to errors. Especially for the Desktop version ROS!


1. installation environment

Raspberry Pi B +, ROS Indigo, 16g tf card, Raspbian OS


2. install equipment

2.1 prepare the ROS code repository

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu wheezy main" > /etc/apt/sources.list.d/ros-latest.list'wget https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -O - | sudo apt-key add -

Make sure the Raspbian OS is updated.

sudo apt-get updatesudo apt-get upgrade

2.2 install bootstrap dependency

sudo apt-get install python-setuptoolssudo easy_install pipsudo pip install -U rosdep rosinstall_generator wstool rosinstall

2.3 initialize rosdep

sudo rosdep initrosdep update

3. Compile ROS

3.1 create a workspace to compile ROS

mkdir ~/ros_catkin_wscd ~/ros_catkin_ws

Next, download the ROS code. ROS provides two code packages.

1) ROS-Comm: This is officially recommended, but it only contains basic ROS communication functions. There are no GUI tools such as navigation, TF, action, and RViz.

2)Desktop:The complete ROS function is suitable for all robot applications. We choose to install this.


The following command will take a long time to download and compile the package list.

rosinstall_generator desktop --rosdistro indigo --deps --wet-only --exclude roslisp --tar > indigo-desktop-wet.rosinstallwstool init -j8 src indigo-desktop-wet.rosinstall

If the download is interrupted, the following command will be downloaded:

wstool update -j 4 -t src

3.2 resolve Dependencies

Libconsole-bridge-dev,Liburdfdom-headers-dev,Liburdfdom-dev,Liblz4-dev, AndCollada-dom-devThese five packages are not in Raspbian and need to be compiled and downloaded manually.

Create a new directory and download the five packages

<span style="font-size:18px;">mkdir ~/ros_catkin_ws/external_srcsudo apt-get install checkinstall cmake</span>

Install libconsole-bridge-dev:

<span style="font-size:18px;">cd ~/ros_catkin_ws/external_srcsudo apt-get install libboost-system-dev libboost-thread-devgit clone https://github.com/ros/console_bridge.gitcd console_bridgecmake .sudo checkinstall make install</span>
When checkinstall asks whether to change the installation option, select [2] and change the name from "console-bridge" to "libconsole-bridge-dev"

Select 'n' for the next two problems; otherwise, compilation errors may occur.


InstallLiblz4-dev

<span style="font-size:18px;">$ cd ~/ros_catkin_ws/external_src$ wget http://archive.raspbian.org/raspbian/pool/main/l/lz4/liblz4-1_0.0~r122-2_armhf.deb$ wget http://archive.raspbian.org/raspbian/pool/main/l/lz4/liblz4-dev_0.0~r122-2_armhf.deb$ sudo dpkg -i liblz4-1_0.0~r122-2_armhf.deb liblz4-dev_0.0~r122-2_armhf.deb</span>


InstallLiburdfdom-headers-dev

<span style="font-size:18px;">$ cd ~/ros_catkin_ws/external_src$ git clone https://github.com/ros/urdfdom_headers.git$ cd urdfdom_headers$ cmake .$ sudo checkinstall make install</span>

When checkinstall asks whether to change the installation option, select [2] and change the name from "urdfdom-headers" to "liburdfdom-headers-dev"

Select 'n' for the next two problems; otherwise, compilation errors may occur.


InstallLiburdfdom-dev

<span style="font-size:18px;">$ cd ~/ros_catkin_ws/external_src$ sudo apt-get install libboost-test-dev libtinyxml-dev$ git clone https://github.com/ros/urdfdom.git$ cd urdfdom$ cmake .$ sudo checkinstall make install</span>

When checkinstall asks whether to change the installation option, select [2] and change the name from "urdfdom" to "liburdfdom-dev"

Select 'n' for the next two problems; otherwise, compilation errors may occur.


Install collada-dom-dev

<span style="font-size:18px;">$ cd ~/ros_catkin_ws/external_src$ sudo apt-get install libboost-filesystem-dev libxml2-dev$ wget http://downloads.sourceforge.net/project/collada-dom/Collada%20DOM/Collada%20DOM%202.4/collada-dom-2.4.0.tgz$ tar -xzf collada-dom-2.4.0.tgz$ cd collada-dom-2.4.0$ cmake .$ sudo checkinstall make install</span>
When checkinstall asks whether to change the installation option, select [2] and change the name from "collada-dom" to "collada-dom-dev"

Select 'n' for the next two problems; otherwise, compilation errors may occur.


3.3 solve dependencies through rosdep

<span style="font-size:18px;">$ cd ~/ros_catkin_ws$ rosdep install --from-paths src --ignore-src --rosdistro indigo -y -r --os=debian:wheezy</span>
The above command will facilitate all packages and recursively install Dependencies

3.4 start to compile ROS

$ sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/indigo


Common Errors:

During compilation, more than 180 packages are compiled and installed in the/opt/ros/indigo directory at the same time, the package 'urdf '''collada _ parser ''' 'collada _ urdf 'is often reported to have an error and the installation is interrupted. The solution is to remove the three packages from the directory ~ Remove the/ros_catkin_ws/src/robot_model directory, re-compile the entire ROS, create a separate workspace, and put the three packages in the src/robot_model directory. Run the following command:

sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/indigo

If the error is still reported, You need to reinstallLiburdfdom-dev,Liblz4-dev, AndCollada-dom-devPackage. After each package is installed, the package that has been compiled can be deleted until the package has been compiled successfully.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.