最近在Ubuntu 20.04上安装了Realsense SDK(版本为2.54.2),但在尝试编译安装realsense-ros,按照Intel官方安装教程执行catkin_clean
(或者catkin_make
),遇到了如下报错:
bash
CMake Error at realsense-ros/realsense2_camera/CMakeLists.txt:48 (message):
Intel RealSense SDK 2.0 is missing, please install it from
https://github.com/IntelRealSense/librealsense/releases
-- Configuring incomplete, errors occurred!
See also "/home/xuzhengzhe/sensor_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/xuzhengzhe/sensor_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed
尝试修改CMakeLists.txt
文件中的find_package(realsense2 2.50.0)为find_package(realsense2 2.54.2)后仍然未能解决问题。最后在GitHub的一个Issue(https://github.com/IntelRealSense/realsense-ros/issues/821)中找到了解决方法。
解决方法很简单,只需执行以下命令安装librealsense2-dev:
bash
sudo apt-get install librealsense2-dev
然后再执行catkin_make
即可成功编译安装realsense-ros。