天天看點

ROS-CMake Error依賴異常

前言

在進行對Rececar調試時,進行工程編譯時報的錯誤。這裡的錯誤是缺少一個ROS開源機器人的算法庫:mrpt

CMake Error at rf2o_laser_odometry/CMakeLists.txt:29 (find_package):
  By not providing "FindMRPT.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "MRPT", but
  CMake did not find one.

  Could not find a package configuration file provided by "MRPT" with any of
  the following names:

    MRPTConfig.cmake
    mrpt-config.cmake

  Add the installation prefix of "MRPT" to CMAKE_PREFIX_PATH or set
  "MRPT_DIR" to a directory containing one of the above files.  If "MRPT"
  provides a separate development package or SDK, be sure it has been
  installed.


-- Configuring incomplete, errors occurred!
See also "/home/reinovo/tianbot_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/reinovo/tianbot_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed
           

操作

一:檢視對應項目中的CMakeLists.txt檔案中對應的依賴關系

ROS-CMake Error依賴異常

二:進行相關依賴包下載下傳

sudo apt-get install ros-kinetic-mrpt*
           

在使用這個指令時會出現部分資源無法通路下載下傳,于是轉換成下一個

sudo apt-get install mrpt-*
           

當執行這個指令時會将mrpt中的内容包括文檔什麼的都會被下載下傳下來,在編譯的時候還是沒有通過。在這裡我們下載下傳的這些包并不是CMake中所依賴的包。

sudo apt-get install libmrpt-dev
           

使用上述指令即可通過編譯

ROS-CMake Error依賴異常