ROS ์ค์น(๋ฐ์คํฌํ), ๊ฐ๋ฐ์ ํธ๋ฆฌํ๊ฒ ํด์ฃผ๋ ๋๊ตฌ๋ค ์๋ด
- -

Ubuntu Linux 18.04๊ฐ ์ค์น๋์ด ์๋ ๋ฐ์คํฌํ์ ๊ธฐ์ค์ผ๋ก ROS๋ฅผ ์ค์นํด ๋ด ์๋ค
์ค๋น๋ฌผ
- ์ฐ๋ถํฌ ๋ฆฌ๋ ์ค๊ฐ ์ค์น๋ ๋ฐ์คํฌํ (ํน์ ์ธ์ฅ ๊ทธ๋ํฝ์ ํฌํจํ ๋ ธํธ๋ถ) 1๋
Terminator ์ค์น
๋ค์ค ๋ถํ ํฐ๋ฏธ๋์ ์ํ ์ธํฐํ์ด์ค

# ์ค์น ์ ์
๋ฐ์ดํธ
$ sudo apt-get update
# terminator ์ค์น
$ sudo apt-get install terminator -y
ํตํฉ๊ฐ๋ฐํ๊ฒฝ(IDE)
- QTcreator+Qt Creator Plugin for ROS
์ค์น: sudo apt-get install qtcreartor
์ฅ์ :CmakeLists.txt์ ๊ทธ๋๋ก ์ฌ์ฉ ๊ฐ๋ฅ, rqt ํ๋ฌ๊ทธ์ธ ๋ฐ GUI ๊ฐ๋ฐํ๊ธฐ ์ฌ์
์ค์น๋์์
์์์๋ 16.04 ๊ธฐ์ค์ผ๋ก ๊น๊ณ ์์ต๋๋ค.
- vscode +ROS extension
์ค์น:์๋์ ๋์ ์์ต๋๋ค.
์ฅ์ :๊ฐ๋จํ ํ ์คํธ ํธ์ง๊ธฐ ์งํฅ,๋น ๋ฆ
- Eclipse
๋ฌด๊ฑฐ์
- QTcreator+Qt Creator Plugin for ROS
vscode ์ค์น

- Visual Studio IntelliCode
- Project Manager
- URDF
- C/C++
- Python
- CMake Tools
- Material Theme
- Code runner
- etc...
Additional Setup
$ sudo apt-get purge modemmanager
$ sudo adduser [์ฌ์ฉ์ ๊ณ์ ์ด๋ฆ]
$ sudo usermod -aG sudo [์ฌ์ฉ์ ๊ณ์ ์ด๋ฆ]
reference : How to create sudo user on Ubuntu 18.04 Bionic Beaver Linux
Ubuntu๋ Native๋ VM์ด๋ ํฐ ์๊ด์ด ์์ต๋๋ค. ์ฌ์ฉํ์๋ PC์ Ubuntu๋ฅผ ๋์ผ๋ถํ ์ผ๋ก ์ค์นํ๊ธฐ๊ฐ ๊บผ๋ ค์ง์ ๋ค๋ฉด VIrtualBox๋ฑ์ ์ด์ฉํด ์ค์น๋ฅผ ํด๋ ๋ฉ๋๋ค.
Ubuntu ๋ฒ์ ์ ๋ฐ๋ผ ์ง์๋๋ ROS์ ๋ฒ์ ์ด ๋ค๋ฅด๋ฏ๋ก ์๋์ ํ์ ์ ํ Ubuntu ๋ฒ์ ๊ณผ ROS ๋ฒ์ ์ด ์ผ์นํ์ง ์๋๋ค๋ฉด ์ ์์ ์ผ๋ก ์๋ํ์ง ์์ ์ ์์ต๋๋ค.
Ubuntu Version | ROS Version |
---|---|
Ubuntu 16.04 | ROS Kinetic |
Ubuntu 18.04 | ROS Meldoic |
Ubuntu 20.04 | ROS Noetic |
Why Meldoic?
Ubuntu๋ ๋ฆด๋ฆฌ์ค 20.04์์ ํ์ด์ฌ 2 ์ง์์ ์ค๋จํ ๊ฐ๋ฅ์ฑ์ด ๋์ต๋๋ค. ROS๊ฐ ํด๋น ๋ฒ์ ์ ์ฐ๋ถํฌ๋ฅผ ์ง์ํ ์ ์๋๋ก Melodic Morenia๋ก ์์ํ๋ ROS Python ํจํค์ง๋ Python 2.7๊ณผ Python 3.5 ์ด์์ ์ง์ํ๋ ๊ฒ์ด ์ข์ต๋๋ค. Melodic ๊ฐ๋ฐ ์ค์๋ Python 2์ Python 3(rosdep ํค ํฌํจ)๋ฅผ ๋ชจ๋ ์ง์ํ๋ ์์ ์ด ์ํ๋์ด ROS ํจํค์ง ๊ฐ๋ฐ์๋ค์ด ํ์ด์ฌ ๋ ๋ฒ์ ์ค ํ๋๋ฅผ ์ฌ์ฉํ์ฌ ๋ณด๋ค ์ฝ๊ฒ ํ ์คํธํ ์ ์๋ค.
Ubuntu ROS Melodic ์ค์น
$ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
$ curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
$ sudo apt update
$ sudo apt install ros-melodic-desktop-full
$ echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
$ source ~/.bashrc
$ sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential
$ sudo rosdep init
$ rosdep update
์ฐธ๊ณ ์๋ฃ : ROS Wiki

