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

๐Ÿ’ป Computer/ROS

ROS Using Catkin Workspace

์ง€์ง€๊ณ  ๋ณถ๊ณ  ํ•˜๋‹ˆ๊นŒ ๊ฐ์ด ์žกํžˆ๊ณ  ์žˆ์Œ.

ROS๋ผ๋Š” ์šด์˜์ฒด์ œ์—์„œ ๋‚ด๊ฐ€ ์–ด๋””์ฏค ์žˆ๋Š”์ง€๋Š” ์ž˜ ๋ชจ๋ฅด๊ฒ ์ง€๋งŒ.. ๋ฌดํŠผ.

 

์ผ๋‹จ ROS๋ฅผ ์œ„ํ•ด์„  Catkin์ด๋ผ๋Š” ๊ฑธ ์•Œ์•„์•ผํ•จ.

catkin์ด๋ž€ ros package๋“ค์„ ๊ด€๋ฆฌํ•˜๋Š” workspace๋กœ, ๊ฐ package๋“ค์—๋Š” source๋“ค์ด ์žˆ์Œ.

๋ญ ์–ด๋””์„œ๋Š” "infra structure์™€ mark๋ฅผ ๊ด€๋ฆฌํ•˜๋Š” low-level ๋นŒ๋“œ์‹œ์Šคํ…œ"์œผ๋กœ ์„ค๋ช…ํ•œ๋‹ค.

 

$ cd ~/catkin_ws/src
$ catkin_create_pkg

์œ„ ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด catkin_wsํด๋” ๋‚ด src ํด๋”์— ํŒจํ‚ค์ง€๋ฅผ ๋งŒ๋“ค๋ฉด

์ž๋™์œผ๋กœ CMakeLists.txt,  package.xml,  include,  src๊ฐ€ ๋งŒ๋“ค์–ด์ง. (๋’ค์— ๋‘๊ฐœ๋Š” ๋นˆํด๋”)

 

์ผ๋‹จ CMakeLists.txt์—๋Š” ์—ฌ๋Ÿฌ ํ•จ์ˆ˜๋“ค์ด ๋“ค์–ด์žˆ๋Š”๋ฐ, ์•„์ง ๋ญ๊ฐ€ ๋ญ”์ง€ ๋ชจ๋ฅด๊ฒ ๊ณ 

package.xml์—๋Š” ์—ฌ๋Ÿฌ dependency๊ฐ€ ์ •์˜๋ผ ์žˆ์Œ.

์•ˆ๋“œ๋กœ์ด๋“œ ํ•  ๋•Œ๋„ ์ƒ์œ„ ๋ชฉ๋ก์— AndroidManifest.xml ํŒŒ์ผ์ด ์žˆ์—ˆ๋Š”๋ฐ,

๊ทธ๊ฒƒ์ฒ˜๋Ÿผ ์•ฝ๊ฐ„ ํ•„์š”ํ•œ ์š”์†Œ ๊ถŒํ•œ ๊ฐ™์€๊ฑฐ ์„ค์ •ํ•ด์ฃผ๋Š”๊ฑฐ๋ž‘ ๋น„์Šทํ•˜์ง€ ์•Š๋‚˜ ์‹ถ์Œ. (์ด๊ฒƒ๋„ ์•„์ง ๋ชจ๋ฆ„)

์—ฌ๊ธฐ์—” ์–ด๋””์— ๋‚ด๊ฐ€ ๋งŒ๋“  package๋ฅผ ์˜ฌ๋ฆด ์ผ์ด ์žˆ์„๋•Œ ๋‚ด๊ฐ€ ๋งŒ๋“ค์—ˆ๋‹ค๋Š” mark๋ฅผ ํ•  ์ˆ˜ ์žˆ๋Š” ๊ฒƒ๋„ ์žˆ์Œ.

 

using workspace ํŠœํ† ๋ฆฌ์–ผ ๋‹ค์Œ์ด overlay๋ž‘ linking package์ธ๋ฐ,

์ด๊ฑด ๋ญ ๋Œ€์ถฉ ๋”ฐ๋ผํ•ด๋ดค๊ณ , ๊ทธ ๋‹ค์Œ์— ๋‚˜์˜ค๋Š”๊ฒŒ

overlay๋ž‘ linkingํ•˜๋‹ค๋ณด๋ฉด ๋นŒ๋”๊ฐ€ ๋ณต์žกํ•ด์ง€๋‹ˆ๊นŒ ์ด๋•Œ ์œ ์šฉํ•˜๊ฒŒ ์“ธ ์ˆ˜ ์žˆ๋Š”๊ฒŒ ์žˆ์–ด! ํ•˜๊ณ  ์•Œ๋ ค์ฃผ๋Š”๊ฒŒ

