Development

[ROS2] Humble ์„ค์น˜ - Ubuntu 22.04 LTS

capaca 2023. 4. 24. 02:01

๐Ÿ”— ROS2 humble install

sudo apt install git
git clone https://github.com/leggiero-crescendo/Ubuntu-setup/blob/c03555ddfd097e7c330399cddc445e4a681d7291/ubuntu22.04/ros2_humble_desktop.sh
sh ros2_humble_desktop.sh

clone ํ•œ ํŒŒ์ผ์€ ์•„๋ž˜์™€ ๊ฐ™์ด ros2-humble-desktop version์„ ์„ค์น˜ํ•˜๋„๋ก ๊ตฌ์„ฑ๋˜์–ด ์žˆ๋‹ค.

 

ํŒŒ์ผ์„ ์„ค๋ช…ํ•˜์ž๋ฉด

๋จผ์ € ๊ด€๋ จํ•œ ํˆด๋“ค curl ๊ฐ™์ด ์›น์ƒ์˜ ๋ฐ์ดํ„ฐ๋ฅผ ๋‹ค์šดํ•˜๊ฑฐ๋‚˜ ์—…๋กœ๋“œํ•  ๋•Œ ํ•„์š”ํ•œ ๋„๊ตฌ๋ผ๋˜์ง€, build-essential์ฒ˜๋Ÿผ build์— ํ•„์š”ํ•œ ๋„๊ตฌ๋“ค์„ ์„ค์น˜ํ•ด ์คŒ

 

# https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html
sudo apt-get update && sudo apt upgrade -y

# Install
sudo apt-get update
sudo apt-get install -y software-properties-common
sudo add-apt-repository -y universe
sudo apt-get install -y curl gnupg2 lsb-release build-essential

 

์ง€์—ญ๊ณผ ์–ธ์–ด๋ฅผ ์„ค์ •ํ•ด ์ค€ ํ›„

# 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

 

ros์˜ gpg key๋ฅผ ์„ค์น˜ํ•ด์ฃผ๊ณ  sources list๋„ repository ๋“ฑ๋กํ•ด์ค€๋‹ค

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 
sudo apt install -y ros-humble-desktop
source /opt/ros/humble/setup.bash

 

์•„๋ž˜๋Š” ์ถ”๊ฐ€์ ์œผ๋กœ ์„ค์น˜ํ•  ๋ชฉ๋ก๋“ค 

sudo apt update && sudo apt install -y \
  python3-flake8-docstrings \
  python3-pip \
  python3-pytest-cov \
  ros-dev-tools
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
   

echo "success installing ROS2"
echo "Run 'source /opt/ros/humble/setup.bash'"

 

 

๋„ํ๋จผํŠธ์— ์•„์ฃผ ์ž˜ ๊ธฐ์ž…๋˜์–ด ์žˆ๋Š” ๋‚ด์šฉ์ด์ง€๋งŒ sh ํŒŒ์ผ์„ ํ™•์ธํ•˜๋ฉด์„œ ์ ์–ด๋‘” ์šฉ๋„์ž…๋‹ˆ๋‹ค.

๋ถ€์ •ํ™•ํ•˜๊ฑฐ๋‚˜ ์˜ค๊ธฐ์žฌ ๋œ ๋‚ด์šฉ์ด ์žˆ๋‹ค๋ฉด ์ง€์ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค. ๐Ÿฃ

 

[Reference]

Ubuntu 22.04 usb install : https://webnautes.tistory.com/1146

ROS2 humble install :  https://docs.ros.org/en/humble/Installation.html

ROS2 sh file link : https://github.com/leggiero-crescendo/Ubuntu-setup/blob/main/ubuntu22.04/ros2_humble_desktop.sh