์์ผ๋ก ๋ค์๊ณผ ๊ฐ์ด ๋ฐฐํฌํ ROS ํจํค์ง๋ค์ ์ถ๊ฐ ์ค์นํ ์ ์์ต๋๋ค!
$ sudo apt-get install ros-melodic-<package name>
์๋์์ฑ tab
ํค๋ฅผ ์ ๊ทน ์ฌ์ฉํ์ธ์!!
์ค์น ํ์ธ
- ์๋ก ํฐ๋ฏธ๋์ ์ด์ด์ผ ํฉ๋๋ค.
- $ roscore ์คํ
$ roscore
... logging to /home/kimsooyoung/.ros/log/5b440a74-4cda-11eb-a263-9cb6d08bf543/roslaunch-kimsooyoung-XPS-13-9370-10527.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
started roslaunch server http://localhost:38251/
ros_comm version 1.14.10
SUMMARY
========
PARAMETERS
* /rosdistro: melodic
* /rosversion: 1.14.10
NODES
auto-starting new master
process[master]: started with pid [10537]
ROS_MASTER_URI=http://localhost:11311/
setting /run_id to 5b440a74-4cda-11eb-a263-9cb6d08bf543
process[rosout-1]: started with pid [10559]
started core service [/rosout]
๋ค์๊ณผ ๊ฐ์ ์ปค๋งจ๋๋ผ์ธ์ด ๋ณด์๋ค๋ฉด ์๋ฃ๋ ๊ฒ์ ๋๋ค!! ๐
์ํ์ผ์ ROS ํ๋ก๊ทธ๋จ์ ํ๋ ์คํ์์ผ ๋ณด๊ฒ ์ต๋๋ค.
#์ ํฐ๋ฏธ๋์ ์คํ
$ rosrun turtlesim turtlesim_node
# ์ ํฐ๋ฏธ๋ ์คํ
$ rosrun turtlesim turtle_teleop_key
#ํค๋ณด๋๋ก ํฐํ๋ด ์กฐ์ข
์ ์ปค๋งจ๋ ๋ผ์ธ๋ค๋ ๋ชจ๋ ์คํ๋์ จ๋ค๋ฉด, ๋ฌธ์ ์์ด ์ค์น๊ฐ ์๋ฃ๋ ๊ฒ์ ๋๋ค.
์ปค๋งจ๋ ์์ฝ(๊ฐ ๋ช ๋ น์ด๋น ํ๋์ ํฐ๋ฏธ๋์ ์ ๋ ฅ)