๋ฐ”๋กœ rosws๋‹ค.

 

์•ž์„œ using rosbuild with catkin์ด๋ž€ ํŠœํ† ๋ฆฌ์–ผ๋กœ ๋„˜์–ด์˜จ๊ฑด๋ฐ,

 ~ ๊ทธ ์ „์— rosws๋ถ€ํ„ฐ ์•Œ๊ณ  ์˜ค๋ ด~ ์ด๋Ÿผ. ๊ทผ๋ฐ ๋˜ ๋“ค์–ด๊ฐ€๋„ ๋“ค์–ด๊ฐ€๋„ ๋์ด ์•ˆ๋ณด์ž„.

๋ณต์žกํ•œ package๊ด€๋ฆฌ๋ฅผ ์œ„ํ•ด rosws๋ฅผ ์•Œ๋ ค์ค€๋‹ค๋ฉด์„œ ์ง€๋ถ€ํ„ฐ ๋งˆํŠธ๋ฃŒ์‹œ์นด ์ธํ˜•์ธ์ค„ ์•Œ์•˜์Œ.

์จŒ๋“ 

 

๋จผ์ € rosws๋ฅผ ์“ฐ๊ธฐ ์œ„ํ•ด 

$ sudo apt-get install python-rosinstall
$ cd /tmp
$ mkdir rosws_tutorial
$ cd rosws_tutorial
$ rosws init
Writing /tmp/rosws_tutorial/.rosinstall
(Over-)Writing setup.sh, setup.bash, and setup.zsh in /tmp/rosws_tutorial

rosws init complete.

Type 'source ./setup.bash' to change into this environment.
Add that source command to the bottom of your ~/.bashrc to set it up every time you log in.

If you are not using bash please see http://wiki.ros.org/rosinstall/NonBashShells

์™œ tmp์— ๋งŒ๋“œ๋Š”์ง€๋Š” ๋‚˜๋„ ๋ชจ๋ฅด๋Š”๋ฐ, ๋Œ€์ถฉ ํ•ด์„ํ•ด๋ณด๋ฉด ํŠœํ† ๋ฆฌ์–ผ ๋”ฐ๋ผํ•ด๋ณด๊ณ  ์‚ญ์ œํ• ๊ฑฐ๋ผ ๊ทธ๋Ÿฐ๊ฑฐ ์•„๋‹Œ์ง€..? ์‹ถ์›€

 

์ด๋ ‡๊ฒŒ ํ•˜๊ณ  rosws_info๋ฅผ ์น˜๋ฉด workspace์ธํฌ๊ฐ€ ๋‚˜์˜จ๋‹ค.

์•„์ง์€ ์“ธ์ผ ์—†๋Š”๋“ฏ. ๋ญ˜ ํ•ด๋ดค์–ด์•ผ trouble๋„ ๋‚˜๋Š”๊ฑฐ์กฐ

 

์จ‹๋“  rosws tutorial์—์„œ expending workspaceํ•ด๋ณด๋ ค ํ–ˆ๋Š”๋ฐ ๋ญ ๊ฐ–๊ณ  ์˜ค๋Š” ์‚ฌ์ดํŠธ์— ์ž๊พธ 404๋– ์„œ ํฌ๊ธฐํ•จ.

 

๋‹ค์‹œ rosbuild๋กœ ๋„˜์–ด์˜ค์ž.

์ด๋Ÿฌ์ฟต์ €๋Ÿฌ์ฟต ํ•˜๋‹ค๋ณด๋‹ˆ ๊ณต๋ถ€ํ–ˆ๋˜ ๊ฒŒ ๋– ์˜ค๋ฆ„

๋ฐ”๋กœ rosbuild ๋Œ€์‹  ์“ฐ๋Š”๊ฒŒ catkin์ด์—ˆ๋‹ค๋Š” ๊ฒƒ.

๋ญํ•œ๊ฑฐ์ง€ ์ง€๊ธˆ๊นŒ์ง€..

 

์•„์ง๋„ ์ด ๋‘˜์˜ ์ฐจ์ด๋ฅผ ๋ชจ๋ฅด๊ฒ ๊ณ , ๋น„์Šทํ•˜๋‹ค๋ฉด์„œ ์™œ rosbuild with catkin์ด๋ž€ ์›Œ๋”ฉ์ด ๋‚˜์™”๋Š”์ง€ ๋ชจ๋ฅด๊ฒ ์œผ๋‚˜.

์จ‹๋“  ๋‹ค์Œ ์Šคํ…์œผ๋กœ ๋„˜์–ด๊ฐ€๊ธฐ๋กœํ•จ!

๋ฐ˜์‘ํ˜•