15. ์๋ก์ด ROS ํจํค์ง๋ฅผ ์ฌ์ฉํ๋ ๋ฒ - Intel realsense
๏ฟผ
๋ก๋ด์ ์๋ก์ด ์ผ์(depth camera)๋ฅผ ๋ฌ๊ณ ์ถ์ ์ํฉ, ๊ทธ๋ฐ๋ฐ ROS๋ฅผ ์ฌ์ฉํ๊ณ ์์ด ํธํ์ฑ์ ์ผ๋ํด์ผ ํ๋ค๋ฉด??
- ๋ค์ ํ์ด์ง๋ฅผ ํตํด ์ํ๋ ์ผ์ ์ค ROS๋ฅผ ์ง์ํ๋ ๊ฒ์ด ์๋์ง ์ดํด๋ด ๋๋ค.
- ์ฑ๋ฅ์ ๋น๊ตํ์ฌ ์ต์ข ๋ชจ๋ธ์ ์ ํํ๊ณ , ํ์ฌ ์ฌ์ฉ์ค์ธ ๊ฐ๋ฐํ๊ฒฝ์์ ์ฌ์ฉ ๊ฐ๋ฅํ์ง (ros version, ๊ธฐ์กด ์ฌ์ฉ์ค์ธ ํจํค์ง์์ ํธํ์ฑ ๋ฑ๋ฑ) github wiki, readme ๊ตฌ๊ธ๋ง์ ํตํด ๊ฒ์ํด๋ณด๊ณ ๊ตฌ๋งคํฉ๋๋ค. (๊ตฌ๋งค ์์ ๊ฐ๊ฒฉ ๋น๊ต๋ ๋ฌผ๋ก ํด์ผ๊ฒ ์ง์ ๐)
- ์ผ์๊ฐ ๋์ฐฉํ์ต๋๋ค!! ์ฐพ์๋์๋ ํํ ๋ฆฌ์ผ๋๋ก ์ค๋นํด๋ณด๊ณ , ์คํ ์์ผ๋ด ๋๋ค.
Intel realsense Depth Camera
image from : compare cameras
๋๋ฐ์ด์ค ๋งํธ ๊ตฌ๋งค ๋งํฌ
1. librealsense ๋ฆฌ๋ ์ค ๋ฐฐํฌํ ํจํค์ง ์ค์น
- Register the server's public key:
$ sudo apt-key adv --keyserver keys.gnupg.net --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE
Executing: /tmp/apt-key-gpghome.QjWrP9b5UR/gpg.1.sh --keyserver keys.gnupg.net --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE
gpg: key C8B3A55A6F3EFCDE: ""CN = Intel(R) Intel(R) Realsense", O=Intel Corporation" not changed
gpg: Total number processed: 1
gpg: unchanged: 1
- Add the server to the list of repositories
$ sudo add-apt-repository "deb http://realsense-hw-public.s3.amazonaws.com/Debian/apt-repo bionic main" -u
Hit:1 https://dl.yarnpkg.com/debian stable InRelease
Hit:2 http://packages.microsoft.com/repos/vscode stable InRelease
Hit:3 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:4 https://packages.microsoft.com/repos/ms-teams stable InRelease
Hit:5 http://packages.ros.org/ros/ubuntu bionic InRelease
Hit:6 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:7 http://kr.archive.ubuntu.com/ubuntu bionic InRelease
Hit:8 http://realsense-hw-public.s3.amazonaws.com/Debian/apt-repo bionic InRelease
Hit:9 http://kr.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:10 http://kr.archive.ubuntu.com/ubuntu bionic-backports InRelease
Reading package lists... Done
- Install the libraries (see section below if upgrading packages):
$ sudo apt-get install librealsense2-dkms -y
$ sudo apt-get install librealsense2-utils -y
$ sudo apt-get install librealsense2-utilssudo
$ sudo apt-get install librealsense2-devsudo
$ sudo apt-get install librealsense2-dbg
- Optionally install the developer and debug packages
$ sudo apt-get install librealsense2-dev -y
$ sudo apt-get install librealsense2-dbg -y
- ์ค์น ํ์ธ
$ realsense-viewer
With dev
package installed, you can compile
an application with librealsense using g++ -std=c++11 filename.cpp -lrealsense2
or an IDE of
your choice.
2. Installing ddynamic_reconfigure
$ cd ~/gcamp_ws/src/
$ sudo apt-get install ros-melodic-dynamic-reconfigure
$ sudo apt-get install ros-melodic-ddynamic-reconfigure
3. Installing Install RealSense ROS : ์ถ์ฒ
- repo clone ๋ฐ checkout
cd ~/catkin_ws/src/
git clone https://github.com/IntelRealSense/realsense-ros.git
cd realsense-ros/
git checkout `git tag | sort -V | grep -P "^2.\d+\.\d+" | tail -1`
cd ..
- catkin_make
cd ..
catkin_make clean
catkin_make -DCATKIN_ENABLE_TESTING=False -DCMAKE_BUILD_TYPE=Release
catkin_make install
Launch!!!
$ roslaunch realsense2_camera rs_camera.launch
# point cloud ํฌํจ ์คํ
$ roslaunch realsense2_camera rs_camera.launch filters:=pointcloud
์์ฉ ์ฌ๋ก - SLAM with D435i
์ผ์ ๋ฟ๋ง ์๋๋ผ, ์๋ก์ด ํ๋์จ์ด๋ก์ ์ ๊ทธ๋ ์ด๋, ์คํ์์ค import ์์ ํญ์ ์์ ์ค๋ช ํ๋ ๋ด์ฉ๋ค์ ์ ๋ ํ์๊ธธ ๋ฐ๋๋๋ค.
ROS์ ๊ฐ๋ ฅํ ํจํค์ง integration์ ์ด์ฉํด์ ๋น ๋ฅด๊ฒ ๋ก๋ด์ ๊ตฌ์ถํด ๋ณด์ธ์ ๐