本机环境:windows10+vmware+ubuntu16.04+ROS kinetic+Intel Realsense D435i
基本步骤就两个:
1.安装realsense的SDK
2.安装ros_realsense
其实第二步不用ros_realsense用usb_cam好像也行,但我尝试没成功。发现ros_realsense也比较简单,因为后面是为了跑ORB_SLAM,就用了这个,根据需求可更换
1.安装realsense的SDK——librealsense
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE
sudo add-apt-repository "deb https://librealsense.intel.com/Debian/apt-repo $(lsb_release -cs) main" -u
sudo apt-get install librealsense2-dkms
sudo apt-get install librealsense2-utils
sudo apt-get install librealsense2-dev
sudo apt-get install librealsense2-dbg
测试是否安装成功:realsense-viewer
连上D435i如果能看到实时图像就说明安装成功了(要把几个Module打开才看到的,像下面这样)
2.安装ros_realsense
mkdir -p ~/catkin_ws/src
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_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" >> ~/.bashrcsource ~/.bashrc
参考:https://github.com/IntelRealSense/realsense-ros
catkin_make clean一步可能报错,关于ddynamic_reconfigure的。去这里下载一下,在同一个src包中提前源码编译一下,再catkin_make clean
注:对于上述步骤中checkout那步有时候可能因为网络原因执行失败,我试着跳过这步也没出太大问题,嘿嘿
测试是否安装成功:
roscore
roslaunch realsense2_camera rs_camera.launch
在Rviz中发现可以订阅topic了,能显示实时图像就ok了