LoginSignup
25
25

More than 1 year has passed since last update.

『ROS Noetic』のインストール

Last updated at Posted at 2021-01-02

概要

題名の通り、『ROS Noetic の環境構築』を行います。
KineticやMelodicの環境構築は公式サイトや色んなページで紹介されているのですが、Noeticに関しては『これだ!!』ってなるページが見当たらなかったので記載しておきます。

基本的には、公式サイトのインストール手順をなぞります。
公式のNoeticインストール手順サイト
ただし、公式のページに記載されている手順は最後まで書かれていないので、その点を補足して記載します。
(Melodicまではちゃんと最後まで書いているのに、なんで改悪しちゃったんだろう…)

インストール環境

  • Raspberry Pi 4 (4GB)
  • Ubuntu server 20.04LTS (64bit)

今回は『RaspberryPi』を使用するが、Intel や AMD のCPUでも問題なくインストールできる(はず)。

またOSには『Ubuntu server 20.04LTS 64bit』を選択。32bit版 や Ubuntu Desktop でも問題なくインストールできる(はず)。
ご存じの通り、UbuntuのバージョンとROSのバージョンを合わせる必要がある。
『ROS Noetic』をインストールするなら、『Ubunutu 20.04』を選択すること!!

インストールコマンド

下記のコマンドを順番に実行していけば、最後までインストールできます。

1. sources.listを設定

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

2. 鍵の設定

sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

3. Ubuntu をアップデート

sudo apt update

4. インストール

sudo apt install ros-noetic-desktop-full

5. 環境設定

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

6. rosinstallの準備

sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential

7. rosdepの初期化

sudo rosdep init
rosdep update

8. ROSのワークスペースを作成、ビルド

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/
catkin_make

9. ワークスペースのオーバーレイ

echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc

下記コマンドでpathが通っていればOK。

echo $ROS_PACKAGE_PATH
⇒ /home/<username>/catkin_ws/src:/opt/ros/noetic/share

10. インストールの確認

roscore

下記のようにエラー無く表示できればOK。

<username>@ubuntu:~$ roscore
... logging to /home/<username>/.ros/log/3da110c6-4d4c-11eb-b763-f9ecf65ee99d/roslaunch-ubuntu-20827.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

invalid ROS_IP (must be a valid IPv4 or IPv6 address)
invalid ROS_IP (must be a valid IPv4 or IPv6 address)
invalid ROS_IP (must be a valid IPv4 or IPv6 address)
started roslaunch server http://master:33043/
ros_comm version 1.15.9


SUMMARY
========

PARAMETERS
 * /rosdistro: noetic
 * /rosversion: 1.15.9

NODES

auto-starting new master
process[master]: started with pid [20835]
invalid ROS_IP (must be a valid IPv4 or IPv6 address)
invalid ROS_IP (must be a valid IPv4 or IPv6 address)
ROS_MASTER_URI=http://master:11311/

setting /run_id to 3da110c6-4d4c-11eb-b763-f9ecf65ee99d
process[rosout-1]: started with pid [20845]
started core service [/rosout]

参考ページ

http://wiki.ros.org/noetic/Installation/Ubuntu
http://wiki.ros.org/noetic/Installation/Source
https://choreonoid.org/ja/manuals/latest/ros/install-ros.html
https://qiita.com/oguashiii/items/f23f2d25531c9311e614

25
25
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
25
25