问题解决方案1-------------catkin_make编译时候的各种问题汇总

文件移植和编译出现的问题汇总

我真实服了,我几乎每一步都能遇到问题,这是我catkin_make时候遇到的新问题:
在这里插入图片描述
百度总结了一下,文末附上链接:

1.Could not find a package configuration file provided by "gazebo_ros_control" with any of the following names: gazebo_ros_controlConfig.cmake gazebo_ros_control-config.cmake

提示缺少“gazebo_ros_control”功能包,
sudo apt-get install ros-kinetic-gazebo-ros-control

  1. 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

提示缺少“gazebo_ros_control”功能包,
sudo apt-get install ros-kinetic-move-base-msgs

3.alsa/asoundlib.h: No such file or directory

缺少一个库,
sudo apt-get install libasound2-dev

4.关于"hardware_interface"

    CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:76 (find_package):
      Could not find a package configuration file provided by
      "hardware_interface" with any of the following names:
     
        hardware_interfaceConfig.cmake
        hardware_interface-config.cmake
     
      Add the installation prefix of "hardware_interface" to CMAKE_PREFIX_PATH or
      set "hardware_interface_DIR" to a directory containing one of the above
      files.  If "hardware_interface" provides a separate development package or
      SDK, be sure it has been installed.
    Call Stack (most recent call first):
      aubo_robot/aubo_new_driver/CMakeLists.txt:9 (find_package)
     
     
    -- Could not find the required component 'hardware_interface'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
    CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
      Could not find a package configuration file provided by
      "hardware_interface" with any of the following names:
     
        hardware_interfaceConfig.cmake
        hardware_interface-config.cmake
     
      Add the installation prefix of "hardware_interface" to CMAKE_PREFIX_PATH or
      set "hardware_interface_DIR" to a directory containing one of the above
      files.  If "hardware_interface" provides a separate development package or
      SDK, be sure it has been installed.
    Call Stack (most recent call first):
      aubo_robot/aubo_new_driver/CMakeLists.txt:9 (find_package)
     
     
    -- Configuring incomplete, errors occurred!
    See also "/home/wgb/catkin_ws/build/CMakeFiles/CMakeOutput.log".
    See also "/home/wgb/catkin_ws/build/CMakeFiles/CMakeError.log".
    Makefile:1858: recipe for target 'cmake_check_build_system' failed
    make: *** [cmake_check_build_system] Error 1
    Invoking "make cmake_check_build_system" failed

解决方法:

sudo apt-get install ros-kinetic-effort-controllers
sudo apt-get install ros-kinetic-joint-state-controller

2、关于controller_manager

CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
      Could not find a package configuration file provided by
      "controller_manager" with any of the following names:
     
        controller_managerConfig.cmake
        controller_manager-config.cmake
     
      Add the installation prefix of "controller_manager" to CMAKE_PREFIX_PATH or
      set "controller_manager_DIR" to a directory containing one of the above
      files.  If "controller_manager" provides a separate development package or
      SDK, be sure it has been installed.
    Call Stack (most recent call first):
      aubo_robot/aubo_new_driver/CMakeLists.txt:9 (find_package)
     
     
    -- Configuring incomplete, errors occurred!
    See also "/home/wgb/catkin_ws/build/CMakeFiles/CMakeOutput.log".
    See also "/home/wgb/catkin_ws/build/CMakeFiles/CMakeError.log".
    Makefile:1858: recipe for target 'cmake_check_build_system' failed
    make: *** [cmake_check_build_system] Error 1
    Invoking "make cmake_check_build_system" failed

解决办法

sudo apt-get install ros-kinetic-ros-control ros-kinetic-ros-controllers

3、与Python兼容问题(No module catkin_dkg.package)

-- Using Python nosetests: /usr/bin/nosetests-2.7
    ImportError: "from catkin_pkg.package import parse_package" failed: No module named catkin_pkg.package
    Make sure that you have installed "catkin_pkg", it is up to date and on the PYTHONPATH.
    CMake Error at /opt/ros/kinetic/share/catkin/cmake/safe_execute_process.cmake:11 (message):
      execute_process(/home/wgb/anaconda2/bin/python
      "/opt/ros/kinetic/share/catkin/cmake/parse_package_xml.py"
      "/opt/ros/kinetic/share/catkin/cmake/../package.xml"
      "/home/wgb/catkin_ws/build/catkin/catkin_generated/version/package.cmake")
      returned error code 1
    Call Stack (most recent call first):
      /opt/ros/kinetic/share/catkin/cmake/catkin_package_xml.cmake:63 (safe_execute_process)
      /opt/ros/kinetic/share/catkin/cmake/all.cmake:151 (_catkin_package_xml)
      /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:20 (include)
      CMakeLists.txt:52 (find_package)
     
     
    -- Configuring incomplete, errors occurred!
    See also "/home/wgb/catkin_ws/build/CMakeFiles/CMakeOutput.log".
    See also "/home/wgb/catkin_ws/build/CMakeFiles/CMakeError.log".
    Invoking "cmake" failed

