当前位置:   article > 正文

Could not find the required component ‘tf2_geometry_msgs‘. The following CMake error indicates that_ros2 the passed package name 'tf2_geometry_msgs' w

ros2 the passed package name 'tf2_geometry_msgs' was not found before
报错信息
 Could NOT find tf2_geometry_msgs(missing: tf2_geometry_msgs_DIR)
-- Could not find the required component 'tf2_geometry_msgs'. 
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
  "tf2_geometry_msgs" with any of the following names:

    tf2_geometry_msgsConfig.cmake
    tf2_geometry_msgs-config.cmake

  Add the installation prefix of "tf2_geometry_msgs" to CMAKE_PREFIX_PATH or
  set "tf2_geometry_msgs_DIR" to a directory containing one of the above
  files.  If "tf2_geometry_msgs" provides a separate development package or
  SDK, be sure it has been installed.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16

在这里插入图片描述

解决方案
sudo apt install ros-melodic-tf2-geometry-msgs
  • 1

ps:如果是ros的其他版本,只需要将melodic换成你的版本即可,然后将后面替换成你缺少的包名,注意要把包名中的 _ 换成 -才可以。这句我全网只找到一篇,还是外网的一个问答。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/article/detail/51114
推荐阅读
  

闽ICP备14008679号