[ROS2] Ubuntu 20.04 Focal - ROS2 Foxy ์„ค์น˜ ๋ฐ ๊ตฌ๋™

2022. 7. 25. 16:25ยท๐Ÿ’ป Language/ROS : ๋กœ๋ด‡์‹œ์Šคํ…œ
728x90
728x90

ROS๋Š” ROS1, ROS2 ๋‘ ๊ฐ€์ง€ ๋ฒ„์ „์ด ์กด์žฌํ•˜๋Š”๋ฐ, ์ด๋•Œ๊นŒ์ง€ ROS1๋งŒ ์‚ฌ์šฉํ•˜๋‹ค ์ด๋ฒˆ ์‹œ๋ฎฌ๋ ˆ์ดํ„ฐ ์„ค์น˜์—๋Š” ROS2๊ฐ€ ํ•„์š”ํ•˜์—ฌ ์ฒ˜์Œ์œผ๋กœ Installํ•˜๊ฒŒ ๋˜์—ˆ๋‹ค. ROS1๋ณด๋‹ค ์„ค์น˜๊ฐ€ ๊ฐ„๋‹จํ•˜๊ณ  ์ง€์›ํ•˜๋Š” ๊ธฐ๋Šฅ๋„ ๋งŽ๋‹ค๊ณ  ํ•˜๋Š”๋ฐ ํ•œ ๋ฒˆ ์•Œ์•„๋ณด๊ธฐ๋กœ ํ•œ๋‹ค.

 

 

ROS Version (amd64, arm64)

2018๋…„ ์ดํ›„(๊ทธ๋‚˜๋งˆ ์ตœ์‹ ) ๋ฒ„์ „๋งŒ์„ ๋‚˜์—ดํ•˜์˜€์œผ๋ฉฐ, ์ž์‹ ์˜ OS ๋ฒ„์ „์— ๋งž๋Š” ROS2 ๋ฒ„์ „์„ Installํ•˜์—ฌ ์‚ฌ์šฉํ•˜๋ฉด ๋œ๋‹ค. ๋ณดํ†ต ์šฐ๋ถ„ํˆฌ 20.04 ๋ฒ„์ „์—์„œ๋Š” Foxy๋ฅผ, 18.04 ๋ฒ„์ „์—์„œ๋Š” Dashing์„ ๋งŽ์ด ์‚ฌ์šฉํ•œ๋‹ค๊ณ  ํ•œ๋‹ค. ๋‚˜๋Š” CLOiSim์„ ํฌํŒ…ํ•˜๊ธฐ ์œ„ํ•ด ROS2๋ฅผ ์„ค์น˜ํ•˜๋Š”๋ฐ ๋ฐฐํฌ์‚ฌ์˜ ํ…Œ์ŠคํŠธ ํ™˜๊ฒฝ์ด ์šฐ๋ถ„ํˆฌ 20.04์ด๋ฏ€๋กœ Foxy Version์„ ์„ค์น˜ํ•  ๊ฒƒ์ด๋‹ค.

  • Ubuntu 22.04(Jammy) : Humble Hawksbill
  • Ubuntu 20.04(Focal) : Calactic Geochelone, Foxy Fitzroy
  • Ubuntu 18.04(Bionic) : Eloquent Elusor, Dashing Diademata, Crystal Clemmys
 

Ubuntu (source) — ROS 2 Documentation: Foxy documentation

If you have already installed ROS 2 another way (either via Debians or the binary distribution), make sure that you run the below commands in a fresh environment that does not have those other installations sourced. Also ensure that you do not have source

docs.ros.org

Docker ํ™˜๊ฒฝ์„ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ, ๊ธฐ๋ณธ ์–ธ์–ด ์„ค์ •์ด POSIX๋กœ ๋˜์–ด ์žˆ์–ด UTF-8 ์ธ์ฝ”๋”ฉ์„ ์ง€์ •ํ•ด์ฃผ์–ด์•ผ ํ•œ๋‹ค.

$ locale  # check for UTF-8

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

$ locale  # verify settings

ROS2๋ฅผ ์„ค์น˜ํ•œ๋‹ค.