解决办法
检查一下Python的版本: wgb@wgb:~$ python -V
检查一下catkin依赖的Python版本: wgb@wgb:~$ dpkg -L python-catkin-pkg
如果Python的版本和catkin依赖的版本不一样,说明Python依赖包有问题,解决办法:

    conda install setuptools
    pip install -U rosdep rosinstall_generator wstool rosinstall six vcstools

4、No module named em 的问题

ImportError: No module named em
    gazebo_ros_pkgs/gazebo_msgs/CMakeFiles/gazebo_msgs_generate_messages_cpp.dir/build.make:117: recipe for target '/home/wgb/catkin_ws/devel/include/gazebo_msgs/ContactState.h' failed
    make[2]: *** [/home/wgb/catkin_ws/devel/include/gazebo_msgs/ContactState.h] Error 1
    Traceback (most recent call last):
      File "/opt/ros/kinetic/share/gencpp/cmake/../../../lib/gencpp/gen_cpp.py", line 41, in <module>
        import genmsg.template_tools
      File "/opt/ros/kinetic/lib/python2.7/dist-packages/genmsg/template_tools.py", line 39, in <module>
        import em
    ImportError: No module named em
    gazebo_ros_pkgs/gazebo_msgs/CMakeFiles/gazebo_msgs_generate_messages_cpp.dir/build.make:139: recipe for target '/home/wgb/catkin_ws/devel/include/gazebo_msgs/LinkStates.h' failed
    make[2]: *** [/home/wgb/catkin_ws/devel/include/gazebo_msgs/LinkStates.h] Error 1
    Traceback (most recent call last):
      File "/opt/ros/kinetic/share/gencpp/cmake/../../../lib/gencpp/gen_cpp.py", line 41, in <module>
        import genmsg.template_tools
      File "/opt/ros/kinetic/lib/python2.7/dist-packages/genmsg/template_tools.py", line 39, in <module>
        import em
    ImportError: No module named em
    Traceback (most recent call last):
      File "/opt/ros/kinetic/share/gencpp/cmake/../../../lib/gencpp/gen_cpp.py", line 41, in <module>
        import genmsg.template_tools
      File "/opt/ros/kinetic/lib/python2.7/dist-packages/genmsg/template_tools.py", line 39, in <module>
        import em
    ImportError: No module named em
    gazebo_ros_pkgs/gazebo_msgs/CMakeFiles/gazebo_msgs_generate_messages_cpp.dir/build.make:128: recipe for target '/home/wgb/catkin_ws/devel/include/gazebo_msgs/LinkState.h' failed
    make[2]: *** [/home/wgb/catkin_ws/devel/include/gazebo_msgs/LinkState.h] Error 1
    gazebo_ros_pkgs/gazebo_msgs/CMakeFiles/gazebo_msgs_generate_messages_cpp.dir/build.make:161: recipe for target '/home/wgb/catkin_ws/devel/include/gazebo_msgs/ModelStates.h' failed
    make[2]: *** [/home/wgb/catkin_ws/devel/include/gazebo_msgs/ModelStates.h] Error 1
    Traceback (most recent call last):
      File "/opt/ros/kinetic/share/gencpp/cmake/../../../lib/gencpp/gen_cpp.py", line 41, in <module>
        import genmsg.template_tools
      File "/opt/ros/kinetic/lib/python2.7/dist-packages/genmsg/template_tools.py", line 39, in <module>
        import em
    ImportError: No module named em
    gazebo_ros_pkgs/gazebo_msgs/CMakeFiles/gazebo_msgs_generate_messages_cpp.dir/build.make:174: recipe for target '/home/wgb/catkin_ws/devel/include/gazebo_msgs/WorldState.h' failed
    make[2]: *** [/home/wgb/catkin_ws/devel/include/gazebo_msgs/WorldState.h] Error 1
    CMakeFiles/Makefile2:1511: recipe for target 'gazebo_ros_pkgs/gazebo_msgs/CMakeFiles/gazebo_msgs_generate_messages_cpp.dir/all' failed
    make[1]: *** [gazebo_ros_pkgs/gazebo_msgs/CMakeFiles/gazebo_msgs_generate_messages_cpp.dir/all] Error 2
    Makefile:138: recipe for target 'all' failed
    make: *** [all] Error 2
    Invoking "make -j12 -l12" failed

