LoginSignup
0
0

More than 3 years have passed since last update.

[備忘録] Raspberry Pi に ROS2 環境をセットアップ

Last updated at Posted at 2021-02-19

はじめに

ROS2 foxy を Raspberry Pi にインストールしましたが、最新版でまとまった情報がなかったため、備忘録として残しておきます。基本的に、公式ページの手順に沿っていけば、問題なくインストールできました。

環境

  • Ubuntu 20.04 LTS
  • ROS2 foxy
  • Raspberry Pi 3

Ubuntu のインストール

UbuntuのRaspberry Pi向け公式イメージを利用します。公式ページの手順に沿って設定を行います。ROS2 foxy を使用する場合、Ubuntu 20.04 LTS (64bit) が良いと思います。

Raspberry Pi の立ち上げ

上記手順通りに進め、ログインします。

  • デフォルトのユーザ名: ubuntu
  • デフォルトのパスワード: ubuntu

タイムゾーンの設定をします。

$ timedatectl set-timezone Asia/Tokyo

ROS2 のインストール

今回は、最新版であるfoxyを使用します。公式ページを参照してインストールします。基本的に手順通りに沿っていけばよいですが、以下の点を注意します。

  • desktop と base の2種類存在するので、必要に応じて選択します
$ sudo apt install ros-foxy-ros-base
  • bashrc を設定します
$ source /opt/ros/foxy/setup.bash
$ echo "source /opt/ros/foxy/setup.bash" >> ~/.bashrc
  • ROS2 コマンドの補完ができるよう、argcomplete をインストールします
$ sudo apt install -y python3-pip
$ pip3 install -U argcomplete
  • ROS2 周辺ツールもインストールしておきます
$ sudo apt install python3-colcon-common-extensions
# sudo apt install python3-rosdep2

ビルド

アプリケーションをビルドして問題なく設定できていることを確認します。

$ mkdir -p ~/ros2_ws/src
$ cd ~/ros2_ws/src
$ git clone <任意のリポジトリ>
$ colcon build
0
0
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
0