ROS下intel realsense D435i安装
1.安装Realsense SDK
参考官方文档
a.下载librealsense github存储库
git clone https://github.com/IntelRealSense/librealsense
cd librealsense
b.安装构建librealsense所需的核心软件包
Unplug any connected Intel RealSense camera.
拔出相机连接
sudo apt-get install git libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev
特定于发行版的软件包
Ubuntu 18:
sudo apt-get install libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev
c.安装权限脚本
cd librealsense
./scripts/setup_udev_rules.sh
d.构建和修补内核模块
这一步运行较慢,实际过程中没有使用这一步也能够使用相机。
./scripts/patch-realsense-ubuntu-lts.sh
e.编译安装
mkdir build
cd build
cmake ../ -DBUILD_EXAMPLES=true
make
sudo make install
f.test
进入librealsense/build/examples/capture,测试效果:
./rs-capture
或直接使用realsense-viewer
工具查看效果:
realsense-viewer
2.另一种安装方法(Distribution版)
a.注册公匙
sudo apt-key adv --keyserver keys.gnupg.net --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE
b.添加服务器至列表
Ubuntu 18 LTS:
sudo add-apt-repository "deb http://realsense-hw-public.s3.amazonaws.com/Debian/apt-repo bionic main" -u
c.安装库
sudo apt-get install librealsense2-dkms
sudo apt-get install librealsense2-utils
sudo apt-get install librealsense2-dev
sudo apt-get install librealsense2-dbg
3.安装RealSense-ROS
参考官方文档
#Create a catkin workspace
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src/
#Clone the latest Intel® RealSense™ ROS from here into 'catkin_ws/src/'
git clone https://github.com/IntelRealSense/realsense-ros.git
git clone https://github.com/pal-robotics/ddynamic_reconfigure.git
#ros package ddynamic_reconfigure is installed
catkin_init_workspace
cd ..
catkin_make clean
catkin_make -DCATKIN_ENABLE_TESTING=False -DCMAKE_BUILD_TYPE=Release
catkin_make install
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc
启动相机节点
roslaunch realsense2_camera rs_rgbd.launch
查看Published Topics
rostopic list
3.补充
查看ros版本:cd /opt/ros/melodic
终端执行:roslaunch realsense2_camera rs_rgbd.launch
报错:ResourceNotFound: rgbd_launch
解决方案:sudo apt-get install ros-melodic-rgbd-launch
uname -r #查看内核版本