解决办法:

wgb@wgb:~/catkin_ws$ pip install empy

5、 defusedxml.xmlrpc

Traceback (most recent call last):
      File "/opt/ros/kinetic/lib/xacro/xacro", line 32, in <module>
        import xacro
      File "/opt/ros/kinetic/lib/python2.7/dist-packages/xacro/__init__.py", line 42, in <module>
        from roslaunch import substitution_args
      File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/__init__.py", line 56, in <module>
        from .launch import ROSLaunchRunner
      File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/launch.py", line 55, in <module>
        from roslaunch.nodeprocess import create_master_process, create_node_process
      File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/nodeprocess.py", line 52, in <module>
        from rosmaster.master_api import NUM_WORKERS
      File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/__init__.py", line 35, in <module>
        from .main import rosmaster_main
      File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/main.py", line 43, in <module>
        import rosmaster.master
      File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/master.py", line 47, in <module>
        import rosmaster.master_api
      File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/master_api.py", line 72, in <module>
        from rosmaster.util import xmlrpcapi
      File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/util.py", line 48, in <module>
        from defusedxml.xmlrpc import monkey_patch
    ImportError: No module named defusedxml.xmlrpc
    while processing /home/wgb/catkin_ws/src/aubo_robot/aubo_description/launch/aubo_i5_upload.launch:
    Invalid <param> tag: Cannot load command parameter [robot_description]: command [/opt/ros/kinetic/lib/xacro/xacro --inorder '/home/wgb/catkin_ws/src/aubo_robot/aubo_description/urdf/aubo_i5_robot.urdf.xacro'] returned with code [1].
     
    Param xml is <param command="$(find xacro)/xacro --inorder '$(find aubo_description)/urdf/aubo_i5_robot.urdf.xacro'" name="robot_description"/>
    The traceback for the exception was written to the log file

解决方法:

wgb@wgb:~$ conda install -c conda-forge defusedxml
wgb@wgb:~$ roslaunch aubo_driver aubo_i5_bringup.launch robot_ip:=192.168.1.34
    [aubo_i5_bringup.launch] is neither a launch file in package [aubo_driver] nor is [aubo_driver] a launch file name
    The traceback for the exception was written to the log file


solving mehtod

    Without any further information or poitners to the source of that package it is hard to tell what is going on. Does the file tb_tables.launch actually exist? Did you source the setup.bash file?
     
    What does rospack find tb_tables output?
     
    If that gives an error, try executing source /home/gabriel/catkin_ws/devel/setup.bash and then try the roslaunch again.

解决办法:

source /home/wgb/catkin_ws/devel/setup.bash
-- Found gtest sources under '/usr/src/gtest': gtests will be built
    -- Using Python nosetests: /usr/bin/nosetests-2.7
    CMake Error at /opt/ros/kinetic/share/catkin/cmake/assert.cmake:17 (message):
      
     
      Assertion failed: check for file existence, but filename
      (RT_LIBRARY-NOTFOUND) unset.  Message: RT Library
     
    Call Stack (most recent call first):
      /opt/ros/kinetic/share/catkin/cmake/tools/rt.cmake:42 (assert_file_exists)
      /opt/ros/kinetic/share/catkin/cmake/all.cmake:147 (include)
      /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:20 (include)
      CMakeLists.txt:52 (find_package)
     
     
    -- Configuring incomplete, errors occurred!
    See also "/home/wgb/catkin_ws/build/CMakeFiles/CMakeOutput.log".
    See also "/home/wgb/catkin_ws/build/CMakeFiles/CMakeError.log".
    Invoking "cmake" failed

解决方法
ubuntu 文件夹/usr/lib/x86_64-linux-gnu/ shangmian you ge cha, xiang fa chuqu??????????
8.

