系统:Ubuntu18.04
硬件核心板:NX
相机:RealSenseD435i
由于之前尝试了很多版本没有成功,最后根据攻略上指导的版本进行安装
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo mkdir librealsense_install
cd librealsense_install
git clone -b v2.31.0 https://github.com/IntelRealSense/librealsense.git
使用命令下载太慢,也可以直接下载,注意在TAG中寻找对应的版本
sudo apt-get install git libssl-dev libusb-1.0-0-dev pkg-config
sudo install libgtk-3-dev
sudo apt-get install libglfw3-dev
安装过程中遇到的问题有:
sudo install libgtk-3-dev 不能安装
cd librealsense_install/librealsense
mkdir build
cd build
cmake ..
make -j4
sudo make install
打开终端,插入相机
realsense-viewer
如果显示的不全,查看USB是否是3.0的接口,如果运行正确的话,出现的画面如图所示:
1,创建工作空间
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
catkin_init_workspace
2.下载源码【由于版本问题,注意realsense-ros的版本对应】
git clone -b 2.2.11 https://github.com/IntelRealSense/realsense-ros.git
git clone https://github.com/pal-robotics/ddynamic_reconfigure.git
3,编译
cd ~/catkin_ws
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
使用上面的命令不能下载,直接使用链接中的包编译,该包已经将后面编译中会出现的错误进行了更正:
NX+Ubuntu18.04+ROSRealsense(RealSenseD435i)的安装与使用-Linux文档类资源-CSDN下载
编译过程中遇到的问题:
2.2.1 Project 'cv_bridge' specifies
CMake Error at /opt/ros/melodic/share/cv_bridge/cmake/cv_bridgeConfig.cmake:113 (message):
Project 'cv_bridge' specifies '/usr/include/opencv' as an include dir,
which is not found. It does neither exist as an absolute directory nor in
'${{prefix}}//usr/include/opencv'. Check the issue tracker
解决方法:
参考下面博文:
ROSERROR : CMake Error at /opt/ros/melodic/share/cv_bridge/cmake/cv_bridgeConfig.cmake:113 (message)_笨蛋小豬的博客-CSDN博客
就是找到你自己在nx上安装的OPENCV的路径,然后将 /opt/ros/melodic/share/cv_bridge/cmake/cv_bridgeConfig.cmake下的cv_bridgeConfig.cmake的opencv路径更改为你自己安装的位置
1、根据这个报错的提示,可以看出是: “cv_bridge” 的路径问题;
2、找到cv_bridgeConfig.cmke文件,打开
选中的就是需要修改的路径;
3、在文件里面搜索**opencv,**路径如下图:
4、将2中需要修改的路径修改为3中查到的路径。
编译成功后执行:
roslaunch realsense2_camera rs_camera.launch
rostopic list
/camera/accel/imu_info
/camera/accel/sample
/camera/color/camera_info
/camera/color/image_raw
/camera/color/image_raw/compressed
/camera/color/image_raw/compressed/parameter_descriptions
/camera/color/image_raw/compressed/parameter_updates
/camera/color/image_raw/compressedDepth
/camera/color/image_raw/compressedDepth/parameter_descriptions
/camera/color/image_raw/compressedDepth/parameter_updates
/camera/color/image_raw/theora
/camera/color/image_raw/theora/parameter_descriptions
/camera/color/image_raw/theora/parameter_updates
/camera/depth/camera_info
/camera/depth/image_rect_raw
/camera/depth/image_rect_raw/compressed
/camera/depth/image_rect_raw/compressed/parameter_descriptions
/camera/depth/image_rect_raw/compressed/parameter_updates
/camera/depth/image_rect_raw/compressedDepth
/camera/depth/image_rect_raw/compressedDepth/parameter_descriptions
/camera/depth/image_rect_raw/compressedDepth/parameter_updates
/camera/depth/image_rect_raw/theora
/camera/depth/image_rect_raw/theora/parameter_descriptions
/camera/depth/image_rect_raw/theora/parameter_updates
/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/infra1/image_rect_raw/compressed
/camera/infra1/image_rect_raw/compressed/parameter_descriptions
/camera/infra1/image_rect_raw/compressed/parameter_updates
/camera/infra1/image_rect_raw/compressedDepth
/camera/infra1/image_rect_raw/compressedDepth/parameter_descriptions
/camera/infra1/image_rect_raw/compressedDepth/parameter_updates
/camera/infra1/image_rect_raw/theora
/camera/infra1/image_rect_raw/theora/parameter_descriptions
/camera/infra1/image_rect_raw/theora/parameter_updates
/camera/infra2/camera_info
/camera/infra2/image_rect_raw
/camera/infra2/image_rect_raw/compressed
/camera/infra2/image_rect_raw/compressed/parameter_descriptions
/camera/infra2/image_rect_raw/compressed/parameter_updates
/camera/infra2/image_rect_raw/compressedDepth
/camera/infra2/image_rect_raw/compressedDepth/parameter_descriptions
/camera/infra2/image_rect_raw/compressedDepth/parameter_updates
/camera/infra2/image_rect_raw/theora
/camera/infra2/image_rect_raw/theora/parameter_descriptions
/camera/infra2/image_rect_raw/theora/parameter_updates
/camera/motion_module/parameter_descriptions
/camera/motion_module/parameter_updates
/camera/realsense2_camera_manager/bond
/camera/rgb_camera/auto_exposure_roi/parameter_descriptions
/camera/rgb_camera/auto_exposure_roi/parameter_updates
/camera/rgb_camera/parameter_descriptions
/camera/rgb_camera/parameter_updates
/camera/stereo_module/auto_exposure_roi/parameter_descriptions
/camera/stereo_module/auto_exposure_roi/parameter_updates
/camera/stereo_module/parameter_descriptions
/camera/stereo_module/parameter_updates
/diagnostics
/rosout
/rosout_agg
/tf
/tf_static
查看相关话题的内容
$ rostopic echo /camera/accel/sample # Blank
$ rostopic echo /camera/gyro/sample # Blank
$ rostopic echo /camera/accel/imu_info
frame_id: "camera_accel_optical_frame"
data: [1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0]
noise_variances: [0.0, 0.0, 0.0]
bias_variances: [0.0, 0.0, 0.0]
---
$ rostopic echo /camera/gyro/imu_info
frame_id: "camera_gyro_optical_frame"
data: [1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0]
noise_variances: [0.0, 0.0, 0.0]
bias_variances: [0.0, 0.0, 0.0]