[ROS2] ROS2 Humble 설치하기

리눅쏘·2024년 5월 1일
post-thumbnail

💡 ROS2 Humble 공식 홈페이지를 참조하여 내용을 작성하였다.

💡 ROS2 Humble은 ubuntu 20.04 혹은 22.04에서만 설치가 가능하다. 특히 ubuntu 22.04에서 설치하는 것을 권장한다.

1. Set locale

locale  # check for UTF-8

sudo apt update && sudo apt install locales
sudo locale-gen en_US en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
export LANG=en_US.UTF-8

locale  # verify settings

2. Add the ROS2 apt repository

sudo apt install software-properties-common
sudo add-apt-repository universe

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

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

3. Install development tools and ROS tools

sudo apt update && sudo apt install -y \
  python3-flake8-docstrings \
  python3-pip \
  python3-pytest-cov \
  ros-dev-tools
  • Ubuntu 22.04일 경우
sudo apt install -y \
   python3-flake8-blind-except \
   python3-flake8-builtins \
   python3-flake8-class-newline \
   python3-flake8-comprehensions \
   python3-flake8-deprecated \
   python3-flake8-import-order \
   python3-flake8-quotes \
   python3-pytest-repeat \
   python3-pytest-rerunfailures

4. Get ROS2 Code

mkdir -p ~/ros2_humble/src
cd ~/ros2_humble
vcs import --input https://raw.githubusercontent.com/ros2/ros2/humble/ros2.repos src

5. Install dependencies using rosdep

sudo apt upgrade

sudo rosdep init
rosdep update
rosdep install --from-paths src --ignore-src -y --skip-keys "fastcdr rti-connext-dds-6.0.1 urdfdom_headers"

6. Build

cd ~/ros2_humble/
colcon build --symlink-install
  • ROS2 공식 홈페이지에서 development tool 한 개를 미설치하여, build가 아래와 같이 실패한다.

  • 아래 command를 이용하여 관련 tool을 설치하면 된다.
pip install setuptools==58.2.0
profile
리눅스 마스터 쏘

0개의 댓글