LoginSignup
3
4

More than 3 years have passed since last update.

Raspberry Pi ZeroWにROSをインストールする

Last updated at Posted at 2019-12-10

目的

Raspberry Pi Zero W(H)にROSをインストールする。

ROSのインストールなんてaptで簡単だろうと思っていたが、思いのほか大変なことになったので、これだけで独立してメモ。
意外と時間がかかってしまった。

OSインストールがんばる

どうも、UbuntuはZeroに対応していないようなので、Raspbianをインストールする。
バージョンは、リリース日2019-09-26のSeptember 2019のRaspbian Buster Liteを使った。
ディスプレイとキーボードを必要としないやり方で設定してみる。参考にしたサイトは、こちら
ただし、Windowsだともう一つ手順が必要で、こちらこちらも参考にした。
Windows用のドライバを入れなおすところ。
もちろん、インストールしたらapt updateとapt upgradeはやっておく。

ROSインストール

単純にパッケージをaptで入れようとしてもうまくいかない。パッケージが壊れてる的なことを言われるので、ソースからインストール。
ここを参考に、パッケージインストールとコンパイルを順番に実行していく。

ROSのベースだけ入れたいので、ros_commのインストール手順に従ってやっていく。

リンク先の記事で問題になっていたros_graphの問題は、ros_comm対象だったからか、なんらか修正がはいっているかで、特に問題なし。

tinyxml2とpython-opencvのバージョンも以下の通りで、問題ないよう。

pi@raspberrypi:~/ros_catkin_ws $ apt-cache show libtinyxml2-dev | grep Version
Version: 7.0.0+dfsg-1
pi@raspberrypi:~/ros_catkin_ws $ apt-cache show python-opencv | grep Version
Version: 3.2.0+dfsg-6

手順としてはそのままで、無事roscoreが動いた。

pi@raspberrypi:~/ros_catkin_ws $ roscore
... logging to /home/pi/.ros/log/5f885066-1b78-11ea-a9b7-8aadcc980d4d/roslaunch-raspberrypi-17595.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://raspberrypi:35035/
ros_comm version 1.14.3


SUMMARY
========

PARAMETERS
 * /rosdistro: melodic
 * /rosversion: 1.14.3

NODES

auto-starting new master
process[master]: started with pid [17605]
ROS_MASTER_URI=http://raspberrypi:11311/

setting /run_id to 5f885066-1b78-11ea-a9b7-8aadcc980d4d
process[rosout-1]: started with pid [17616]
started core service [/rosout]
3
4
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
3
4