1. 程式人生 > >基於ROS的服務機器人移植過程編譯問題彙總

基於ROS的服務機器人移植過程編譯問題彙總

為方便後續工作,寫下部落格彙總服務機器人v1.0程式碼移植到筆記本上遇到的一些編譯錯誤問題。

1、工作空間包含的src如下


2、編譯

   1)初次編譯錯誤:

CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  Could not find a package configuration file provided by "move_base_msgs"
  with any of the following names:

    move_base_msgsConfig.cmake
    move_base_msgs-config.cmake

  Add the installation prefix of "move_base_msgs" to CMAKE_PREFIX_PATH or set
  "move_base_msgs_DIR" to a directory containing one of the above files.  If
  "move_base_msgs" provides a separate development package or SDK, be sure it
  has been installed.
Call Stack (most recent call first):
  navigation_send_goals/CMakeLists.txt:4 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/jk/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/jk/catkin_ws/build/CMakeFiles/CMakeError.log".

    分析:筆記本未安裝move_base包

    措施:

sudo apt-get install ros-kinetic-navigation

再次編譯出現:


sudo apt-get install libbullet-dev

如果存在依賴問題,需要修復

sudo apt-get -f install

注:如果出現依賴問題解決不了,可以考慮降級安裝包:

首先安裝:

sudo apt-get install aptitude
如果是:Could NOT find SDL (missing: SDL_LIBRARYSDL_INCLUDE_DIR)
sudo aptitude install libsdl1.2-dev

先選擇no,後選擇yes,降級安裝

sdl_image問題也如此

sudo apt-get install libsdl-image1.2-dev 

或者

sudo aptitude install libsdl-image1.2-dev 

2)再次編譯

CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  Could not find a package configuration file provided by
  "turtlebot_navigation" with any of the following names:

    turtlebot_navigationConfig.cmake
    turtlebot_navigation-config.cmake

  Add the installation prefix of "turtlebot_navigation" to CMAKE_PREFIX_PATH
  or set "turtlebot_navigation_DIR" to a directory containing one of the
  above files.  If "turtlebot_navigation" provides a separate development
  package or SDK, be sure it has been installed.
Call Stack (most recent call first):
  kelai_robot/CMakeLists.txt:6 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/jk/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/jk/catkin_ws/build/CMakeFiles/CMakeError.log".

分析:機器人使用了turtlebot的鍵盤控制以及gmapping,安裝turtlebot包

措施:

 sudo apt-get install ros-kinetic-turtlebot
 sudo apt-get install ros-kinetic-turtlebot-navigation

3)再編譯

CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  Could not find a package configuration file provided by "serial" with any
  of the following names:

    serialConfig.cmake
    serial-config.cmake

  Add the installation prefix of "serial" to CMAKE_PREFIX_PATH or set
  "serial_DIR" to a directory containing one of the above files.  If "serial"
  provides a separate development package or SDK, be sure it has been
  installed.
Call Stack (most recent call first):
  kelai_robot/CMakeLists.txt:6 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/jk/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/jk/catkin_ws/build/CMakeFiles/CMakeError.log".

分析:缺少ros的串列埠包

措施:

sudo apt-get install ros-kinnetic-serial

4)繼續編譯出現:

/usr/bin/ld: 找不到 -lmsc

分析:訊飛語音SDk提供的動態連結庫沒有放在/usr/lib下

措施:

cd ~/catkin_ws/src/xf_voice/lib/
ls

顯示:

libmsc.so

措施:

sudo cp libmsc.so /usr/lib

5)繼續編譯

編譯成功