1. 安装Realsense SDK
(1)下载资源librealsense,从github下载source
git clone https://github.com/IntelRealSense/librealsense
cd librealsense
(2)安装依赖项分别执行
sudo apt-get install libudev-dev pkg-config libgtk-3-dev
sudo apt-get install libusb-1.0-0-dev pkg-config
sudo apt-get install libglfw3-dev
sudo apt-get install libssl-dev
(3)编译librealsense
mkdir build
cd build
cmake ../ -DBUILD_EXAMPLES=true
make
sudo make install
(4)进入/librealsense/build/examples/capture,在此位置下打开终端执行./rs-capture
2. 安装 ROS Wrapper
(1)建立workspace
mkdir -p ~/realsense_ws/src
cd ~/realsense_ws/src/
catkin_init_workspace
cd ..
catkin_make
echo "source ~/realsense_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc
(2)下载ddynamic_reconfigure与realsense-ros
cd ~/realsense_ws/src/
git clone https://github.com/pal-robotics/ddynamic_reconfigure.git
git clone https://github.com/IntelRealSense/realsense-ros.git
(3)编译
cd ..
catkin_make
3. 运行
roslaunch realsense2_camera rs_camera.launch
4. 参考链接
http://nicethemes.cn/news/txtlist_i61856v.html
https://blog.csdn.net/qq_38649880/article/details/91975100?spm=1001.2014.3001.5502
5. 二进制安装
以上安装方法为源码编译安装,不过还可以使用二进制安装的方法,这种方法更加简单,只需要两行命令即可(https://github.com/IntelRealSense/realsense-ros.git)
realsense2_camera is available as a debian package of ROS distribution. It can be installed by typing:
sudo apt-get install ros-$ROS_DISTRO-realsense2-camera
This will install both realsense2_camera and its dependents, including librealsense2 library.
Notice:
The version of librealsense2 is almost always behind the one availeable in RealSense™ official repository.
librealsense2 is not built to use native v4l2 driver but the less stable RS-USB protocol. That is because the last is more general and operational on a larger variety of platforms.
realsense2_description is available as a separate debian package of ROS distribution. It includes the 3D-models of the devices and is necessary for running launch files that include these models (i.e. rs_d435_camera_with_model.launch). It can be installed by typing:
sudo apt-get install ros-$ROS_DISTRO-realsense2-description