/home/wgb/catkin_ws/build/gazebo_ros_pkgs/gazebo_plugins/setup_custom_pythonpath.sh: 4: exec: /home/wgb/catkin_ws/src/gazebo_ros_pkgs/gazebo_plugins/cfg/CameraSynchronizer.cfg: Permission denied

    /home/wgb/catkin_ws/build/gazebo_ros_pkgs/gazebo_plugins/setup_custom_pythonpath.sh: 4: exec: /home/wgb/catkin_ws/src/gazebo_ros_pkgs/gazebo_plugins/cfg/CameraSynchronizer.cfg: Permission denied
    gazebo_ros_pkgs/gazebo_plugins/CMakeFiles/gazebo_plugins_gencfg.dir/build.make:69: recipe for target '/home/wgb/catkin_ws/devel/include/gazebo_plugins/CameraSynchronizerConfig.h' failed
    make[2]: *** [/home/wgb/catkin_ws/devel/include/gazebo_plugins/CameraSynchronizerConfig.h] Error 126
    CMakeFiles/Makefile2:6310: recipe for target 'gazebo_ros_pkgs/gazebo_plugins/CMakeFiles/gazebo_plugins_gencfg.dir/all' failed
    make[1]: *** [gazebo_ros_pkgs/gazebo_plugins/CMakeFiles/gazebo_plugins_gencfg.dir/all] Error 2
    make[1]: *** 正在等待未完成的任务....
    [ 86%] Linking CXX shared library /home/wgb/catkin_ws/devel/lib/libgazebo_ros_joint_trajectory.so
    [ 86%] Built target gazebo_ros_joint_trajectory
    [ 86%] Linking CXX shared library /home/wgb/catkin_ws/devel/lib/libgazebo_ros_joint_state_publisher.so
    [ 86%] Linking CXX shared library /home/wgb/catkin_ws/devel/lib/libgazebo_ros_api_plugin.so
    [ 86%] Built target gazebo_ros_joint_state_publisher
    [ 86%] Built target gazebo_ros_api_plugin
    Makefile:138: recipe for target 'all' failed
    make: *** [all] Error 2
    Invoking "make -j4 -l4" failed

解决方法:

  wgb@wgb:~/catkin_ws/src/gazebo_ros_pkgs/gazebo_ros/cfg$ cd /home/wgb/catkin_ws/src/gazebo_ros_pkgs/gazebo_plugins/cfg
  wgb@wgb:~/catkin_ws/src/gazebo_ros_pkgs/gazebo_plugins/cfg$ chmod +x CameraSynchronizer.cfg

或者:

wgb@wgb:~/catkin_ws/src$ sudo chown -R wgb /home/wgb/catkin_ws/
[sudo] wgb 的密码:
 wgb@wgb:~/catkin_ws/src$ sudo chmod -R +x /home/wgb/catkin_ws/

参考:

https://answers.ros.org/question/206860/error-when-calling-catkin_make-invoking-make-failed/
9. “moveit_ros_planning”

moveit_ros_planningConfig.cmake
moveit_ros_planning-config.cmake
CMake Warning at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:76 (find_package):
      Could not find a package configuration file provided by
      "moveit_ros_planning" with any of the following names:
     
        moveit_ros_planningConfig.cmake
        moveit_ros_planning-config.cmake
     
      Add the installation prefix of "moveit_ros_planning" to CMAKE_PREFIX_PATH
      or set "moveit_ros_planning_DIR" to a directory containing one of the above
      files.  If "moveit_ros_planning" provides a separate development package or
      SDK, be sure it has been installed.
    Call Stack (most recent call first):
      aubo_robot-indigo-devel/aubo_trajectory_filters/CMakeLists.txt:5 (find_package)
     
     
    -- Could not find the required component 'moveit_ros_planning'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
    CMake Error at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
      Could not find a package configuration file provided by
      "moveit_ros_planning" with any of the following names:
     
        moveit_ros_planningConfig.cmake
        moveit_ros_planning-config.cmake
     
      Add the installation prefix of "moveit_ros_planning" to CMAKE_PREFIX_PATH
      or set "moveit_ros_planning_DIR" to a directory containing one of the above
      files.  If "moveit_ros_planning" provides a separate development package or
      SDK, be sure it has been installed.
    Call Stack (most recent call first):
      aubo_robot-indigo-devel/aubo_trajectory_filters/CMakeLists.txt:5 (find_package)
     
     
    -- Configuring incomplete, errors occurred!
    See also "/home/sensetime/catkin_ws/build/CMakeFiles/CMakeOutput.log".
    See also "/home/sensetime/catkin_ws/build/CMakeFiles/CMakeError.log".
    make: *** [cmake_check_build_system] Error 1
    Invoking "make cmake_check_build_system" failed

解决方法:
解决办法: 安装moveit,安装方法参考http://moveit.ros.org/install/

对于indigo

sudo apt-get install ros-indigo-moveit

sudo apt-get install ros-indigo-moveit-full-pr2

source /opt/ros/indigo/setup.bash

对于kinetic

sudo apt-get install ros-kinetic-moveit
source /opt/ros/kinetic/setup.bash

