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

์นดํ…Œ๊ณ ๋ฆฌ ์—†์Œ

15. ์ƒˆ๋กœ์šด ROS ํŒจํ‚ค์ง€๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๋ฒ• - Intel realsense

๐Ÿ†•

15. ์ƒˆ๋กœ์šด ROS ํŒจํ‚ค์ง€๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๋ฒ• - Intel realsense

๏ฟผ

๋กœ๋ด‡์— ์ƒˆ๋กœ์šด ์„ผ์„œ(depth camera)๋ฅผ ๋‹ฌ๊ณ  ์‹ถ์€ ์ƒํ™ฉ, ๊ทธ๋Ÿฐ๋ฐ ROS๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์–ด ํ˜ธํ™˜์„ฑ์„ ์—ผ๋‘ํ•ด์•ผ ํ•œ๋‹ค๋ฉด??

  1. ๋‹ค์Œ ํŽ˜์ด์ง€๋ฅผ ํ†ตํ•ด ์›ํ•˜๋Š” ์„ผ์„œ ์ค‘ ROS๋ฅผ ์ง€์›ํ•˜๋Š” ๊ฒƒ์ด ์žˆ๋Š”์ง€ ์‚ดํŽด๋ด…๋‹ˆ๋‹ค.
  1. ์„ฑ๋Šฅ์„ ๋น„๊ตํ•˜์—ฌ ์ตœ์ข… ๋ชจ๋ธ์„ ์„ ํƒํ•˜๊ณ , ํ˜„์žฌ ์‚ฌ์šฉ์ค‘์ธ ๊ฐœ๋ฐœํ™˜๊ฒฝ์—์„œ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ์ง€ (ros version, ๊ธฐ์กด ์‚ฌ์šฉ์ค‘์ธ ํŒจํ‚ค์ง€์™€์˜ ํ˜ธํ™˜์„ฑ ๋“ฑ๋“ฑ) github wiki, readme ๊ตฌ๊ธ€๋ง์„ ํ†ตํ•ด ๊ฒ€์ƒ‰ํ•ด๋ณด๊ณ  ๊ตฌ๋งคํ•ฉ๋‹ˆ๋‹ค. (๊ตฌ๋งค ์‹œ์— ๊ฐ€๊ฒฉ ๋น„๊ต๋„ ๋ฌผ๋ก  ํ•ด์•ผ๊ฒ ์ง€์š” ๐Ÿ˜„)
  1. ์„ผ์„œ๊ฐ€ ๋„์ฐฉํ–ˆ์Šต๋‹ˆ๋‹ค!! ์ฐพ์•„๋‘์—ˆ๋˜ ํŠœํ† ๋ฆฌ์–ผ๋Œ€๋กœ ์ค€๋น„ํ•ด๋ณด๊ณ , ์‹คํ–‰ ์‹œ์ผœ๋ด…๋‹ˆ๋‹ค.

Intel realsense Depth Camera


Stereo Depth - Intelยฎ RealSenseโ„ข Depth and Tracking Cameras
Intelยฎ RealSenseโ„ข Stereo Depth Technology brings 3D to devices and machines that only see 2D today. Check out our latest active stereo depth cameras.
https://www.intelrealsense.com/stereo-depth/

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.

๐Ÿ’ก
๊ณต์‹ ์„ค์น˜ ๋ ˆํผ๋Ÿฐ์Šค ๋งํฌ๋ฅผ ๋‚จ๊น๋‹ˆ๋‹ค. ์˜ค๋ฅ˜ ๋ฐœ์ƒ ์‹œ ์ฐธ๊ณ ํ•˜์„ธ์š”!!
IntelRealSense/realsense-ros
These are packages for using Intel RealSense cameras (D400 series SR300 camera and T265 Tracking Module) with ROS. This version supports Kinetic, Melodic and Noetic distributions. For running in ROS2-Eloquent environment please switch to the eloquent branch. For running in ROS2-Foxy environment please switch to the foxy branch.
https://github.com/IntelRealSense/realsense-ros
IntelRealSense/librealsense
Using pre-build packages Intelยฎ RealSenseโ„ข SDK 2.0 provides installation packages for Intel X86/AMD64-based Debian distributions in format for Ubuntu 16/18/20 LTS. The Realsense DKMS kernel drivers package ( librealsense2-dkms) supports Ubuntu LTS kernels 4.4, 4.8, 4.10, 4.13, 4.15, 4.18*, 5.0*, 5.3* and 5.4. Please refer to Ubuntu Kernel Release Schedule for further details.
https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md

2. Installing ddynamic_reconfigure


$ cd ~/gcamp_ws/src/
$ sudo apt-get install ros-melodic-dynamic-reconfigure
$ sudo apt-get install ros-melodic-ddynamic-reconfigure
pal-robotics/ddynamic_reconfigure
The ddynamic_reconfigure package is a C++ extension of dynamic_reconfigure that allows modifying parameters of a ROS node using the dynamic_reconfigure framework without having to write cfg files.
https://github.com/pal-robotics/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


IntelRealSense/realsense-ros
The RealSenseโ„ข D435i is equipped with a built in IMU. Combined with some powerful open source tools, it's possible to achieve the tasks of mapping and localization. There are 4 main nodes to the process: realsense2_camera imu_filter_madgwick rtabmap_ros robot_localization The first thing to do is to install the components: realsense2_camera: Follow the installation guide in: https://github.com/intel-ros/realsense.
https://github.com/IntelRealSense/realsense-ros/wiki/SLAM-with-D435i

์„ผ์„œ ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ, ์ƒˆ๋กœ์šด ํ•˜๋“œ์›จ์–ด๋กœ์˜ ์—…๊ทธ๋ ˆ์ด๋“œ, ์˜คํ”ˆ์†Œ์Šค import ์‹œ์— ํ•ญ์ƒ ์•ž์„œ ์„ค๋ช…ํ–ˆ๋˜ ๋‚ด์šฉ๋“ค์— ์œ ๋…ํ•˜์‹œ๊ธธ ๋ฐ”๋ž๋‹ˆ๋‹ค.
ROS์˜ ๊ฐ•๋ ฅํ•œ ํŒจํ‚ค์ง€ integration์„ ์ด์šฉํ•ด์„œ ๋น ๋ฅด๊ฒŒ ๋กœ๋ด‡์„ ๊ตฌ์ถ•ํ•ด ๋ณด์„ธ์š” ๐Ÿ˜‡