参考:
- Melodic + Realsense D435i 配置及错误问题解决
- Ubuntu18.04 + ROS melodic 安装使用 RealSenseD435i
- 极客创造:ROS与深度相机入门教程-在ROS使用Intel D435i深度相机
01 RealSense SDK安装
1、 克隆SDK
打开终端
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、安装权限脚本
在原先的终端下,分别输入以下命令完成相关依赖的安装
sudo cp config/99-realsense-libusb.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules && udevadm trigger
4、进行编译与安装
执行以下命令实现编译与安装
mkdir build
cd build
cmake ../ -DBUILD_EXAMPLES=true
make
sudo make install
5、测试安装是否成功
打开新的终端,在终端中输入以下命令验证相机驱动是否安装成功
cd librealsense/build/examples/capture
./rs-capture
或直接使用realsense-viewer
工具查看效果:
realsense-viewer
02 安装RealSense-ROS
这里直接在~/ur_ws/src
目录下从github下载相关的包,然后进行编译:
cd ur_ws/src
git clone https://github.com/IntelRealSense/realsense-ros.git
git clone https://github.com/pal-robotics/ddynamic_reconfigure.git
cd ~/ur_ws && catkin_make
编译完成后,使用如下命令测试:
roslaunch realsense2_camera demo_pointcloud.launch
注意:
不要安装intel-ros上的,intel-ros上缺少DDynamic_reconfigure
详情 : https://github.com/ros/rosdistro/pull/20651 和 https://github.com/IntelRealSense/realsense-ros/pull/665
🕐直接下载 https://github.com/IntelRealSense/realsense-ros.git
🕑下载缺少包 https://github.com/pal-robotics/ddynamic_reconfigure
🕒运行catkin_make,即可
参考:https://blog.csdn.net/VISUAL_STUDIO1/article/details/90648934
打开后,ROS将会接收到以下话题:
- /camera/color/camera_info
- /camera/color/image_raw
- /camera/depth/camera_info
- /camera/depth/image_rect_raw
- /camera/extrinsics/depth_to_color
- /camera/extrinsics/depth_to_infra1
- /camera/extrinsics/depth_to_infra2
- /camera/infra1/camera_info
- /camera/infra1/image_rect_raw
- /camera/infra2/camera_info
- /camera/infra2/image_rect_raw
- /camera/gyro/imu_info
- /camera/gyro/sample
- /camera/accel/imu_info
- /camera/accel/sample
- /diagnostics
03 报错及解决
1、 插上d435i之后,屏幕变成竖的了
xrandr -o normal