๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐Ÿ’ป Computer/ROS

ROS ์„ค์น˜ ์ด๋†ˆ!!!

๋‚˜ ํœ˜๋ฐ”๋ณด.
์„ค์น˜๋ฅผ ์ œ์ผ ์–ด๋ ค์›Œํ•ฉ๋‹ˆ๋‹ค.
ROS tutorial ๋ฌธ์•ž์—์„œ ๊ณ„์† ๋น™๊ธ€ ๋น™๊ธ€ ๋Œ๋‹ค๊ฐ€
๋‹ค์šด๋ฐ›์„ ๋ฌด์–ธ๊ฐ€๊ฐ€ ์žˆ์œผ๋ฉด sources.list ํŒŒ์ผ์— ๋งํฌ๋ฅผ ์ถ”๊ฐ€ํ•ด์•ผ๋œ๋‹ค๋Š” ๊นจ๋‹ฌ์Œ์„ ์–ป์Œ.
๊ทธ ์ดํ›„ ์ตœ์˜ˆ์ฐฌํ˜•์ด ๋„์™€์ค€๋‹คํ•ด์„œ ์ญ๋ž˜์ญ๋ž˜ ๋…ธํŠธ๋ถ์„ ๊ฐ€์ง€๊ณ  ์›”๊ณก์œผ๋กœ ํ–ฅํ–ˆ๋‹ค.

ํ•˜......๋ ˆ์•Œ ํ˜„ํƒ€์˜ค๋Š”๋ฐ..... ์‚ฝ์งˆ์„ ๋ฉฐ์น ๋ฐ–์— ์•ˆํ•˜๊ณ  ๋„์›€ ๋ฐ›์€๊ฑฐ๋ผ ์ƒ๊ฐํ•˜๊ณ 
๋ฐฐ์šด๊ฑธ ์ •๋ฆฌํ•ด๋ณด๋ คํ•จ.
**๋ณด๋ผ๋Œ์ด๊ฐ€ ์šฐ๋ถ„ํˆฌ ๋ช…๋ น์ฐฝ์— ์นœ ์•„์ด๋“ค์ž…๋‹ˆ๋‹ค.

