鱼香ROS社区
    • 版块
    • 最新
    • 未解决
    • 已解决
    • 群组
    • 注册
    • 登录
    紧急通知:禁止一切关于政治&VPN翻墙等话题,发现相关帖子会立马删除封号
    提问前必看的发帖注意事项: 社区问答规则(小鱼个人)更新 | 高质量帖子发布指南

    在编译navigation2及其依赖的时候,产生- The generic dependency on 'nav2_bringup' is redundant with: exec_depend错误,一直无法解决

    已定时 已固定 已锁定 已移动 未解决
    综合问题
    nav2 ros2 nav2bringup
    5
    12
    922
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • 24250049362
      PEGASUS @小鱼
      最后由 编辑

      @小鱼 好的,谢谢你

      1 条回复 最后回复 回复 引用 0
      • 24250049362
        PEGASUS
        最后由 编辑

        @小鱼 解决了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] 错误 2

        Failed <<< nav2_mppi_controller [13.6s, exited with code 2]

        13674263461 26932262522 2 条回复 最后回复 回复 引用 0
        • 13674263461
          理想之光 @2425004936
          最后由 编辑

          @2425004936 又一个出现这个问题的。

          小鱼小 1 条回复 最后回复 回复 引用 0
          • 小鱼小
            小鱼 技术大佬 @1367426346
            最后由 小鱼 编辑

            @1367426346 我来check下

            这样操作

            git clone https://github.com/ros-planning/navigation2.git -b humble
            git reset 1.1.9

            回退下版本后测试


            新书配套视频:https://www.bilibili.com/video/BV1GW42197Ck/

            24250049362 2 条回复 最后回复 回复 引用 0
            • 24250049362
              PEGASUS @小鱼
              最后由 编辑

              此回复已被删除!
              1 条回复 最后回复 回复 引用 0
              • 24250049362
                PEGASUS @小鱼
                最后由 编辑

                @小鱼 在 在编译navigation2及其依赖的时候,产生- The generic dependency on 'nav2_bringup' is redundant with: exec_depend错误,一直无法解决 中说:

                git reset 1.1.9

                试了一下,回退版本还是无法编译成功。错误提示还是和上面一样

                1 条回复 最后回复 回复 引用 0
                • 26932262522
                  命里有我 @2425004936
                  最后由 编辑

                  @2425004936 你好,你怎么改的package.xml文件啊

                  1 条回复 最后回复 回复 引用 0
                  • 1
                    星期八
                    最后由 编辑

                    我在编译的时候也遇到了同样的问题,求解答。

                    对应教程地址:
                    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
                    
                    
                    1 1 条回复 最后回复 回复 引用 0
                    • 1
                      星期八 @1548792408
                      最后由 编辑

                      @1548792408 补充:

                      1. 下载 nav2 时采用的是源码方式(依赖也按照教程用rosdepc install -r --from-paths src --ignore-src --rosdistro $ROS_DISTRO -y下载了)
                      2. 并且在终端也将 nav2 source到工作空间了
                      1 1 条回复 最后回复 回复 引用 0
                      • 1
                        星期八 @1548792408
                        最后由 编辑

                        @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
                        
                        1 条回复 最后回复 回复 引用 0
                        • 第一个帖子
                          最后一个帖子
                        皖ICP备16016415号-7
                        Powered by NodeBB | 鱼香ROS