~/.bashrc ์์
geit ํธ์ง๊ธฐ ์คํ ์๋์ vim ์ด๋ nano ๋ก ์คํ
$ gedit ~/.bashrc
# ํ์ผ ์ ์ผ ์๋์ ๋ค์๊ณผ ๊ฐ์ ๋ด์ฉ ์
๋ ฅ
# alias ํค์๋ ๋ช
๋ น ์ค์
alias eb='gedit ~/.bashrc'#.bashrc ํ์ผ ์์
alias sb='source ~/.bashrc'# ์์ ํ ํ์ผ ์์คํ
์ ์ ์ฉ
alias gs='git status'#ํ์ฌ ์ ์ฅ์์์์ ์์
๋ด์ฉ์ ํ์ธํ๋ค.
alias gp='git pull'#์ธ์๋ ์ต์
์์ด ์คํํ๋ฉด ํ์ฌ ๋ก์ปฌ์ ๋ฑ๋ก๋ ์ถ์ ์ค์ธ ๋ธ๋์น์ ํด๋นํ๋ ์์ค ๋ชจ๋๋ฅผ ๊ฐ์ ธ์จ๋ค.
alias cw='cd ~'# ํ ๋๋ ํฐ๋ฆฌ๋ก ์ด๋
alias cs='cd ~/src'# srcํด๋๋ก ์ด๋
alias cm='cd ~ && catkin_make'#ํ๋๋ ํฐ๋ฆฌ๋ก์ด๋&&์บํจํจํค์ง์์ฑ
alias cma='catkin_make -DCATKIN_WHITELIST_PACKAGES=""'
alias cop='catkin_make --only-pkg-with-deps'
alias sds='source devel/setup.bash'#์์ ํ ํ์ผ์ ์์คํ
์ ๋ฐ์
alias axclient='rosrun actionlib axclient.py'
# ์ข
๋ฃ ํ ํฐ๋ฏธ๋ ์
๋ฐ์ดํธ
$ source ~/.bashrc
#์์ ํ ํ์ผ์ ์์คํ
์ ๋ฐ์
#ip์ฃผ์ ๋ณ๊ฒฝ์๋ง
์์์ ์ค์ ํ ํ๊ฒฝ์ ํ์ธํ๊ณ ์ถ์ผ์๋ฉด ์๋์ ๋ช ๋ น์ ์คํํฉ๋๋ค.
export | grep ROS
๊ฐ๊ฐ์ ๋ช ๋ น์ด ์ด๋ค ์๋ฏธ๋ฅผ ๊ฐ์ง๋์ง๋ ์์ผ๋ก ๊ณ์ํด์ ๋ค๋ค๋ด ๋๋ค.
๋ค๋ง, alias
๊ฐ ์ด๋ค ๊ฒ์ธ์ง๋ง ์ด์ง ์ง์ด๋ณด๊ณ ๋์ด๊ฐ๊ฒ ์ต๋๋ค.
Uploaded by N2T
'python > ROS' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
ROS ๊ธฐ๋ณธ๋ช ๋ น์ด (0) | 2023.04.04 |
---|---|
ROS (0) | 2023.04.04 |
Workspace ํฐํ๋ด ์ฝ๋๋ก ์์ ์คํ (0) | 2023.04.03 |
๋ฆฌ๋ ์ค ํฐ๋ฏธ๋ ๋จ์ถํค (0) | 2023.04.03 |
์ค๋น์ฌํญ (0) | 2023.04.03 |
๋น์ ์ด ์ข์ํ ๋งํ ์ฝํ ์ธ
์์คํ ๊ณต๊ฐ ๊ฐ์ฌํฉ๋๋ค