小鱼 ROS 2 新书上线!点击链接查看, 新书配套视频点击链接查看。
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
在编译navigation2及其依赖的时候,产生- The generic dependency on 'nav2_bringup' is redundant with: exec_depend错误,一直无法解决
-
在编译navigation2及其依赖的时候,产生- The generic dependency on 'nav2_bringup' is redundant with: exec_depend错误,一直无法解决
-
@2425004936 在 在编译navigation2及其依赖的时候,产生- The generic dependency on 'nav2_bringup' is redundant with: exec_depend错误,一直无法解决 中说:
exec_depend
检查下对应的 packages.xml ,另外给出上下文
一个好的提问不仅能够帮助自己理清楚问题,还有助于别人快速帮助到你。——提问的智慧
问题一定要描述清楚,终端打印一定复制粘贴,方便回答者检索和引用(你可以在linux系统上打开浏览器进社区)
基本的Markdown语法一定要学习下,有的小伙伴图片代码一团糟
提问时一定要提供尽可能多的信息(系统版本,ROS版本,前后操作,终端日志),包括你的目的,比如你其实想装装某个库遇到问题,不要只说这个问题,因为可能有更好的替代方案
先搜索再提问,很多问题其实都有解决方案,确保你自己对自己的问题有一定了解再提问
尽量一句话说完,不要把社区当微信聊天一样用,每一个回复都尽量提供更多的的信息。 -
@小鱼 好的,谢谢你
-
@小鱼 解决了nav2_bringup错误。确实是packages.xml写错了。目前编译nav2包及其依赖项时一直提示"1 package failed: nav2_mppi_controller
"系统是ubuntu22.04,humble版本。我源码下载的是humble版本。如下是错误信息:
--- stderr: nav2_mppi_controller
/home/lhx/lhx_ws/src/navigation2/nav2_mppi_controller/test/noise_generator_test.cpp: In member function ‘virtual void NoiseGeneratorTest_NoiseGeneratorLifecycle_Test::TestBody()’:
/home/lhx/lhx_ws/src/navigation2/nav2_mppi_controller/test/noise_generator_test.cpp:45:32: error: ‘rclcpp_lifecycle’ was not declared in this scope
45 | auto node = std::make_shared<rclcpp_lifecycle::LifecycleNode>("node");/home/lhx/lhx_ws/src/navigation2/nav2_mppi_controller/test/noise_generator_test.cpp:45:20: error: parse error in template argument list
45 | auto node = std::make_shared<rclcpp_lifecycle::LifecycleNode>("node");/home/lhx/lhx_ws/src/navigation2/nav2_mppi_controller/test/noise_generator_test.cpp:45:64: error: no matching function for call to ‘make_shared<<expression error> >(const char [5])’
45 | auto node = std::make_shared<rclcpp_lifecycle::LifecycleNode>("node");In file included from /usr/include/c++/11/memory:77,
from /opt/ros/humble/src/gtest_vendor/include/gtest/gtest.h:57,
from /home/lhx/lhx_ws/src/navigation2/nav2_mppi_controller/test/noise_generator_test.cpp:18:
/usr/include/c++/11/bits/shared_ptr.h:875:5: note: candidate: ‘template<class _Tp, class ... _Args> std::shared_ptr<_Tp> std::make_shared(_Args&& ...)’
875 | make_shared(_Args&&... __args)/usr/include/c++/11/bits/shared_ptr.h:875:5: note: template argument deduction/substitution failed:
/home/lhx/lhx_ws/src/navigation2/nav2_mppi_controller/test/noise_generator_test.cpp:45:64: error: template argument 1 is invalid
45 | auto node = std::make_shared<rclcpp_lifecycle::LifecycleNode>("node");/home/lhx/lhx_ws/src/navigation2/nav2_mppi_controller/test/noise_generator_test.cpp:47:3: error: ‘ParametersHandler’ was not declared in this scope
47 | ParametersHandler handler(node);/home/lhx/lhx_ws/src/navigation2/nav2_mppi_controller/test/noise_generator_test.cpp:49:55: error: ‘handler’ was not declared in this scope
49 | generator.initialize(settings, false, "test_name", &handler);/home/lhx/lhx_ws/src/navigation2/nav2_mppi_controller/test/noise_generator_test.cpp: In member function ‘virtual void NoiseGeneratorTest_NoiseGeneratorMain_Test::TestBody()’:
/home/lhx/lhx_ws/src/navigation2/nav2_mppi_controller/test/noise_generator_test.cpp:57:32: error: ‘rclcpp_lifecycle’ was not declared in this scope
57 | auto node = std::make_shared<rclcpp_lifecycle::LifecycleNode>("node");/home/lhx/lhx_ws/src/navigation2/nav2_mppi_controller/test/noise_generator_test.cpp:57:20: error: parse error in template argument list
57 | auto node = std::make_shared<rclcpp_lifecycle::LifecycleNode>("node");/home/lhx/lhx_ws/src/navigation2/nav2_mppi_controller/test/noise_generator_test.cpp:57:64: error: no matching function for call to ‘make_shared<<expression error> >(const char [5])’
57 | auto node = std::make_shared<rclcpp_lifecycle::LifecycleNode>("node");In file included from /usr/include/c++/11/memory:77,
from /opt/ros/humble/src/gtest_vendor/include/gtest/gtest.h:57,
from /home/lhx/lhx_ws/src/navigation2/nav2_mppi_controller/test/noise_generator_test.cpp:18:
/usr/include/c++/11/bits/shared_ptr.h:875:5: note: candidate: ‘template<class _Tp, class ... _Args> std::shared_ptr<_Tp> std::make_shared(_Args&& ...)’
875 | make_shared(_Args&&... __args)/usr/include/c++/11/bits/shared_ptr.h:875:5: note: template argument deduction/substitution failed:
/home/lhx/lhx_ws/src/navigation2/nav2_mppi_controller/test/noise_generator_test.cpp:57:64: error: template argument 1 is invalid
57 | auto node = std::make_shared<rclcpp_lifecycle::LifecycleNode>("node");/home/lhx/lhx_ws/src/navigation2/nav2_mppi_controller/test/noise_generator_test.cpp:59:3: error: ‘ParametersHandler’ was not declared in this scope
59 | ParametersHandler handler(node);/home/lhx/lhx_ws/src/navigation2/nav2_mppi_controller/test/noise_generator_test.cpp:59:3: error: ‘ParametersHandler’ was not declared in this scope
59 | ParametersHandler handler(node);/home/lhx/lhx_ws/src/navigation2/nav2_mppi_controller/test/noise_generator_test.cpp:81:55: error: ‘handler’ was not declared in this scope
81 | generator.initialize(settings, false, "test_name", &handler);gmake[2]: *** [test/CMakeFiles/noise_generator_test.dir/build.make:76:test/CMakeFiles/noise_generator_test.dir/noise_generator_test.cpp.o] 错误 1
gmake[1]: *** [CMakeFiles/Makefile2:334:test/CMakeFiles/noise_generator_test.dir/all] 错误 2
gmake: *** [Makefile:146:all] 错误 2Failed <<< nav2_mppi_controller [13.6s, exited with code 2]
-
@2425004936 又一个出现这个问题的。
-
@1367426346 我来check下
这样操作
git clone https://github.com/ros-planning/navigation2.git -b humble
git reset 1.1.9回退下版本后测试
-
此回复已被删除! -
@小鱼 在 在编译navigation2及其依赖的时候,产生- The generic dependency on 'nav2_bringup' is redundant with: exec_depend错误,一直无法解决 中说:
git reset 1.1.9
试了一下,回退版本还是无法编译成功。错误提示还是和上面一样
-
@2425004936 你好,你怎么改的package.xml文件啊
-
我在编译的时候也遇到了同样的问题,求解答。
对应教程地址:
https://fishros.com/d2lros2/#/humble/chapt11/get_started/3.使用FishBot进行自主导航具体错误:
colcon build --packages-up-to fishbot_navigation2 [0.420s] WARNING:colcon.colcon_core.package_identification:Failed to parse ROS package manifest in 'src/fishbot_navigation2': Error(s) in package 'src/fishbot_navigation2/package.xml': Error(s): - The generic dependency on 'nav2_bringup' is redundant with: exec_depend Starting >>> fishbot_navigation2 --- stderr: fishbot_navigation2 CMake Error at CMakeLists.txt:10 (find_package): By not providing "Findnav2_bringup.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "nav2_bringup", but CMake did not find one. Could not find a package configuration file provided by "nav2_bringup" with any of the following names: nav2_bringupConfig.cmake nav2_bringup-config.cmake Add the installation prefix of "nav2_bringup" to CMAKE_PREFIX_PATH or set "nav2_bringup_DIR" to a directory containing one of the above files. If "nav2_bringup" provides a separate development package or SDK, be sure it has been installed. --- Failed <<< fishbot_navigation2 [0.53s, exited with code 1] Summary: 0 packages finished [0.70s] 1 package failed: fishbot_navigation2 1 package had stderr output: fishbot_navigation2
-
@1548792408 补充:
- 下载 nav2 时采用的是源码方式(依赖也按照教程用
rosdepc install -r --from-paths src --ignore-src --rosdistro $ROS_DISTRO -y
下载了) - 并且在终端也将 nav2 source到工作空间了
- 下载 nav2 时采用的是源码方式(依赖也按照教程用
-
@1548792408
已解决!
不知道什么原因,如果只用下面这条语句,在源码编译的时候没有编译 包nav2_bringup
colcon build --packages-up-to navigation2
至于我是怎么发现没有编译 包
nav2_bringup
的:在工作空间目录(即fishbot_ws)下的install
文件夹中你会发现没有 包nav2_bringup
对应的文件夹。我采用的解决方法(单独对缺失的 包
nav2_bringup
进行编译):cd fishbot_ws colcon build --packages-up-to nav2_bringup