「RPi2啊派兔#07」手動安裝 ROS indigo 在Raspberry Pi 2 Raspbian Jessie 上 step-by-step 學習筆記 教學

Standard

事前準備
參考「RPi2啊派兔#01」~「RPi2啊派兔#06」
https://shannon112.blogspot.tw/search/label/RPi2%E5%95%8A%E6%B4%BE%E5%85%94

開始吧!
這篇主要是跟著網站的tutorial走
然後command在跑的時候就來網誌這邊紀錄一下
Installing ROS Indigo on the Raspberry Pi
http://www.robopgmr.com/?p=3993
這篇tutorial英文看不太不懂沒關係,跟著步驟code複製貼上即可
以下是所有用到的command(Jessie版)

但是重點是我是用這個方法在Raspbian上最後沒有成功安裝ROS
因為在 3.3 Build the workplace
的第一行指令一直跑不過
再加上這整套坐下來會花非常多時間網路上有人說9hr+
我個人也是花了一整個晚上至少5hr+包含等待時間跟debug時間都搞不定
所以後來我轉用另一個快速的方法,詳見另一篇教學,結果有成功喔~
「Raspberry Pi 2」使用 Ubuntu + ROS indigo image 快速建立有ROS環境的作業系統 免step-by-step

2.1 Setup ROS Repositories
$ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu jessie main" > /etc/apt/sources.list.d/ros-latest.list'
$ wget https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -O - | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get upgrade

2.2 Install Bootstrap Dependencies
$ sudo apt-get install python-pip python-setuptools python-yaml python-distribute python-docutils python-dateutil python-six
$ sudo pip install rosdep rosinstall_generator wstool rosinstall

2.3 Initializing rosdep
$ sudo rosdep init
$ rosdep update

3.1 Create a catkin Workspace
$ mkdir ~/ros_catkin_ws
$ cd ~/ros_catkin_ws
ROS-Comm: (recommended) ROS package, build, and communication libraries. No GUI tools.
$ rosinstall_generator ros_comm --rosdistro indigo --deps --wet-only --exclude roslisp --tar > indigo-ros_comm-wet.rosinstall
$ wstool init src indigo-ros_comm-wet.rosinstall

3.2.1 Unavailable Dependencies
Following packages are not available for Raspbian:
Raspbian Jessie: collada-dom-dev
The following packages are needed for each ROS variant:
Ros_Comm: libconsole-bridge-dev, liblz4-dev

$ mkdir ~/ros_catkin_ws/external_src
$ sudo apt-get install checkinstall cmake
$ sudo sh -c 'echo "deb-src http://mirrordirector.raspbian.org/raspbian/ testing main contrib non-free rpi" >> /etc/apt/sources.list'
$ sudo apt-get update
libconsole-bridge-dev:
$ cd ~/ros_catkin_ws/external_src
$ sudo apt-get build-dep console-bridge
$ apt-get source -b console-bridge
$ sudo dpkg -i libconsole-bridge0.2*.deb libconsole-bridge-dev_*.deb
liblz4-dev:
$ cd ~/ros_catkin_ws/external_src
$ apt-get source -b lz4 //這條跑了非常非常久
$ sudo dpkg -i liblz4-*.deb

3.2.2 Resolving Dependencies with rosdep
$ cd ~/ros_catkin_ws
$ rosdep install --from-paths src --ignore-src --rosdistro indigo -y -r --os=debian:jessie

3.3 Building the catkin Workspace
$ sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/indigo
$ source /opt/ros/indigo/setup.bash
$ echo "source /opt/ros/indigo/setup.bash" >> ~/.bashrc

4.2 Maintaining a Source Checkout
$ cd ~/ros_catkin_ws
$ rosinstall_generator ros_comm ros_control joystick_drivers --rosdistro indigo --deps --wet-only --exclude roslisp --tar > indigo-custom_ros.rosinstall
$ wstool merge -t src indigo-custom_ros.rosinstall
$ wstool update -t src
$ rosdep install --from-paths src --ignore-src --rosdistro indigo -y -r --os=debian:jessie

Debug

問題一:
Should the compilation fail with an "internal compiler error", it may be because you're out of memory. A quick fix for this is to add swap space to the Pi and recompile.
更改swap
http://raspberrypimaker.com/adding-swap-to-the-raspberrypi/

問題二:
$ sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/indigo
error
[175/187]
<== Failed to process package 'urdf':
參考:http://answers.ros.org/question/238484/ros-installation-on-rpi-failed-to-process-package-urdf/

$ sudo apt-get install liburdfdom-dev
然後發現有dependence的問題
$ sudo apt-get remove libconsole-bridge-dev
再一次
$ sudo apt-get install liburdfdom-dev

0 意見:

張貼留言

留言