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
'๐ป 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 |