欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

ROS编译安装过程中遇到的一些问题及解决方法

程序员文章站 2024-02-01 20:02:34
...

通常我们在编译安装ros的时候不可避免会遇到一些问题,比如缺少某一个库文件或这功能包,如果遇到可以用sudo apt-get 可以解决的当然方便很多,有时候需要我们自己到ros-wik上下载从源码安装,因此此篇主要用于记录编译安装过程中遇到的问题及相应的解决方法。
问题一:缺少bullet

-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (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-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.5/Modules/FindBullet.cmake:95 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  navigation-melodic-devel/map_server/CMakeLists.txt:11 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/lzy/LZY_Develop/BZL_develop/BZL_localization/Localization_simulator_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/lzy/LZY_Develop/BZL_develop/BZL_localization/Localization_simulator_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed

解决方法:sudo apt-get install libbullet-dev
问题二:缺少sdl

-- ==> add_subdirectory(navigation-melodic-devel/map_server)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- Found Bullet: /usr/lib/x86_64-linux-gnu/libBulletDynamics.so  
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find SDL (missing: SDL_LIBRARY SDL_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.5/Modules/FindSDL.cmake:199 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  navigation-melodic-devel/map_server/CMakeLists.txt:12 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/lzy/LZY_Develop/BZL_develop/BZL_localization/Localization_simulator_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/lzy/LZY_Develop/BZL_develop/BZL_localization/Localization_simulator_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed

解决方法:sudo apt-get install libsdl1.2-dev
问题三:缺少sdl-image

-- +++ processing catkin package: 'map_server'
-- ==> add_subdirectory(navigation-melodic-devel/map_server)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- Found SDL: /usr/lib/x86_64-linux-gnu/libSDLmain.a;/usr/lib/x86_64-linux-gnu/libSDL.so;-lpthread (found version "1.2.15") 
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find SDL_image (missing: SDL_IMAGE_LIBRARIES
  SDL_IMAGE_INCLUDE_DIRS)
Call Stack (most recent call first):
  /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.5/Modules/FindSDL_image.cmake:102 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  navigation-melodic-devel/map_server/CMakeLists.txt:13 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/lzy/LZY_Develop/BZL_develop/BZL_localization/Localization_simulator_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/lzy/LZY_Develop/BZL_develop/BZL_localization/Localization_simulator_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed

解决方法:sudo apt-get install libsdl-image1.2-dev
问题四:单个cfg文件访问受限

_2d/Costmap2DConfig.h /home/lzy/LZY_Develop/BZL_develop/BZL_localization/Localization_simulator_ws/devel/lib/python2.7/dist-packages/costmap_2d/cfg/Costmap2DConfig.py
/home/lzy/LZY_Develop/BZL_develop/BZL_localization/Localization_simulator_ws/build/navigation-melodic-devel/costmap_2d/setup_custom_pythonpath.sh: 5: exec: /home/lzy/LZY_Develop/BZL_develop/BZL_localization/Localization_simulator_ws/src/navigation-melodic-devel/costmap_2d/cfg/Costmap2D.cfg: Permission denied

解决方法:chmod +x /home/lzy/LZY_Develop/BZL_develop/BZL_localization/Localization_simulator_ws/src/navigation-melodic-devel/costmap_2d/cfg/Costmap2D.cfg
问题五:某一个文件夹下的多个cfg文件受限

/home/lzy/LZY_Develop/BZL_develop/BZL_localization/Localization_simulator_ws/build/navigation-melodic-devel/dwa_local_planner/setup_custom_pythonpath.sh: 5: exec: /home/lzy/LZY_Develop/BZL_develop/BZL_localization/Localization_simulator_ws/src/navigation-melodic-devel/dwa_local_planner/cfg/DWAPlanner.cfg: Permission denied
navigation-melodic-devel/dwa_local_planner/CMakeFiles/dwa_local_planner_gencfg.dir/build.make:63: recipe for target '/home/lzy/LZY_Develop/BZL_develop/BZL_localization/Localization_simulator_ws/devel/include/dwa_local_planner/DWAPlannerConfig.h' failed
make[2]: *** [/home/lzy/LZY_Develop/BZL_develop/BZL_localization/Localization_simulator_ws/devel/include/dwa_local_planner/DWAPlannerConfig.h] Error 126
CMakeFiles/Makefile2:9993: recipe for target 'navigation-melodic-devel/dwa_local_planner/CMakeFiles/dwa_local_planner_gencfg.dir/all' failed
make[1]: *** [navigation-melodic-devel/dwa_local_planner/CMakeFiles/dwa_local_planner_gencfg.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 19%] Generating dynamic reconfigure files from cfg/ObstaclePlugin.cfg: /home/lzy/LZY_Develop/BZL_develop/BZL_localization/Localization_simulator_ws/devel/include/costmap_2d/ObstaclePluginConfig.h /home/lzy/LZY_Develop/BZL_develop/BZL_localization/Localization_simulator_ws/devel/lib/python2.7/dist-packages/costmap_2d/cfg/ObstaclePluginConfig.py
/home/lzy/LZY_Develop/BZL_develop/BZL_localization/Localization_simulator_ws/build/navigation-melodic-devel/base_local_planner/setup_custom_pythonpath.sh: 5: exec: /home/lzy/LZY_Develop/BZL_develop/BZL_localization/Localization_simulator_ws/src/navigation-melodic-devel/base_local_planner/cfg/BaseLocalPlanner.cfg: Permission denied
navigation-melodic-devel/base_local_planner/CMakeFiles/base_local_planner_gencfg.dir/build.make:63: recipe for target '/home/lzy/LZY_Develop/BZL_develop/BZL_localization/Localization_simulator_ws/devel/include/base_local_planner/BaseLocalPlannerConfig.h' failed
make[2]: *** [/home/lzy/LZY_Develop/BZL_develop/BZL_localization/Localization_simulator_ws/devel/include/base_local_planner/BaseLocalPlannerConfig.h] Error 126
CMakeFiles/Makefile2:8914: recipe for target 'navigation-melodic-devel/base_local_planner/CMakeFiles/base_local_planner_gencfg.dir/all' failed
make[1]: *** [navigation-melodic-devel/base_local_planner/CMakeFiles/base_local_planner_gencfg.dir/all] Error 2
Generating reconfiguration files for Costmap2D in costmap_2d
Wrote header file in /home/lzy/LZY_Develop/BZL_develop/BZL_localization/Localization_simulator_ws/devel/include/costmap_2d/Costmap2DConfig.h
/home/lzy/LZY_Develop/BZL_develop/BZL_localization/Localization_simulator_ws/build/navigation-melodic-devel/costmap_2d/setup_custom_pythonpath.sh: 5: exec: /home/lzy/LZY_Develop/BZL_develop/BZL_localization/Localization_simulator_ws/src/navigation-melodic-devel/costmap_2d/cfg/ObstaclePlugin.cfg: Permission denied
navigation-melodic-devel/costmap_2d/CMakeFiles/costmap_2d_gencfg.dir/build.make:89: recipe for target '/home/lzy/LZY_Develop/BZL_develop/BZL_localization/Localization_simulator_ws/devel/include/costmap_2d/ObstaclePluginConfig.h' failed
make[2]: *** [/home/lzy/LZY_Develop/BZL_develop/BZL_localization/Localization_simulator_ws/devel/include/costmap_2d/ObstaclePluginConfig.h] Error 126
make[2]: *** Waiting for unfinished jobs....
[ 20%] Generating dynamic reconfigure files from cfg/GenericPlugin.cfg: /home/lzy/LZY_Develop/BZL_develop/BZL_localization/Localization_simulator_ws/devel/include/costmap_2d/GenericPluginConfig.h /home/lzy/LZY_Develop/BZL_develop/BZL_localization/Localization_simulator_ws/devel/lib/python2.7/dist-packages/costmap_2d/cfg/GenericPluginConfig.py
[ 20%] Built target _base_local_planner_generate_messages_check_deps_Position2DInt
/home/lzy/LZY_Develop/BZL_develop/BZL_localization/Localization_simulator_ws/build/navigation-melodic-devel/costmap_2d/setup_custom_pythonpath.sh: 5: exec: /home/lzy/LZY_Develop/BZL_develop/BZL_localization/Localization_simulator_ws/src/navigation-melodic-devel/costmap_2d/cfg/GenericPlugin.cfg: Permission denied
navigation-melodic-devel/costmap_2d/CMakeFiles/costmap_2d_gencfg.dir/build.make:107: recipe for target '/home/lzy/LZY_Develop/BZL_develop/BZL_localization/Localization_simulator_ws/devel/include/costmap_2d/GenericPluginConfig.h' failed
make[2]: *** [/home/lzy/LZY_Develop/BZL_develop/BZL_localization/Localization_simulator_ws/devel/include/costmap_2d/GenericPluginConfig.h] Error 126
CMakeFiles/Makefile2:7402: recipe for target 'navigation-melodic-devel/costmap_2d/CMakeFiles/costmap_2d_gencfg.dir/all' failed
make[1]: *** [navigation-melodic-devel/costmap_2d/CMakeFiles/costmap_2d_gencfg.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4 -l4" failed

解决方法:chmod -R +x /home/lzy/LZY_Develop/BZL_develop/BZL_localization/Localization_simulator_ws/src/navigation-melodic-devel/