ROS环境下部分编译异常解决方案

137
0
2021年2月12日 09时12分

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 

 

发表评论

后才能评论