본문으로 건너뛰기

Install guide for ROS2 Humble

1. 로케일(Locale) 설정​

UTF-8을 지원하는 로케일이 필요합니다. Docker 컨테이너와 같은 최소 환경에서는 POSIX처럼 제한적인 로케일이 설정되어 있을 수 있습니다. 아래와 같은 설정을 권장합니다 (다른 UTF-8 로케일도 무방함).

locale # 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 # 설정 확인

2. Ubuntu 저장소 활성화 및 ROS apt source 패키지 설치​

  • ros2-apt-source 패키지를 설치하면, ROS 2 저장소가 자동으로 설정됩니다. 이후 이 패키지의 새로운 버전이 배포될 때 저장소 설정도 자동 업데이트됩니다.
sudo apt install software-properties-common
sudo add-apt-repository universe

sudo apt update && sudo apt install curl -y

export ROS_APT_SOURCE_VERSION=$(curl -s https://api.github.com/repos/ros-infrastructure/ros-apt-source/releases/latest | grep -F "tag_name" | awk -F\" '{print $4}')

curl -L -o /tmp/ros2-apt-source.deb "https://github.com/ros-infrastructure/ros-apt-source/releases/download/${ROS_APT_SOURCE_VERSION}/ros2-apt-source_${ROS_APT_SOURCE_VERSION}.$(. /etc/os-release && echo $VERSION_CODENAME)_all.deb"

sudo dpkg -i /tmp/ros2-apt-source.deb

3. apt 저장소 캐시 업데이트​

  • !! Ubuntu 22.04 초기 업데이트 문제로 인해 systemd, udev 관련 패키지를 먼저 업데이트해야 합니다.
  • !! 업데이트 없이 ROS 2를 설치하면 시스템 필수 패키지가 제거될 수 있습니다.
  • !! 자세한 내용은 ros2/ros2#1272, Launchpad #1974196 참조.
sudo apt update

4. ROS2 데스크톱 설치 (권장)​

sudo apt install ros-humble-desktop