1. Installation Environment
Raspberry Pi B+, ROS Indigo, 16G TF card, Raspbian OS
2. Installation Equipment
2.1 Prepare the ROS Code Repository
[html] view plain copy
-
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 –
Ensure Raspbian OS is updated
[html] view plain copy
-
sudo apt-get update
-
sudo apt-get upgrade
2.2 Install Bootstrap Dependencies
[html] view plain copy
-
sudo apt-get install python-setuptools
-
sudo easy_install pip
-
sudo pip install -U rosdep rosinstall_generator wstool rosinstall
2.3 Initialize rosdep
[html] view plain copy
-
sudo rosdep init
-
rosdep update
3. Compile ROS
3.1 Create a workspace to compile ROS
[html] view plain copy
-
mkdir ~/ros_catkin_ws
-
cd ~/ros_catkin_ws
Next, download the ROS code. ROS provides two code packages.
1) ROS-Comm: This is the officially recommended version, but it only contains basic ROS communication functions without navigation, TF, action, RViz, and other GUI tools.
2) Desktop: The complete ROS functionality suitable for all robotic applications. We choose to install this.
The following command downloads and generates the compilation package list, which may take a long time.
[html] view plain copy
-
rosinstall_generator desktop –rosdistro indigo –deps –wet-only –exclude roslisp –tar > indigo-desktop-wet.rosinstall
-
wstool init -j8 src indigo-desktop-wet.rosinstall
If the download is interrupted, the following command will continue the download:
[html] view plain copy
-
wstool update -j 4 -t src
3.2 Resolve Dependencies
libconsole-bridge-dev, liburdfdom-headers-dev, liburdfdom-dev, liblz4-dev, and collada-dom-dev are not included in Raspbian and need to be manually compiled and downloaded.
Create a new directory to download these five packages.
[html] view plain copy
-
<span style=“font-size:18px;”>mkdir ~/ros_catkin_ws/external_src
-
sudo apt-get install checkinstall cmake</span>
Install libconsole-bridge-dev:
[html] view plain copy
-
<span style=“font-size:18px;”>cd ~/ros_catkin_ws/external_src
-
sudo apt-get install libboost-system-dev libboost-thread-dev
-
git clone https://github.com/ros/console_bridge.git
-
cd console_bridge
-
cmake .
-
sudo checkinstall make install</span>
When checkinstall asks if you want to change installation options, select [2] to change the name from “console-bridge” to “libconsole-bridge-dev”
For the next two questions, select ‘n’ continuously, otherwise it will compile incorrectly.
Installliblz4-dev
[html] view plain copy
-
<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
[html] view plain copy
-
<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 if you want to change installation options, select [2] to change the name from “urdfdom-headers” to “liburdfdom-headers-dev”
For the next two questions, select ‘n’ continuously, otherwise it will compile incorrectly.
Installliburdfdom-dev
[html] view plain copy
-
<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 if you want to change installation options, select [2] to change the name from “urdfdom” to “liburdfdom-dev”
For the next two questions, select ‘n’ continuously, otherwise it will compile incorrectly.
Install collada-dom-dev
[html] view plain copy
-
<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 if you want to change installation options, select [2] to change the name from “collada-dom” to “collada-dom-dev”
For the next two questions, select ‘n’ continuously, otherwise it will compile incorrectly.
3.3 Resolve Dependencies with rosdep
[html] view plain copy
-
<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 traverse all packages and recursively install dependencies.
3.4 Start Compiling 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 will be compiled and installed in the /opt/ros/indigo directory. It often reports errors for the packages ‘urdf’, ‘collada_parser’, and ‘collada_urdf’, causing the installation to be interrupted. The solution is to move these three packages out of the ~/ros_catkin_ws/src/robot_model directory and recompile the entire ROS. Finally, create a separate workspace and place the three packages in the src/robot_model directory. Then execute the following command:
sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/indigo
If errors persist, you need to reinstall the packages liburdfdom-dev, liblz4-dev, and collada-dom-dev one by one as described in step 3.2. After installing each one, recompile, and successfully compiled packages can be deleted until all compile successfully.