์ผ๋‹จ ros ๊ณต์‹ tutorial์— ์žˆ๋Š” melodic installation์„ ๋”ฐ๋ผํ•จ (http://wiki.ros.org/melodic/Installation/Ubuntu)

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'

which curl ๋กœ curl์˜ ์œ„์น˜๋ฅผ ์ฐพ์Œ.
~~/bin/curl์— ์žˆ๋‹ค๊ณ  ์•Œ๋ ค์คŒ

curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
curl ์„ค์น˜

์„ค์น˜๊ฐ€ ์ž˜ ๋˜๋ฉด OK๋ผ๊ณ  ๋Œ€๋ฌธ์ง๋งŒํ•˜๊ฒŒ ์•Œ๋ ค์คŒ

๊ทธ๋ ‡๋‹ค๋ฉด ์ด์ œ~ ์—…๋Žƒ์„ ํ•ฉ๋‹ˆ๋‹น
sudo apt update
/*์•„๊ทผ๋ฐ, ์•ž์„œ์„œ ๊ณ„์† ๋ ‰๊ฑธ๋ ธ๋Š”๋ฐ ํ™˜๊ฒฝ๋ณ€์ˆ˜ ํŒŒ์ผ ํ™•์ธํ•ด๋ณด๋‹ˆ๊นŒ ์ค‘๋ณต๋˜๊ฒŒ ์„ค์น˜๋œ๊ฒŒ ๋„ˆ๋ฌด ๋งŽ์•˜๋˜ ๊ฑฐ์ž„.
๊ทธ๋ž˜์„œ ๊ทธ๋ƒฅ ์‹น ๊ฐˆ๊ณ  ์žฌ์„ค์น˜ํ•œ๋‹ค์Œ ์‹œ์ž‘ํ–ˆ์Šต๋‹ˆ๋‹ค.
์ €์ฒ˜๋Ÿผ ์ž๊พธ ๋ง‰ ๋”ฐ๋ผํ•˜๋‹ค๊ฐ€ error loop ๋Šช์— ๋น ์กŒ๋‹ค๋ฉด ๊ทธ๋ƒฅ ๊น”์Œˆํ•˜๊ฒŒ ์ง€์šฐ๊ณ  ์‹œ์ž‘ํ•˜๋Š” ๊ฑธ ์ถ”์ฒœ!!*/

Fetched 25.2 MB in 9s (2709 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
174 packages can be upgraded. Run 'apt list --upgradable' to see them.
์–ด์ฉŒ๊ตฌ์ €์ฉŒ๊ตฌ Get์œผ๋กœ ํ•œ 30์ค„ ๊ฐ€๋Ÿ‰ ์šฐ๋ถ„ํˆฌ์—์„œ ์„ค์น˜ ํŒŒ์ผ์„ ๋ฌด์‚ฌํžˆ ๋ฐ›์•„์˜ค๋ฉด ์ด๋ ‡๊ฒŒ ๋œฌ๋‹ค.

์ด์ œ ์—…๊ทธ๋ ˆ์ด๋“œ
sudo apt upgrade

Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
distro-info motd-news-config python3-pexpect python3-ptyprocess

๊ทธ๋Ÿผ ์ด์ œ new packages ์„ค์น˜ํ•˜๊ณ , ๋ญ ํŒจํ‚ค์ง€ ์—…๊ทธ๋ ˆ์ด๋“œ๋ฅผ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค.

174 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 109 MB of archives.
After this operation, 52.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] y

์—ฌ๊ธฐ์„œ ๋ฌธ์ œ๋ฐœ๊ฒฌ

!!์ง€๊ธˆ๊นŒ์ง€ ์šฉ๋Ÿ‰์ด ์—†์—ˆ์–ด์„œ ๋ฐ›์•„์˜ค๋‹ค ๋ง์•„์„œ ๊ณ„์† ์˜ค๋ฅ˜๋‚ฌ๋˜ ๊ฒƒ!!

์šฉ๋Ÿ‰์„ ์ถฉ๋ถ„ํžˆ ๋งˆ๋ จํ•˜๊ณ  ์„ค์น˜ํ•˜์‹œ๊ธธ ๋ฐ”๋ž๋‹ˆ๋‹ค....................................

๋ฌดํŠผ ์„ค์น˜ํ•˜๋Š” ์™€์ค‘์—๋„ ์“ธ๋ฐ์—†๋Š” ํ”„๋กœ๊ทธ๋žจ ์ง€์šฐ๋ฉด์„œ ๋ผ์ด๋ธŒ๋กœ ์„ค์น˜ ๋ฐ›์Œ
๋˜ 178์ค„ ๊ฐ€๋Ÿ‰์˜ ์„ค์น˜๋ฅผ ํ•ฉ๋‹ˆ๋‹ค.

Extracting templates from packages: 100%
Preconfiguring packages ...
(Reading database ... 29293 files and directories currently installed.)
Preparing to unpack .../ubuntu-server_1.417.5_amd64.deb ...
Unpacking ubuntu-server (1.417.5) over (1.417.4) ...
Preparing to unpack .../base-files_10.1ubuntu2.11_amd64.deb ...
Unpacking base-files (10.1ubuntu2.11) over (10.1ubuntu2.9) ...
Setting up base-files (10.1ubuntu2.11) ...
Installing new version of config file /etc/issue ...
Installing new version of config file /etc/issue.net ...
๋ชฐ๋ผ ๋ง‰ ๋ธ”๋ผ๋ธ”๋ผ ์ด๋ ‡๊ฒŒ ๋œธ

0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done. //๊ฐœ๊ฐ๋™ ๋ชจ๋จผํŠธ
Processing triggers for initramfs-tools (0.130ubuntu3.13) ...

์ด์ œ ๋‹ค์‹œ ๋ช…๋ น์–ด pwd๋ฅผ ์น˜๋ฉด, ํ˜„์žฌ ๋””๋ ‰ํ† ๋ฆฌ๋ฅผ ์•Œ๋ ค์ค๋‹ˆ๋‹ค.
/root

๋ฃจํŠธ ๋””๋ ‰ํ† ๋ฆฌ์— ros melodic desktop full์„ ์„ค์น˜!!
์ง€๊ธˆ๊นŒ์ง€ ํ™˜๊ฒฝ๋ณ€์ˆ˜๋ฅผ ๋น„๋กฏํ•œ ์„ธํŒ… ์ž‘์—…์ด์—ˆ๋‹ค๋Š”๊ฒŒ ๊ธฐ๊ฐ€๋ง‰ํž˜.
sudo apt install ros-melodic-desktop-full

๋˜ ๋‹ค๋Ÿ‰์˜ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ๊ฐ€์ ธ์˜ค๊ตฌ, ๋ง‰ํŒ์— ์ด๋ ‡๊ฒŒ ๋œจ๋ฉด Y๋ฅผ ๋ˆŒ๋Ÿฌ์ฃผ๋ฉด ๋œ๋‹ค.
0 upgraded, 1259 newly installed, 0 to remove and 0 not upgraded.
Need to get 585 MB of archives.
After this operation, 2616 MB of additional disk space will be used.
Do you want to continue? [Y/n] y

์—ฌ๊ธฐ์„œ ์ด์ œ ๊ฐœ์˜ค๋ž˜๊ฑธ๋ฆฐ๋“ฏ.
Get 1259์ค„+@@@@@

echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
๋ฐฐ์‰ฌ shell์— ""์—ฌ๊ธฐ ์•ˆ์— ์žˆ๋Š” ๊ฑธ ์ถ”๊ฐ€ํ•˜๋ผ๋Š” ๋œป
source ~/.bashrc
๋ฐฐ์‰ฌ ์Šคํฌ๋ฆฝํŠธ ์ˆ˜์ •ํ•œ ๊ฑฐ ๋ฐ”๋กœ ์ ์šฉํ•˜๋ผ๋Š” ๋ช…๋ น์–ด

sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential

๊ทธ๋ฆฌ๊ณ  ์œ ์ €๋ฅผ ์ถ”๊ฐ€ํ•ด์คŒ
sudo adduser (์จ์•ผํ•  ๋ถ€๋ถ„. ์ž๊ธฐ๊ฐ€ ์ง€์ •)
๊ทธ๋Ÿผ ์œ ๋‹‰์Šค ํŒจ์Šค์›Œ๋“œ๋ฅผ ์น˜๋ผ๊ณ  ๋‚˜์˜ค๊ณ , ์•Œ์•„์„œ ์„ค์ •
๋’ค์— info๋“ค ์น˜๋ผ๊ณ  ๋‚˜์˜ค๋Š”๋ฐ ๊ทธ๊ฒƒ๋„ ์•Œ์•„์„œ~

๊ทธ๋ฆฌ๊ณ  su (์œ„์— ์ณค๋˜ ์œ ์ €๋„ค์ž„) ์น˜๋ฉด root๋กœ ์ง„์ž…ํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.
๋‹ค์‹œ retry~
sudo rosdep fix-permissions
rosdep update
//๊ทผ๋ฐ ์ด๋•Œ ์™€์ดํŒŒ์ด ๋ถˆ์•ˆ์ •ํ•ด์„œ(์ง€ํ•˜์ฒ ) ๊ณ„์† time out ์—๋Ÿฌ๋‚ฌ๋Š”๋ฐ,
๊ทธ๋ƒฅ ๊ณ„์† ํ•˜๋‹ค๋ณด๋ฉด ๋จ.
//์•„๋ž˜ ์ฐฝ ๋ˆ„๋ฅด๋ฉด time out ์›์ธ์„ ์ฐพ์„ ์ˆ˜ ์žˆ๋Š” ๋ช…๋ น์–ด ์•Œ๋ ค์ฃผ๋Š” ์‚ฌ์ดํŠธ๊ฐ€ ๋‚˜์˜ต๋‹ˆ๋‹ค์š”.


printenv | grep ROS
ROS๋ฅผ ํฌํ•จํ•œ ํŒŒ์ผ๋“ค ๋‹ค ๋ณด์—ฌ์ค˜!!!
๊ทธ๋Ÿผ ๋ธ”๋ผ๋ธ”๋ผ ros ๋ฒ„์ „์ด๋ž‘, ํŒจํ‚ค์ง€ ๊ฒฝ๋กœ, ์ข…๋ฅ˜ ๋“ฑ๋“ฑ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Œ.

which rosws๋กœ ์œ„์น˜๋ฅผ ์ฐพ๊ณ  ๋๋‚ฌ์Šต๋‹ˆ๋‹น

๋ฐ˜์‘ํ˜•