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

    Nav2源码安装编译,nav2_mppi_controller报错

    已定时 已固定 已锁定 已移动 未解决
    Nav2
    nav2 nav2 ros2 nav2教程中遇到的问题 nav2源码安装有错误提示 navigation2
    8
    13
    1.6k
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • 13674263461
      理想之光
      最后由 1367426346 编辑

      两台电脑编译,都是相同的错误。

      -- stderr: nav2_mppi_controller                                 
      /home/gree/fishbot_ws/src/navigation2/nav2_mppi_controller/test/noise_generator_test.cpp: In member function ‘virtual void NoiseGeneratorTest_NoiseGeneratorLifecycle_Test::TestBody()’:
      /home/gree/fishbot_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/gree/fishbot_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/gree/fishbot_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/gree/fishbot_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/gree/fishbot_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/gree/fishbot_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/gree/fishbot_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/gree/fishbot_ws/src/navigation2/nav2_mppi_controller/test/noise_generator_test.cpp: In member function ‘virtual void NoiseGeneratorTest_NoiseGeneratorMain_Test::TestBody()’:
      /home/gree/fishbot_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/gree/fishbot_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/gree/fishbot_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/gree/fishbot_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/gree/fishbot_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/gree/fishbot_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/gree/fishbot_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[1]: *** 正在等待未完成的任务....
      gmake: *** [Makefile:146:all] 错误 2
      ---
      Failed   <<< nav2_mppi_controller [16.8s, exited with code 2]
      
      
      小鱼小 27616077292 2 条回复 最后回复 回复 引用 0
      • 小鱼小
        小鱼 技术大佬 @1367426346
        最后由 编辑

        @1367426346 代码版本不匹配估计

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

        13674263461 1 条回复 最后回复 回复 引用 0
        • 13674263461
          理想之光 @小鱼
          最后由 编辑

          @小鱼 啊?我按照你的教程装的呀,就是humble版本呀

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

            @1367426346 先直接二进制安装试试

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

            13674263461 1 条回复 最后回复 回复 引用 0
            • 13674263461
              理想之光 @小鱼
              最后由 编辑

              @小鱼 二进制安装可以,但是这样就看不到代码了…

              W 小鱼小 2 条回复 最后回复 回复 引用 0
              • W
                ws13610612715 @1367426346
                最后由 编辑

                @1367426346 解决了么 ? 我也出现这个问题 。 还有另外一个问题就是63455394-e0bf-475c-a0bc-9c823964e8cf-image.png

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

                  @1367426346 可以 下载源码直接 看,或者回退源码版本和系统nav2同样版本即可

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

                  1 条回复 最后回复 回复 引用 0
                  • 13674263461
                    理想之光 @ws13610612715
                    最后由 编辑

                    @ws13610612715 没解决,只能二进制安装了。

                    1 条回复 最后回复 回复 引用 0
                    • 19320885261
                      漸行漸遠 @1367426346
                      最后由 编辑

                      @1367426346 二进制怎么安装navigation2啊?

                      1 条回复 最后回复 回复 引用 0
                      • 31103799213
                        Labor
                        最后由 编辑

                        我也遇到了相同的问题,报错信息是一样的,我是按照Nav2官方教程的Released Distribution Binaries进行的安装

                        source /opt/ros/<distro>/setup.bash
                        mkdir -p ~/nav2_ws/src && cd ~/nav2_ws
                        git clone https://github.com/ros-planning/navigation2.git --branch $ROS_DISTRO ./src/navigation2
                        rosdep install -y \
                          --from-paths ./src \
                          --ignore-src
                        colcon build \
                          --symlink-install
                        

                        现在还没解决

                        5314668385 1 条回复 最后回复 回复 引用 0
                        • 5314668385
                          “ @3110379921
                          最后由 编辑

                          @3110379921 解决了不,我遇到同样问题。

                          1 条回复 最后回复 回复 引用 0
                          • 27616077292
                            赤诚 @1367426346
                            最后由 编辑

                            @1367426346 兄弟,你解决了嘛

                            5 1 条回复 最后回复 回复 引用 0
                            • 5
                              流水心清 @2761607729
                              最后由 编辑

                              @2761607729 兄弟,解决了吗?我源码编译也编译不通过,一直卡死

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