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

    Nav2导航框架

    已定时 已固定 已锁定 已移动
    Nav2
    nav2 ros2 humble
    3
    6
    738
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • 23072054672
      李小阳
      最后由 2307205467 编辑

      动手学Ros2,第11章 4.2源码安装navigation2

      colcon build --packages-up-to navigation2   编译之后出现如下错误
      
      /home/li/work/WorkSpace/fishbot_ws/src/navigation2/nav2_mppi_controller/test/noise_generator_test.cpp: In member function ‘virtual void NoiseGeneratorTest_NoiseGeneratorLifecycle_Test::TestBody()’:
      /home/li/work/WorkSpace/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/li/work/WorkSpace/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/li/work/WorkSpace/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/li/work/WorkSpace/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/li/work/WorkSpace/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/li/work/WorkSpace/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/li/work/WorkSpace/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/li/work/WorkSpace/fishbot_ws/src/navigation2/nav2_mppi_controller/test/noise_generator_test.cpp: In member function ‘virtual void NoiseGeneratorTest_NoiseGeneratorMain_Test::TestBody()’:
      /home/li/work/WorkSpace/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/li/work/WorkSpace/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/li/work/WorkSpace/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/li/work/WorkSpace/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/li/work/WorkSpace/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/li/work/WorkSpace/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/li/work/WorkSpace/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: *** [Makefile:146:all] 错误 2
      ---
      Failed   <<< nav2_mppi_controller [2.76s, exited with code 2]
      
      

      请教解决方案

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

        @2307205467 嘿嘿,跟我的错误一样,看我发的帖子,小鱼回复是让二进制安装。

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

          @1367426346 这样操作

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

          回退下版本后测试

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

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

            @小鱼 回退有错误:

            fatal: 有歧义的参数 '1.1.9':未知的版本或路径不存在于工作区中。
            使用 '--' 来分隔版本和路径,例如:
            'git <命令> [<版本>...] -- [<文件>...]'
            
            小鱼小 1 条回复 最后回复 回复 引用 0
            • 小鱼小
              小鱼 技术大佬 @1367426346
              最后由 编辑

              @1367426346

              @小鱼 在 Nav2导航框架 中说:

              git clone https://github.com/ros-planning/navigation2.git -b humble
              cd navigation2 # 加上这句
              git reset 1.1.9

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

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

                @小鱼 回退成了,但是编译还是报原来的错误…

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