ros realsense D435i摄像头配置
之前在ubunut18中配置了ROS环境,现在需要在此基础上,配置D435i相机的SDK和ROS包。
一、参考
- https://github.com/IntelRealSense/librealsense
- https://github.com/IntelRealSense/realsense-ros
- http://blog.chinaunix.net/uid-27875-id-5819764.html
- https://blog.csdn.net/weixin_44401286/article/details/102943016
- https://blog.csdn.net/sinat_23853639/article/details/88044019
- https://blog.csdn.net/ns2942826077/article/details/110811285
- 很全面的参考:https://blog.csdn.net/a17381562089/article/details/115345082
- 以及有用的参考:https://blog.csdn.net/MWY123_/article/details/117807010?spm=1001.2101.3001.6650.1&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1.pc_relevant_default&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1.pc_relevant_default&utm_relevant_index=2
二、流程
- 安装依赖
- 安装SDK,使用版本V2.50.0
- 安装ros包,对应最新版本
- 运行测试
三、步骤
- 依赖安装,有些可能是不必要的,没关系
sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade
sudo apt-get install -y git libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev
sudo apt install -y ros-melodic-ddynamic-reconfigure*
sudo apt-get install -y intel-realsense-dfu*
sudo apt-get install -y librealsense2-dev
sudo apt-get install -y librealsense2-dbg
sudo apt-get install -y librealsense2-dkms
sudo apt-get install -y librealsense2-utils
补充:
# 注册服务器公开密匙
sudo apt-key adv --keyserver keys.gnupg.net --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 bionic main" -u
# 库安装
sudo apt-get install librealsense2-dkms
sudo apt-get install librealsense2-utils
sudo apt-get install librealsense2-dkms
sudo apt-get install librealsense2-utils
sudo apt-get install librealsense2-dev
sudo apt-get install librealsense2-dbg # (这个可以不安装)
- 安装SDK
cd
git clone -b v2.50.0 https://github.com/IntelRealSense/librealsense.git
cd librealsense
mkdir -p build
cd build/
cmake ..
make -j8
sudo make install
补充,修改上述的后面内容
cd librealsense
./scripts/setup_udev_rules.sh # Intel Realsense 权限脚本
./scripts/patch-realsense-ubuntu-lts.sh # 构建和应用补丁内核模块
echo 'hid_sensor_custom' | sudo tee -a /etc/modules # 驱动设置开机启动
cmake ../ -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=true # 构建SDK
sudo make uninstall && make clean && make -j8 && sudo make install
# 最后如果报出了多个udev规则警告,运行如下
./scripts/setup_udev_rules.sh --uninstall
- 安装ros包
cd
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
- 测试
roslaunch realsense2_camera rs_camera.launch
rqt_image_view
- 点云测试
roslaunch realsense2_camera demo_pointcloud.launch
roslaunch realsense2_camera rs_camera.launch filters:=pointcloud
获取/camera/depth_registered/points的相关内容,参考引用7的链接
- 遇到一个问题,安装了该realsense 的ros包之后,与XTDrone的ego_planner的ros包出现冲突,无法共同存在。比如我现在只能删除realsense后,才能编译ego的包。
|