32
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 1 year has passed since last update.

ubuntu22.04にROS2 Humbleをインストールする

Last updated at Posted at 2022-05-27

はじめに

ubuntu22.04LTSにROS2 Humbleをインストールしたので最低限必要なコマンドをメモ

aptリポジトリの追加

sudo apt update && sudo apt install curl gnupg lsb-release
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg

リポジトリをsource listに追加

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(source /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null

ROS2 インストール

sudo apt update
sudo apt install ros-humble-desktop

動作テスト

Talkerを実行

source /opt/ros/humble/setup.bash
ros2 run demo_nodes_cpp talker

別のTerminalでListenerを実行

source /opt/ros/humble/setup.bash
ros2 run demo_nodes_py listener

環境設定

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

ワークスペースの作成

colconのインストール

sudo apt install python3-colcon-common-extensions
mkdir -p ~/ros2_ws/src
cd ros2_ws/
colcon build

Gazeboのインストール

ros-desktop-full でGazeboがインストールされなくなったので別にインストール

sudo apt -y install gazebo
sudo apt install ros-humble-gazebo-*

rqtのプラグインをインストール

rqt_tf_treeなどよく使うものはデフォルトではインストールされないのでaptから入れる

sudo apt install ros-humble-rqt-*

Reference

32
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
32
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?