0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Db410cにROSをインストール

Last updated at Posted at 2020-03-12

参照したサイト
http://wiki.ros.org/kinetic/Installation/Source

Debian 9にROSをソースからビルドする。

環境
OS Debian 9
kernel 4.9.34-0-linaro-lt-qcom
gcc 6.3.0
ROS kinetic
python 2.7.13

Preparation

USBメモリにスワップを割り当てる(2GB)
この2つの記事を参照
https://qiita.com/kashikotuka/items/5d344f75164452cf54f5
https://qiita.com/suisuina/items/4fa8b001d7aa59d865a4

Prerequisites

Installing bootstrap dependencies

sudo apt-get install python-rosdep python-rosinstall-generator python-wstool python-rosinstall build-essential sudo pip install -U rosdep rosinstall_generator wstool rosinstall sudo pip install --upgrade setuptools

Initializing rosdep

sudo rosdep init rosdep update

Installation

Building the catkin Packages

Create a catkin Workspace

mkdir ~/ros_catkin_ws cd ~/ros_catkin_ws rosinstall_generator desktop --rosdistro kinetic --deps --wet-only --tar > kinetic-desktop-wet.rosinstall wstool init -j8 src kinetic-desktop-wet.rosinstall

[opencv3] still active このメッセージが延々と出力される。
これは、openCVのアーカイブのダウンロードに表示されるメッセージ
気長にまてば[opencv3]Doneが表示される。
ただし、エラーで終了するケースもあるのでその時は、
rm -rf src wstool init -j8 src kinetic-desktop-wet.rosinstall
これを[opencv3]Doneになるまで繰り返す。

さらに、
ros-disktopでopenCvのビルドはできたのだがroscppをビルドするところでDb410cがhang upして しまう。
make option -j1でもhang up してしまう。
なので、まずros-commをインストールしUSBカメラ系のpackageのソースはros-disktopに含まれているので、ros-commにそれを追加する方針の変更。

さらにこんなことも
突然mDb410cでros-commがインストールできなくなってしまった。
usbメモリにパーテーションを割当てそこのros_catkin_wsを使ったのがダメ?
幸い、ros-commのビルドに成功したros_catkin_wsが残っていたので、
rebuildを試してみる。 成功!! なぜだ?
リビルドしてエラーになる時は、workspace内のdevel,build,instalディレクトリを削除する。

次は、このros_catkin_wsをusbメモリへコピーしてリビルドしてみる。

なんだかんだで面倒なので、以下の方針に変更

1. ros_commをビルドする。

2. OpenCVに必要なパッケージをビルドし追加する。

パッケージを追加する際は、そのパッケージのCMakeList.txtに記述されている
DEPENDENCESを確認し、依存関係のあるパッケージもあわせてビルドする。

1. ros_commのビルド

`mkdir ros_catkin_ws
cd ros_catkin_ws

rosinstall_generator ros_comm --rosdistro kinetic --deps --wet-only --tar > kinetic-ros_comm-wet.rosinstall
wstool init src kinetic-ros_comm-wet.rosinstall
./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Releaseパケージを個別でビルドする際は、./src/catkin/bin/catkin_make_isolated --install --pkg PACKAGE -DCMAKE_BUILD_TYPE=Release`

swap領域が足りずhang up
swapを900MBにしてbuild完了。
最終的には、USBメモリをマウントしてスワップを2G割り当てた。

Resolving Dependencies

rosdep install --from-paths src --ignore-src --rosdistro kinetic -y
これも成功
##Building the catkin Workspace
./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release
swap領域が足りずhang up
swapを900MBにしてbuild完了。
swapを900MBにしてbuild完了。

#方針変更
OpenCVがどうにこうにもビルドできないでの Lunarのdisktop-fullをソースからビルドする。
http://wiki.ros.org/lunar/Installation/Source

OpenCV

mkdir -p catkin_ws/src && catkin_ws/src
wstool init -j8 src kinetic-desktop-wet.rosinstallでダウンロードしたopencvのディレクトリを catkin_ws/srcに追加する。
catkin_make_isolated -j1
ビルド中にc++コンパイラのインターナルエラーが発生した。
何が原因かは不明であるが、可能性としてあり得るのは、
Db410cがビルド中にhung upした際にclean upせず中途半端な状態で以下のコマンドを連続して実行したこと。
catkin_make_isolated -j4
catkin_make_isolated -j2
catkin_make_isolated -j1
catkin_make_isolated -j4
原因はおそらくこれ、clean up後、rebuildしたらエラーは発生しなかった。

##OpenCV
bloomをインストールする。
sudo apt-get install python-bloom
https://github.com/ros-gbp/opencv3-release
/usr/bin/bloom-release opencv3 --track kinetic --rosdistro kineti

cv_camera

cv_bridge

cd catkin_ws/src git clone https://github.com/ros-perception/vision_opencv cd .. catkin_make_isolated source devel/setup.bash

image_transport_plugins

cd catkin_ws/src git clone https://github.com/ros-perception/image_transport_plugins cd .. catkin_make_isolated source devel/setup.bash

usb_cam

cd catkin_ws/src git clone https://github.com/bosch-ros-pkg/usb_cam.git cd .. catkin_make_isolated source devel/setup.bash

pluginlib-dev

opencv_apps

http://wiki.ros.org/opencv_apps
https://github.com/ros-perception/opencv_apps
https://github.com/AscendNTNU/image_converter

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?