作者:arron盘
来源:优快云
原文:https://blog.youkuaiyun.com/u012197995/article/details/85009861
版权声明:本文为博主原创文章,转载请附上博文链接!

四 arbotix+rviz的功能仿真

<think>嗯,用户询问的是catkin_make命令中-dcatkin_whitelist参数的用法和常见问题。从用户提供的引用内容看,用户可能正在尝试编译ROS包时遇到了问题,特别是引用[2]中提到使用catkin_make -j1编译LEGO-LOAM时出现了警告,虽然引用没有直接提到-dcatkin_whitelist,但用户特别询问这个参数,说明ta可能在文档或社区看到过这个参数。 首先需要明确这个参数的作用。查阅ROS官方文档,-dcatkin_whitelist实际上是一个调试参数,用于强制构建白名单中的特定包。在正常编译场景下普通用户很少需要用到它,主要出现在开发或调试catkin构建系统本身时。 用户可能存在的几个误区: - 误以为这是常规编译参数(实际上属于高级调试选项) - 可能混淆了catkin_makecatkin build的参数(后者有--whitelist) - 看到编译警告后尝试各种参数来解决问题(如引用[2]的警告) 需要重点解释: 1. 参数的正确使用场景(仅catkin开发者) 2. 与常见编译问题的关系(通常无关) 3. 替代方案(如需要指定包应使用--pkg或工作空间管理) 用户引用的几个编译案例(LEGO-LOAM/mbot_navigation)都是常规编译,出现CATKIN_SYMLINK_INSTALL等警告时,应该建议检查CMakeList.txt中的安装规则,而不是使用调试参数。特别要注意引用[2]中用户把路径从Downloads改成中文目录的操作,这可能引发更严重的路径编码问题。 最后给出具体建议时,要区分两种情况:如果是普通用户,直接忽略该参数;如果是catkin开发者,则需配合指定测试包名。同时提醒中文路径的风险,这和引用[2]的经验一致。</think>根据您的问题,结合ROS编译系统原理,以下是关于`catkin_make -dcatkin_whitelist`的详细解析: ### 一、参数作用与使用场景 `-dcatkin_whitelist`是**catkin构建系统的调试参数**,主要用于: 1. **白名单控制** 指定仅构建工作空间中特定包(需配合包名使用) 格式:`catkin_make -dcatkin_whitelist="pkg1;pkg2"` 示例:`catkin_make -dcatkin_whitelist="mbot_navigation;lego_loam"` [^3][^2] 2. **调试构建系统** 当出现`Manually-specified variables were not used by the project`警告时(如您引用的CATKIN_INSTALL_INTO_PREFIX_ROOT警告[^1]),该参数可辅助诊断catkin内部处理逻辑。 ### 二、常见问题解决方案 #### 1. 参数未生效警告 ```bash CMake Warning: Manually-specified variables were not used by the project: CATKIN_WHITELIST_PACKAGES # 实际应使用 -dcatkin_whitelist ``` **原因**:参数名拼写错误或未按规范使用 **解决**: ```bash # 正确格式(注意d前缀和引号) catkin_make -dcatkin_whitelist="your_package_name" ``` #### 2. 与其它参数冲突 ```bash catkin_make: error: argument -j/--jobs: invalid int value: 'catkin_whitelist' ``` **原因**:参数位置错误 **正确顺序**: ```bash catkin_make -dcatkin_whitelist="pkg" -j4 # 调试参数在前 ``` #### 3. 包名未找到 ```bash Package 'unknown_package' not found in workspace ``` **原因**: - 包名拼写错误(区分大小写) - 包未放置在`src/`目录下 **验证**: ```bash ls ~/catkin_ws/src | grep your_package # 检查包是否存在[^3] ``` ### 三、典型使用场景 1. **大型工作空间增量编译** ```bash # 仅编译导航相关包 catkin_make -dcatkin_whitelist="mbot_navigation;amcl;move_base" ``` 2. **依赖隔离调试** ```bash # 单独编译问题的包 catkin_make -dcatkin_whitelist="problem_pkg" --force-cmake ``` 3. **持续集成优化** ```bash # CI脚本中仅构建修改的包 catkin_make -dcatkin_whitelist=$(git diff --name-only HEAD~1 | grep package.xml) ``` > **重要提示**:该参数**非常用功能**,普通编译无需指定。若遇构建问题,建议优先执行: > ```bash > cd ~/catkin_ws > rm -rf build devel # 清理历史构建 > catkin_make -j$(nproc) --cmake-args -DCMAKE_BUILD_TYPE=Release > ```
评论 14
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值