Raspberry Pi 3-jessie compiled and installed Ros-indigo full versionPublished: October 20, 2016 09:31:21 Views: 4,388 from: Ray Everyone in the study of Ros sometimes directly using a notebook or industrial computer (small host), more trouble, the price is more expensive, and then a lot of people put their ideas into small embedded computers such as TK1, Raspberry Pi , banana pies, etc., but these devices are more or less problematic when installing ROS, such as tutorials only ...
Everyone in the study of Ros sometimes directly using notebook or industrial computer (small host), more trouble, the price is more expensive, and then a lot of people put their ideas into small embedded computers such as TK1, Raspberry Pi, banana pie, etc., but these devices installed Ros more or less some problems, For example, only install the Ros-comm version of the tutorial, a lot of features use limited, a lot of small partners want to transplant ros-desktop to these devices, but the pit is more, and then always process twists, very few go down, I also walked through these pits in the prophase, at that time saw a lot of tutorials, For example, the most famous is the blogger Oriental Red Dragon Raspberry Pi 2 compiled the full version of the Ros-indigo, then the Raspberry Pi 3 released, on the basis of Raspberry Pi 2 added on-board Bluetooth, wireless, and the corresponding performance also improved, this time I also have a snack itch, So continue into the pit ready with Raspberry Pi 3 compile full version indigo (other version similar, but the proposal is still with indigo), because the Raspberry Pi 3 system is Jessie (Raspberry Pi 2 is the difference between Wheezy,wheezy and Jessie Baidu a bit to know), So some minor details have to be changed so that the following records are made:
The author's heartfelt admonition:
Don't try to compile complete Ros on the Raspberry Pi Raspbian system, meaningless, wasting life, wasting your life, and buying a second-hand notebook for hundreds of bucks.
The author of this article is rosclub---Ray
Reprint please indicate the author and its source
Added: Collada_parser compiler error found the problem
Urdfdom_headers Library has just been updated and replaced with std::shared_ptr, resulting in Collada_parser compilation errors
NET friend: = = (401565005) explosive material.
=================== may be installing something ==========================
installation
The Rosinstall_generator can installed via a Debian package from the ROS repositories:
sudo apt-get update
sudo apt-get install Python-rosinstall-generator
For other platforms (where the Debian package isn't available) it can be installed from PyPI using PIP:
sudo pip install Rosinstall-generator
=======================================================
1. Preparation before installation
Raspberry Pi 3,TF card 16g,raspbian OS (JESSIE), ROS Indigo,win32diskimager
1.1 Raspbian OS
Download the disk image on the Raspberry Pi website, the latest image is Raspbian JESSIE,
[Click here to DOWNLOAD] (https://www.raspberrypi.org/downloads/raspbian/)
Note: Choose Raspbian JESSIE, I downloaded it in 2016-05-27.
1.2 Burn write Raspbian Jessie Mirror
Use Win32diskimager to burn the downloaded Raspberry Pi image (. img file) into the prepared TF card
Note: Do not select the wrong letter in the Win32diskimager
2. Prepare Ros Indigo source code and dependent library
2.0 Changing swap file
Swap size to 2GB (according to your memory card, my 16g is set to 2g), small often compile often internal error (install Ros also, but install the Ros set 1GB is enough).
sudo vim/etc/dphys-swapfile
And then find and modify
con_swapsize=2048
Save the exit and restart the computer.
2.1 Preparatory work
Add the code source first, then update the system, and add the Ros code base key.
The following operations are all operated under Xshell
pi@raspberrypi:~ $ sudo sh-c ' echo "Deb Http://packages.ros.org/ros/ubuntu Jessie Main" >/etc/apt/sources.list.d/ros -latest.list '
pi@raspberrypi:~ $ wget Https://raw.githubusercontent.com/ros/rosdistro/master/ros.key-O-| sudo Apt-key Add-
Update system (*********** must be updated, do not update absolute error)
pi@raspberrypi:~ $ sudo apt-get update
pi@raspberrypi:~ $ sudo apt-get upgrade
2.2 Installing the necessary packages
pi@raspberrypi:~ $ sudo apt-get install python-pip python-setuptools python-yaml python-distribute python-docutils Python-dateutil python-six
pi@raspberrypi:~ $ sudo pip install rosdep rosinstall_generator wstool Rosinstall
2.3 Initializing ROSDEP
pi@raspberrypi:~ $ sudo rosdep init
pi@raspberrypi:~ $ ROSDEP Update
3. Compiling Ros Source code
3.1 Preparing before compiling
3.1.1 Create a workspace that is used to download and compile Ros full source
pi@raspberrypi:~ $ mkdir ~/ros_catkin_ws
pi@raspberrypi:~ $ cd ~/ros_catkin_ws
3.1.2 Download Source code
Ros officially provides two source code packages,
One is Ros-comm (official recommendation), which contains only the basic necessary content, no GUI and other tools;
One is desktop, in addition to Ros-comm contains the basic necessary content, but also includes Rqt,rviz and robot-generic tools.
Here we choose the desktop version, if only want to install version ros-comm, only need to replace the following command in the desktop with Ros_comm.
pi@raspberrypi:~ $ rosinstall_generator Desktop--rosdistro Indigo--deps--wet-only--exclude roslisp--tar > indigo-d Esktop-wet.rosinstall
pi@raspberrypi:~ $ wstool init-j8 src indigo-desktop-wet.rosinstall
So all ROS codes are downloaded to the ~/ROS_CATKIN_WS/SRC directory, and the-J8 parameter means to open 8 threads to download together.
If the download is interrupted, you can try to resume the download using the following command:
pi@raspberrypi:~ $ wstool update-j4-t src
3.2 Addressing Ros dependency issues
Before we can formally compile Ros, we also need to manually install the following dependent packages:
Libconsole-bridge-dev, Liburdfdom-headers-dev, Liburdfdom-dev, Liblz4-dev, and Collada-dom-dev.
Ros_comm Required Dependency Package: Libconsole-bridge-dev and Liblz4-dev
Desktop Required dependencies: Libconsole-bridge-dev, Liblz4-dev, Liburdfdom-headers-dev, Liburdfdom-dev, Collada-dom-dev
3.2.1 establishes a separate folder for compiling installations for these dependent packages, and installs both Checkinstall and CMake:
pi@raspberrypi:~ $ mkdir ~/ros_catkin_ws/external_src
pi@raspberrypi:~ $ sudo apt-get install Checkinstall cmake
3.2.2 Installation Libconsole-bridge-dev
pi@raspberrypi:~ $ cd ~/ros_catkin_ws/external_src
pi@raspberrypi:~ $ sudo apt-get install Libboost-system-dev Libboost-thread-dev
pi@raspberrypi:~ $ git clone https://github.com/ros/console_bridge.git
pi@raspberrypi: ~ $ cd Console_bridge
pi@raspberrypi:~ $ cmake.
pi@raspberrypi:~ $ sudo checkinstall make install
In the last step of the Checkinstall, will ask a number of questions, when there is a problem to provide multiple options, select 2 to modify the package name of Libconsole-bridge-dev, and then choose N for the next two problems, otherwise the final compilation error.
3.2.3 Installation Liburdfdom-headers-dev
pi@raspberrypi:~ $ cd ~/ros_catkin_ws/external_src
pi@raspberrypi:~ $ git clone https://github.com/ros/urdfdom_ Headers.git
pi@raspberrypi:~ $ cd urdfdom_headers
pi@raspberrypi:~ $ cmake.
pi@raspberrypi:~ $ sudo checkinstall make install
In the last step of the Checkinstall, will ask a number of questions, when there is a problem to provide multiple options, select 2 to modify the package name of Liburdfdom-headers-dev, and then choose N for the next two problems, otherwise the final compilation error.
3.2.4 Installation Liburdfdom-dev
pi@raspberrypi:~ $ cd ~/ros_catkin_ws/external_src
pi@raspberrypi:~ $ sudo apt-get install Libboost-test-dev Libtinyxml-dev
pi@raspberrypi:~ $ git clone https://github.com/ros/urdfdom.git
pi@raspberrypi:~ $ cd Urdfdom
pi@raspberrypi:~ $ cmake.
pi@raspberrypi:~ $ sudo checkinstall make install
In the last step of the Checkinstall, will ask a number of questions, when there is a problem to provide multiple options, select 2 to modify the package name of Liburdfdom-dev, and then choose N for the next two problems, otherwise the final compilation error.
3.2.5 Installation Collada-dom-dev
pi@raspberrypi:~ $ cd ~/ros_catkin_ws/external_src
pi@raspberrypi:~ $ sudo apt-get install Libboost-filesystem-dev Libxml2-dev
pi@raspberrypi:~ $ wget http://downloads.sourceforge.net/project/collada-dom/Collada%20DOM/ Collada%20dom%202.4/collada-dom-2.4.0.tgz
pi@raspberrypi:~ $ tar-xzf collada-dom-2.4.0.tgz
Pi@raspberrypi : ~ $ cd collada-dom-2.4.0
pi@raspberrypi:~ $ cmake.
pi@raspberrypi:~ $ sudo checkinstall make install
The collada-dom-2.4.0.tgz here is about a few 10 trillion, it is recommended to download the local upload to the Raspberry Pi (you can use the Rzsz command, self-search method)
In the last step of the Checkinstall, will ask a number of questions, when there is a problem to provide multiple options, select 2 to modify the package name of Collada-dom-dev, and then choose N for the next two problems, otherwise the final compilation error.
3.2.6 Installation Liblz4-dev
pi@raspberrypi:~ $ cd ~/ros_catkin_ws/external_src
pi@raspberrypi:~ $ wget http://archive.raspbian.org/raspbian/ Pool/main/l/lz4/liblz4-1_0.0~r122-2_armhf.deb
pi@raspberrypi:~ $ wget http://archive.raspbian.org/raspbian/ Pool/main/l/lz4/liblz4-dev_0.0~r122-2_armhf.deb
pi@raspberrypi:~ $ sudo dpkg-i liblz4-1_0.0~r122-2_armhf.deb Liblz4-dev_0.0~r122-2_armhf.deb
3.3 Using ROSDEP to resolve remaining dependencies
pi@raspberrypi:~ $ cd ~/ros_catkin_ws
pi@raspberrypi:~ $ rosdep Install--from-paths SRC--IGNORE-SRC--rosdistro ind Igo-y-R--os=debian:jessie
The above command will traverse all the package and recursively install dependencies
3.5 Modifying part of the code (compiling some package errors may require modifying the following files)
Locate the Mesh_loader.cpp file in the/home/pi/ros_catkin_ws/src/rviz/src/rviz directory and locate the following code area:
#if defined (assimp_unified_header_names)
#include
#include
#include
#include
#include
# else
#include
#include
#include
#include
#include
#endif
After this code, add the following code snippet to save the exit.
#ifdef __arm__
#include
bool assimp::iosystem::comparepaths (const char *P1, const char *P2) const
{
Return!::strcasecmp (P1, p2);
}
#endif
===============note!!! Collada_to_urdf.cpp and Collada_urdf.cpp file path============
Find Collada_to_urdf.cpp and Collada_ in the/HOME/PI/ROS_CATKIN_WS/SRC/ROBOT_MODEL/COLLADA_URDF/SRC directory Urdf.cpp file, also add the above code snippet after saving exit.
This will not have the error message in the subsequent compilation process.
3.6 Compiling and installing Ros
pi@raspberrypi:~ $ cd ~/ros_catkin_ws
pi@raspberrypi:~ $ sudo./src/catkin/bin/catkin_make_isolated--install- Dcmake_build_type=release--install-space/opt/ros/indigo-j2
pi@raspberrypi:~ $ source/opt/ros/indigo/ Setup.bash
The final-j2 parameter of the compile command is to turn on two thread compilation, using four threads by default without parameters, but for the CPU and memory of the Raspberry Pi, it is easy to crash due to exhaustion of resources.
This is done by compiling and installing Ros on Raspberry Pi 3.
The author's level is limited, please point out if there are errors.
You can use Raspberry Pi to configure master-slave operation: The simplest configuration method for multi-machine communication in Ros-Raspberry Pi to PC
Reference Links:
http://blog.csdn.net/u013494117/article/details/51751939
http://blog.csdn.net/crazyquhezheng/article/details/43413231
https://www.raspberrypi.org/downloads/raspbian/
Http://wiki.ros.org/ROSberryPi/Installing%20ROS%20Indigo%20on%20Raspberry%20Pi
http://blog.csdn.net/ zister/article/details/51882019