$ apt install software-properties-common
$ add-apt-repository universe
$ apt update && apt install curl gnupg2 lsb-release
$ 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 $(source /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null

ROS ๊ฐœ๋ฐœ ํˆด์„ ์„ค์น˜ํ•œ๋‹ค. (apt update๋ฅผ ํ•˜์ง€ ์•Š์„ ๊ฒฝ์šฐ python3-colcon-common-extensions, python3-vcstool ํŒจํ‚ค์ง€๋ฅผ ๋ฐ›์•„์˜ค์ง€ ๋ชปํ•˜๊ณ  ์„ค์น˜๊ฐ€ ๋ถˆ๊ฐ€ํ•  ์ˆ˜ ์žˆ์Œ)

$ apt update && apt install -y \
  build-essential \
  cmake \
  git \
  libbullet-dev \
  python3-colcon-common-extensions \
  python3-flake8 \
  python3-pip \
  python3-pytest-cov \
  python3-rosdep2 \
  python3-setuptools \
  python3-vcstool \
  wget
# install some pip packages needed for testing
$ python3 -m pip install -U \
  argcomplete \
  flake8-blind-except \
  flake8-builtins \
  flake8-class-newline \
  flake8-comprehensions \
  flake8-deprecated \
  flake8-docstrings \
  flake8-import-order \
  flake8-quotes \
  pytest-repeat \
  pytest-rerunfailures \
  pytest
# install Fast-RTPS dependencies
$ apt install --no-install-recommends -y \
  libasio-dev \
  libtinyxml2-dev
# install Cyclone DDS dependencies
$ apt install --no-install-recommends -y \
  libcunit1-dev
$ apt install ros-foxy-desktop ros-foxy-rmw-cyclonedds-cpp
$ source /opt/ros/foxy/setup.bash
$ printenv |grep -i ROS

์›Œํฌ์ŠคํŽ˜์ด์Šค๋ฅผ ํ•˜๋‚˜ ์ƒ์„ฑํ•˜๊ณ , ROS ์ฝ”๋“œ๋ฅผ ๋ฐ›์•„์˜จ๋‹ค. (์•ฝ 3๋ถ„ ์†Œ์š”)

$ mkdir -p ~/ros2_foxy/src
$ cd ~/ros2_foxy
$ wget https://raw.githubusercontent.com/ros2/ros2/foxy/ros2.repos
$ vcs import src < ros2.repos

Ubuntu๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ํ•˜๋Š” ROS๋Š” ์ž์ฃผ ์—…๋ฐ์ดํŠธ๋˜๊ธฐ ๋•Œ๋ฌธ์—, ์˜์กด์„ฑ์„ ํ™•์ธํ•ด์ค„ ํ•„์š”๊ฐ€ ์žˆ๋‹ค. ์•„๋ž˜ ๋ช…๋ น์„ ์‹คํ–‰ํ•  ๋•Œ rosdep init์„ ์‹คํ–‰ํ•˜์˜€์œผ๋‚˜ ์ด๋ฏธ ํŒŒ์ผ์ด ์กด์žฌํ•œ๋‹ค๊ณ  ํ•˜์—ฌ ๋›ฐ์–ด๋„˜๊ณ  update๋ถ€ํ„ฐ ์ง„ํ–‰ํ•˜์˜€๋‹ค. install๊นŒ์ง€ ์™„๋ฃŒํ•ด์ฃผ๋ฉด, ROS2 ์„ค์น˜๊ฐ€ ๋๋‚œ๋‹ค.

$ apt upgrade
$ rosdep init
$ rosdep update
$ rosdep install --from-paths src --ignore-src -y --skip-keys "fastcdr rti-connext-dds-5.3.1 urdfdom_headers"
๋”๋ณด๊ธฐ

~/.bashrc

alias vr='vim ~/.bashrc'
alias nr='nano ~/.bashrc'
alias sr='source ~/.bashrc'
alias killgazebo='killall -9 gazebo & killall -9 gzserver  & killall -9 gzclient'alias cw='cd ~/robot_ws'
alias cs='cd ~/robot_ws/src'alias cb='cd ~/robot_ws && colcon build --symlink-install'
alias cbp='cd ~/robot_ws && colcon build --symlink-install --packages-select'alias rt='ros2 topic list'
alias re='ros2 topic echo'
alias rn='ros2 node list'
alias af='ament_flake8'
alias ac='ament_cpplint'alias testpub='ros2 run demo_nodes_cpp talker'
alias testsub='ros2 run demo_nodes_cpp listener'
alias testpubimg='ros2 run image_tools cam2image'
alias testsubimg='ros2 run image_tools showimage'alias ros2_init='. /opt/ros/foxy/setup.bash'
alias all_init='. ~/robot_ws/install/local_setup.bash'export ROS_DOMAIN_ID=10export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
# export RMW_IMPLEMENTATION=rmw_fastrtps_cpp# export RCUTILS_CONSOLE_OUTPUT_FORMAT='[{severity} {time}] [{name}]: {message} ({function_name}() at {file_name}:{line_number})'
export RCUTILS_CONSOLE_OUTPUT_FORMAT='[{severity}] [{time}]: {message}'
export RCUTILS_COLORIZED_OUTPUT=1
# export RCUTILS_LOGGING_USE_STDOUT=1
export RCUTILS_LOGGING_BUFFERED_STREAM=1source /opt/ros/foxy/setup.bash
source ~/robot_ws/install/local_setup.bash
728x90
320x100
์ €์ž‘์žํ‘œ์‹œ (์ƒˆ์ฐฝ์—ด๋ฆผ)

'๐Ÿ’ป Language > ROS : ๋กœ๋ด‡์‹œ์Šคํ…œ' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

[ROS2+Gazebo] Docker Image๋กœ ROS2, Gazebo ๋นŒ๋“œํ•˜๊ธฐ  (0) 2022.07.27
[Ubuntu+ROS2] LG CLOiSim Simulator ์„ค์น˜ ๋ฐ ๊ตฌ๋™  (0) 2022.07.26
[ROS] Gazebo ์‹œ๋ฎฌ๋ ˆ์ด์…˜ ํ™˜๊ฒฝ์— ๋Œ€ํ•ด ์•Œ์•„๋ณด์ž.  (0) 2022.07.08
[ROS] ๋กœ๋ด‡ ๋ชจ๋ธ์„ ํ‘œํ˜„ํ•˜๊ธฐ ์œ„ํ•œ XML, URDF์— ๋Œ€ํ•ด ์•Œ์•„๋ณด์ž.  (0) 2022.07.06
[ROS] Python์œผ๋กœ ๊ฐ„๋‹จํ•œ Publisher & Subscriber ๋งŒ๋“ค๊ธฐ  (0) 2022.07.04
'๐Ÿ’ป Language/ROS : ๋กœ๋ด‡์‹œ์Šคํ…œ' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€
  • [ROS2+Gazebo] Docker Image๋กœ ROS2, Gazebo ๋นŒ๋“œํ•˜๊ธฐ
  • [Ubuntu+ROS2] LG CLOiSim Simulator ์„ค์น˜ ๋ฐ ๊ตฌ๋™
  • [ROS] Gazebo ์‹œ๋ฎฌ๋ ˆ์ด์…˜ ํ™˜๊ฒฝ์— ๋Œ€ํ•ด ์•Œ์•„๋ณด์ž.
  • [ROS] ๋กœ๋ด‡ ๋ชจ๋ธ์„ ํ‘œํ˜„ํ•˜๊ธฐ ์œ„ํ•œ XML, URDF์— ๋Œ€ํ•ด ์•Œ์•„๋ณด์ž.
mxnxeonx
mxnxeonx
"์•„, ์ด๊ฑฐ ๋ญ์˜€๋”๋ผ"๋ฅผ ํ•˜์ง€ ์•Š๊ธฐ์œ„ํ•œ ์ผ๊ธฐ์žฅ.
  • mxnxeonx
    MJ's Development Diary
    mxnxeonx
  • ์ „์ฒด
    ์˜ค๋Š˜
    ์–ด์ œ
    • ๋ถ„๋ฅ˜ ์ „์ฒด๋ณด๊ธฐ (154)
      • ๐Ÿ’ป Language (43)
        • Java : ์ž๋ฐ” (18)
        • Python : ํŒŒ์ด์ฌ (9)
        • ROS : ๋กœ๋ด‡์‹œ์Šคํ…œ (9)
        • Android : ์•ˆ๋“œ๋กœ์ด๋“œ (4)
        • JavaScript : ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ (2)
      • ๐ŸŒ Environment (19)
        • IDE : ํ†ตํ•ฉ๊ฐœ๋ฐœํ™˜๊ฒฝ (9)
        • Virtual : ๊ฐ€์ƒํ™˜๊ฒฝ (10)
      • โš™ Framework (12)
        • Vue-๋ทฐ (3)
        • Spring-์Šคํ”„๋ง (7)
      • ๐Ÿ’พ DataBase (18)
      • ๐ŸŒŒ OS (36)
        • Linux-๋ฆฌ๋ˆ…์Šค (36)
      • ๐Ÿ’ฌ CI · CD (7)
        • Git : ๊นƒ (7)
      • ๐Ÿ“ƒ ETC (3)
      • ๐Ÿค– AI (4)
  • ๋งํฌ

    • GitHub
  • ์ธ๊ธฐ ๊ธ€

  • ์ตœ๊ทผ ๋Œ“๊ธ€

  • ์ตœ๊ทผ ๊ธ€

  • hELLOยท Designed By์ •์ƒ์šฐ.v4.10.3
mxnxeonx
[ROS2] Ubuntu 20.04 Focal - ROS2 Foxy ์„ค์น˜ ๋ฐ ๊ตฌ๋™
์ƒ๋‹จ์œผ๋กœ

ํ‹ฐ์Šคํ† ๋ฆฌํˆด๋ฐ”