ROS環境下部分編譯異常解決方案

1 異常報警:package ‘orocos-bfl’ not found:

-- Found PkgConfig: /usr/bin/pkg-config (found version "0.26")
-- checking for module 'orocos-bfl'
--   package 'orocos-bfl' not found
CMake Error at /usr/share/cmake-2.8/Modules/FindPkgConfig.cmake:283 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake-2.8/Modules/FindPkgConfig.cmake:337 (_pkg_check_modules_internal)
  CMakeLists.txt:5 (pkg_check_modules)

解決方案:
參考鏈接:https://blog.csdn.net/start_from_scratch/article/details/51160893
安裝bfl包:

sudo apt-get install ros-indigo-bfl

2 編譯報警:not providing “FindCeres.cmake” in CMAKE_MODULE_PATH

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


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


    CeresConfig.cmake
    ceres-config.cmake


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

原因:上述報警可能是ceres-solver包沒有安裝成功,或沒有編譯ceres-solver包
解決方案:
(1)先將ceres-solver放到待編譯工作空間下,與cartographer同目錄進行編譯,若編譯成功,則繼續;(我遇到的問題在這一步解決)
(2)若還有該編譯錯誤,則根據安裝教程 從新安裝ceres-solver庫。

3 編譯報警":This workspace contains non-catkin packages in it

CMake Error at /opt/ros/indigo/share/catkin/cmake/catkin_workspace.cmake:95 (message):
  This workspace contains non-catkin packages in it, and catkin cannot build
  a non-homogeneous workspace without isolation.  Try the
  'catkin_make_isolated' command instead.
Call Stack (most recent call first):
  CMakeLists.txt:63 (catkin_workspace)

根據報警提示:

This workspace contains non-catkin packages in it, and catkin cannot build a non-homogeneous workspace without isolation.
該工作空間包含了非catkin類型的package,並且catkin不能編譯一個“非同步的工作空間” without isolation

解決方案:

'catkin_make_isolated' command instead
使用‘catkin_make_isolated’代替‘catkin_make’進行編譯

4 編譯報警:not providing “FindEigen3.cmake” in CMAKE_MODULE_PATH

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


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


    Eigen3Config.cmake
    eigen3-config.cmake


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

方案一:
(1)首先在主文件中搜索“FindEigen3.cmake”文件,搜索到後將其複製到/src/cartographer/cmake/modules/ 目錄下(或 將FindEigen3.cmake拷貝到與CMakeLists.txt同目錄下),再進行編譯即可。
(2)若(1)中方法沒有解決問題,則參考鏈接https://answers.ros.org/question/250727/error-findeigen3cmake-during-install-kinetic-on-rpi/,在(1)的基礎上,在cartographer所在的CMakeLists.txt中find_package(Eigen3 REQUIRED)對應位置添加如下指令,在進行編譯即可。

set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
find_package(Eigen3 REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIR})

(3)若(1)中沒有搜索到FindEigen3.cmake文件,則說明系統中沒有Eigen3,則參考鏈接https://www.jianshu.com/p/20eb596b7eb5,下載並安裝Eigen3,並再按(1)中將對應的文件進行拷貝處理。

下載網址:
eigen官網

方案二:
參考鏈接:https://blog.csdn.net/qq_35508344/article/details/80485973
安裝eigen3到系統中:

#github 有個mirror,版本3.3.4 from 2017 
git clone https://github.com/eigenteam/eigen-git-mirror 
#安裝 
cd eigen-git-mirror 
mkdir build 
cd build 
cmake .. 
sudo make install 
#安裝後,頭文件安裝在/usr/local/include/eigen3/

4 編譯報警:Could NOT find Bullet

CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
  Could NOT find Bullet (missing: BULLET_DYNAMICS_LIBRARY
  BULLET_COLLISION_LIBRARY BULLET_MATH_LIBRARY BULLET_SOFTBODY_LIBRARY
  BULLET_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-2.8/Modules/FindBullet.cmake:76 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:15 (find_package)

分析:根據報警提示,缺少bullet庫
解決方案,安裝bullet庫 。參考鏈接:https://blog.csdn.net/Groot_Lee/article/details/79202507

sudo apt-get install libbullet-dev

5 編譯報警 :Could NOT find SDL

CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
  Could NOT find SDL (missing: SDL_LIBRARY SDL_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-2.8/Modules/FindSDL.cmake:176 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:16 (find_package)

分析:根據報警提示,缺少SDL庫
解決方案,安裝SDL庫 。參考鏈接:https://blog.csdn.net/Groot_Lee/article/details/79202507

sudo apt-get install libsdl1.2-dev

7 編譯報警:Could NOT find SDL_image

CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
  Could NOT find SDL_image (missing: SDL_IMAGE_LIBRARIES
  SDL_IMAGE_INCLUDE_DIRS)
Call Stack (most recent call first):
  /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-2.8/Modules/FindSDL_image.cmake:79 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:17 (find_package)

分析:根據報警提示,缺少SDL_image庫
解決方案,安裝SDL_image庫 。參考鏈接:https://blog.csdn.net/Groot_Lee/article/details/79202507

sudo apt-get install libsdl-image1.2-dev 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章