13
19

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.

Ubuntu 16.04LTSにROS Kineticをインストールする

Posted at

ROSのインストール時の情報まとめ

ROSを使う必要が出てきたので、勉強と備忘録をかねて、情報集約をしておく。
どこのまとめ情報をみても、同じような感じで、とくに問題なくインストールできた。

参考にした情報

[ROS Kinetic の Ubuntu へのインストール]
(http://wiki.ros.org/ja/kinetic/Installation/Ubuntu)

[ubuntu 16.04にROS kineticをインストールする]
(http://blog-sk.com/ubuntu/ubuntu-16-04-ros-kinetic/)

ソースリストと鍵の設定

packages.ros.org からソフトウェアを受容するための設定

$ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'

鍵の設定

$ sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116

インストール

ubuntuのアップデート

$ sudo apt-get update 

ROSのインストール
4種類のパッケージがあるので、合ったものを選択できる。

  • すべてのデスクトップ環境:ROS, rqt, rviz, ロボットの一般的なライブラリ、2D/3Dシミュレータ、ナビゲーション、2D/3D認識
$ sudo apt-get install ros-kinetic-desktop-full 

とりあえず全部入りでいいかな。インストールは3分くらいで終わった。

  • デスクトップ環境:ROS, rqt, rviz, ロボットの一般的なライブラリ
$ sudo apt-get install ros-kinetic-desktop
  • ROSベース(最小構成):ROSパッケージ、ビルド、通信ライブラリ、GUIツールの付属なし
$ sudo apt-get install ros-kinetic-desktop
  • 個別パッケージ:特定のROSパッケージのインストール
$ sudo apt-get install ros-kinetic-PACKAGE

利用可能なパッケージは、

$ apt-cache search ros-kinetic

で見つけることができる。例は、

$ sudo apt-get install ros-kinetic-slam-gmapping

rosdepの初期化

ROSの使用前に、rosdepの初期化が必要らしい。

$ sudo rosdep init
$ rosdep update

環境設定

端末起動時に、/opt/ros/kinetic/setup.bashを呼び出すように追加

$ echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
$ source ~/.bashrc

rosinstallの準備

ROS中で頻繁に使用されるコマンドラインツールとのこと。
複数のソース・ツリーを一括して扱うためのコマンド

$ sudo apt-get install python-rosinstall

ROSを使ってみる

動作確認

ターミナルで以下のコマンドをうってみる。

$ roscore

以下のようなのが出て入れば、インストールOK

... logging to /home/kondo/.ros/log/61a9fc32-28e5-11e8-860c-7085c252f15c/roslaunch-deepstation-22726.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://deepstation:32922/
ros_comm version 1.12.13


SUMMARY
========

PARAMETERS
 * /rosdistro: kinetic
 * /rosversion: 1.12.13

NODES

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

setting /run_id to 61a9fc32-28e5-11e8-860c-7085c252f15c
process[rosout-1]: started with pid [22751]
started core service [/rosout]

[Ctrl+C]で終了。基本的にROSのプログラム終了時に使う。

ROSのホームディレクトリの変更

$ roscd

とすると、ホームディレクトリに移動できるが、今は先ほど設定した、

/opt/ros/kinetic

に移動してしまう。

ワークスペースの作成

~/catkin_ws/のところは任意のパスを設定可能。

$ mkdir -p ~/catkin_ws/src
$ cd ~/catkin_ws
$ catkin_make
13
19
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
13
19

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?