ROS Indigoのインストール方法(Ubuntu Trusty)

Ubuntu 16.04を使用している場合はROSのインストール方法(Ubuntu Xenial)をご覧ください。 Ubuntu 18.04を使用している場合はROSのインストール方法(Ubuntu Bionic)をご覧ください。

概要

Gazebo上でRaspberry Pi Mouseをシミュレートできるようにするため、以下のソフトウェアをインストールします。

  • ROS Indigo

  • Gazebo 2.x (ROSとともにインストール)

ROSがすでにインストール済みの場合はこのページを飛ばしてRaspberry Pi Mouse Simulatorのインストールを行ってください。

動作確認済み環境

  • Ubuntu Desktop 14.04 LTS 64bit

手順

Tiryoh/ros_setup_scripts_Ubuntu14.04_desktopを使用してインストール作業を進めていきます。

  1. ROSをインストール

  2. catkin_wsを準備

必要なコマンドをまとめると、以下のようになります。 これらのコマンドについてこの後細かく説明していきます。

sudo apt-get update
sudo apt-get install -y curl
bash -c "$(curl -SsfL https://git.io/ros-indigo-desktop)"
source ~/.bashrc
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/
catkin_init_workspace src
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
catkin_make && source ~/catkin_ws/devel/setup.bash

コマンド解説

ROSのインストール

今回はROSのインストールにTiryoh/ros_setup_scripts_Ubuntu14.04_desktopを使用します。

インストーラを使用するに当たり、まずは以下のコマンドでパッケージマネージャ(apt)のパッケージリストを最新版にし、curlをインストールします。1行ずつ実行してください。

sudo apt-get update
sudo apt-get install -y curl

次にインストーラを実行します。

bash -c "$(curl -SsfL https://git.io/ros-indigo-desktop)"

このインストーラを使ってapt-getでインストールするパッケージは以下の通りです。

  • ros-indigo-desktop-full

最終的に以下のログが出ていればインストール成功です。

***INSTRUCTION*****************
* do the following command    *
* $ source ~/.bashrc          *
* after that, try             *
* $ LANG=C roscore            *
*******************************

ROSのインストールについて詳しく調べたい場合はROS Wikiをご覧ください。

catkin_wsの準備

ROSのパッケージを保存するためのワークスペースを用意します。1行ずつ実行してください。

source ~/.bashrc
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/
catkin_init_workspace src
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
catkin_make && source ~/catkin_ws/devel/setup.bash

Trubleshooting

catkin_makeに失敗する

$ catkin_make
Base path: /home/ubuntu/catkin_ws
Source space: /home/ubuntu/catkin_ws/src
Build space: /home/ubuntu/catkin_ws/build
Devel space: /home/ubuntu/catkin_ws/devel
Install space: /home/ubuntu/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/ubuntu/catkin_ws/build"
####
####
#### Running command: "make -j8 -l8" in "/home/ubuntu/catkin_ws/build"
####

上記のようになにもビルドせず、目的のパッケージのcatkin_makeに失敗する場合があります。

setup.bashを再読み込みしてからcatkin_makeしてみてください。

詳しくはROSトラブルシューティングをご覧ください。

Last updated