CMake Error at realsense-ros/realsense2_camera/CMakeLists.txt:48 (message): Intel RealSense SDK 2.0

安装realsense-ros时候的编译报错:
Intel RealSense SDK 2.0 is missing, please install it from https://github.com/IntelRealSense/librealsense/releases
CMake Error at realsense-ros/realsense2_camera/CMakeLists.txt:48 (message): Intel RealSense SDK 2.0_第1张图片
问题分析:终端提醒:

  The following configuration files were considered but not accepted:  
  /usr/local/lib/cmake/realsense2/realsense2Config.cmake, version: 2.49.0

是驱动版本不匹配的问题:在realsense_ros功能包目录下realsense2_camera的CMakelist.txt文件中出现了错误,该文件的第43行需要寻找realsense2的功能包,且要求realsense2的版本号为2.50.0,但在安装realsense的相机驱动时,相机驱动的版本为2.49.0,故在编译时,无法找到2.50版本导致错误发生。

解决办法:将realsense_ros功能包目录下realsense2_camera的CMakelist.txt文件中44行对应版本改成2.49

if (WIN32)
find_package(realsense2 CONFIG REQUIRED)
else()
find_package(realsense2 2.49.0)    #修改为2.49.0
endif()

CMake Error at realsense-ros/realsense2_camera/CMakeLists.txt:48 (message): Intel RealSense SDK 2.0_第2张图片
然后继续编译,添加环境变量:

catkin_make
echo "source ~/realsense_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc

你可能感兴趣的:(自动驾驶,ubuntu,人工智能)