ros(13):ros找不到包报错及解决办法--Config.cmake

该博客详细列举了ROS Melodic版中基础包、专有包、单独编译包及apt-get安装包的安装步骤,包括rospy、tf、grid_map、serial、pcl-ros等,并提供了针对GTest和Qt5WebKit的配置方法。对于找不到的包,通过`sudo apt-get install`命令进行安装,对于需要编译的如casadi和ceres,给出了源码编译的指引。
摘要由CSDN通过智能技术生成

目录

一 基础包

1.1 rospy包

1.2 tf包

1.3 grid_map包

1.4 serial

1.5 pcl-ros

二 专有包

2.1 dynamic_reconfigure包

2.2 rosparam_handler包

2.3 qt_build包

2.4 grid_map_sdf包

2.5 catkin_simple

2.6 camera_info_manager包

2.7 fake_localization包

2.8 laser_filters包

2.9 joint_state_publisher包

2.10 teleop_twist_keyboard包

三 单独编译包

3.1 casadi包

3.2 ceres包

四 apt-get安装包

4.1 GTest

五 需要设置CMakeLists的包

5.1 Qt5WebKit


        注:melodic为ubuntu18.04对应的ros版本名称,ubuntu16.04对应kinetic,ubuntu20.04对应noetic;下面需要简单更改就好

一 基础包

1.1 rospy包

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

    rospyConfig.cmake
    rospy-config.cmake
sudo apt-get install ros-melodic-rospy

1.2 tf包

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

    tfConfig.cmake
    tf-config.cmake

        下面装了比较多的tf*包,解决方案比较暴力,也可以先一个个装,试试还报不报错

sudo apt-get install ros-melodic-tf*

1.3 grid_map包

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

    grid_map_rosConfig.cmake
    grid_map_ros-config.cmake
sudo apt-get install ros-melodic-grid-map

1.4 serial

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

    serialConfig.cmake
    serial-config.cmake

sudo apt-get install ros-melodic-serial

1.5 pcl-ros

[rospack] Error: package 'pcl_ros' not found
sudo apt-get install ros-melodic-pcl-ros

 

二 专有包

2.1 dynamic_reconfigure包

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

    dynamic_reconfigureConfig.cmake
    dynamic_reconfigure-config.cmake

        这个好像是用于智能车辆规划控制的包

sudo apt-get install ros-melodic-dynamic-reconfigure

2.2 rosparam_handler包

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

    rosparam_handlerConfig.cmake
    rosparam_handler-config.cmake

        这个好像是用于调参的包

sudo apt-get install ros-melodic-rosparam-handler

2.3 qt_build包

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

    qt_buildConfig.cmake
    qt_build-config.cmake
sudo apt-get install ros-melodic-qt-build

2.4 grid_map_sdf包

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

    grid_map_sdfConfig.cmake
    grid_map_sdf-config.cmake

        这个包好像独立于1.3 的grid_map?

sudo apt-get install ros-melodic-grid-map-sdf

2.5 catkin_simple

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

    catkin_simpleConfig.cmake
    catkin_simple-config.cmake
git clone https://github.com/catkin/catkin_simple

         放在src中即可

2.6 camera_info_manager包

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

    camera_info_managerConfig.cmake
    camera_info_manager-config.cmake
sudo apt-get install ros-melodic-camera-info-manager

2.7 fake_localization包

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

    fake_localizationConfig.cmake
    fake_localization-config.cmake
sudo apt-get install ros-melodic-fake-localization

2.8 laser_filters包

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

    laser_filtersConfig.cmake
    laser_filters-config.cmake
sudo apt-get install ros-melodic-laser-filters

2.9 joint_state_publisher包

ERROR: cannot launch node of type [joint_state_publisher/joint_state_publisher]: joint_state_publisher
sudo apt-get install ros-melodic-joint-state-publisher

2.10 teleop_twist_keyboard包

[rospack] Error: package 'teleop_twist_keyboard' not found
sudo apt-get install ros-melodic-teleop-twist-keyboard 

三 单独编译包

3.1 casadi包

CMake Error at /home/xxxx/CMakeLists.txt:22 (find_package):
  By not providing "Findcasadi.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "casadi", but
  CMake did not find one.

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

    casadiConfig.cmake
    casadi-config.cmake

        单独编译安装,在https://github.com/casadi/casadi上下载,安装:

cd casadi
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=RELEASE
make
sudo make install

3.2 ceres包

CMake Error at /home/xxxx/opt_solver/CMakeLists.txt:25 (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.

        一般为编译安装,具体参考各大博主

        不过可以安装二进制格式,我在Xavier NX上试过,不会引起程序报错

sudo apt install libceres-dev

四 apt-get安装包

4.1 GTest

        Could NOT find GTest (missing: GTEST_LIBRARY GTEST_MAIN_LIBRARY)

CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find GTest (missing: GTEST_LIBRARY GTEST_MAIN_LIBRARY)
Call Stack (most recent call first):
  /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.10/Modules/FindGTest.cmake:196 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  tests/CMakeLists.txt:1 (find_package)

        大概是因为GTest虽然安装过,但是好像找不到头文件之类的

        解决办法:(重新安装、重新编译)

sudo apt-get install libgtest-dev
sudo apt-get install cmake
cd
cd /usr/src/gtest
sudo cmake CMakeLists.txt 
sudo make 
sudo cp *.a /usr/lib

五 需要设置CMakeLists的包

5.1 Qt5WebKit

报错:

but it set Qt5WebKit_FOUND to FALSE so package "Qt5WebKit" is considered to
  be NOT FOUND.  Reason given by package:

CMake Error at /usr/share/cmake-3.10/Modules/CMakeFindDependencyMacro.cmake:48 (find_package):
  Found package configuration file:

    /home/biter/anaconda3/lib/cmake/Qt5WebKit/Qt5WebKitConfig.cmake

  but it set Qt5WebKit_FOUND to FALSE so package "Qt5WebKit" is considered to
  be NOT FOUND.  Reason given by package:

  Qt5WebKit could not be found because dependency is required to have exact
  version 5.15.x.

上述报错的原因是,在/home/biter/anaconda3/lib/cmake/Qt5WebKit/Qt5WebKitConfig.cmake找到了Qt5WebKit包,但该文件不让用Qt5WebKit包----很奇怪。

在CMakeLists.txt里面增加“查找对应包”就行

find_package(catkin REQUIRED COMPONENTS
  geometry_msgs
  nav_msgs
  sensor_msgs
  roscpp
  rospy
  rosbag
  std_msgs
  image_transport
  cv_bridge
  tf
  pcl_conversions
)
# 增加位置 ===========
find_package (Qt5WebKit REQUIRED)

参考链接:https://blog.csdn.net/numberors/article/details/109765131

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值