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

    [FishBot教程]9.0.7. FishBot-Nav2导航测试

    已定时 已固定 已锁定 已移动
    FishBot二驱机器人
    fishbot 导航
    65
    236
    105.4k
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • H
      yaoyao ROS2开发者
      最后由 HermitWJ 编辑

      一、下载与编译导航代码

      打开终端,输入下面的指令。

      git clone https://github.com/fishros/fishbot.git -b v1.0.0 --depth=1
      cd fishbot
      rosdep install --from-paths src --ignore-src -y -r # 安装依赖
      colcon build

      执行最后一步colcon build报错

      以下是报错信息:

      colcon build
      Starting >>> fishbot_bringup
      Starting >>> fishbot_cartographer
      Starting >>> fishbot_description
      Starting >>> fishbot_interfaces
      Starting >>> fishbot_navigation2
      Finished <<< fishbot_cartographer [1.76s]
      Finished <<< fishbot_navigation2 [1.83s]
      --- stderr: fishbot_interfaces
      CMake Error at /opt/ros/humble/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:240 (list):
      list index: 1 out of range (-1, 0)
      Call Stack (most recent call first):
      CMakeLists.txt:29 (rosidl_generate_interfaces)

      CMake Error at /opt/ros/humble/share/rosidl_generator_c/cmake/rosidl_generator_c_generate_interfaces.cmake:69 (message):
      Target dependency
      '/fishbot/build/fishbot_interfaces/rosidl_adapter/fishbot_interfaces/srv/FishBotConfig.idl'
      does not exist
      Call Stack (most recent call first):
      /opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
      /opt/ros/humble/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:286 (ament_execute_extensions)
      CMakeLists.txt:29 (rosidl_generate_interfaces)


      Failed <<< fishbot_interfaces [4.23s, exited with code 1]
      Aborted <<< fishbot_description [4.57s]
      Aborted <<< fishbot_bringup [35.8s]

      Summary: 2 packages finished [36.8s]
      1 package failed: fishbot_interfaces
      2 packages aborted: fishbot_bringup fishbot_description
      1 package had stderr output: fishbot_interfaces

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

        @HermitWJ 问一下你的操作系统版本信息,还有你把代码放到了哪个位置,不要放桌面之类的奇怪位置哦

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

        H 1 条回复 最后回复 回复 引用 0
        • 2
          等待修复
          最后由 编辑

          我这边的配置和鱼哥的一模一样,,ROS2humle,ubuntu22.04,但是我发现我在进行导航的时候啊,就是会小车走到一半就会终止,
          c83eebd3-c0a3-471e-8b68-0531f98df6b2-b6977e2223186d40397c8f0f78cc84a.png
          就像这样,请问这是怎么回事呢

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

            @2462331351 图太乱了,没有空间给小车走

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

            1 条回复 最后回复 回复 引用 0
            • H
              yaoyao ROS2开发者 @小鱼
              最后由 编辑

              @小鱼 感谢小鱼,问题已解决

              1 条回复 最后回复 回复 引用 0
              • R
                ros_freshman 年度VIP @921203724
                最后由 编辑

                @921203724 你这个问题解决了吗,我出现了同样的问题。@小鱼

                1 条回复 最后回复 回复 引用 0
                • R
                  ros_freshman 年度VIP
                  最后由 编辑

                  4c6a01f6-e89e-4c1b-a298-4f84e54c57a9-图片.png
                  出现这个错误了,该怎么解决呢?rosdep已经用一键安装配置好了。

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

                    @ros_freshman 可以跳过

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

                    1 条回复 最后回复 回复 引用 0
                    • R
                      rex.chen80
                      最后由 编辑

                      我使用的fishros镜像系统。
                      但是colcon编译一直报错。有没有整合好的代码可以运行?

                      ~ » git clone https://github.com/fishros/fishbot.git -b v1.0.0 --depth=1
                      正克隆到 'fishbot'...
                      remote: Enumerating objects: 84, done.
                      remote: Counting objects: 100% (84/84), done.
                      remote: Compressing objects: 100% (69/69), done.
                      remote: Total 84 (delta 21), reused 46 (delta 7), pack-reused 0 (from 0)
                      接收对象中: 100% (84/84), 332.98 KiB | 1.81 MiB/s, 完成.
                      处理 delta 中: 100% (21/21), 完成.


                      ~ » cd fishbot


                      fishbot (v1.0.0 o) » rosdep install --from-paths src --ignore-src -y -r # 安 装依赖
                      #All required rosdeps installed successfully


                      fishbot (v1.0.0 o) » colcon build
                      Starting >>> fishbot_bringup
                      Starting >>> fishbot_cartographer
                      Starting >>> fishbot_description
                      Starting >>> fishbot_interfaces
                      Starting >>> fishbot_navigation2
                      Finished <<< fishbot_description [0.60s]
                      Finished <<< fishbot_cartographer [0.71s]
                      Finished <<< fishbot_navigation2 [0.84s]
                      --- stderr: fishbot_interfaces
                      CMake Error at /opt/ros/humble/share/rosidl_adapter/cmake/rosidl_adapt_interfaces.cmake:59 (message):

                      execute_process(/home/fishros/.x-cmd.root/local/data/pkg/sphere/X/l/j/h/bin/python3
                      -m rosidl_adapter --package-name fishbot_interfaces --arguments-file
                      /home/fishros/fishbot/build/fishbot_interfaces/rosidl_adapter__arguments__fishbot_interfaces.json
                      --output-dir
                      /home/fishros/fishbot/build/fishbot_interfaces/rosidl_adapter/fishbot_interfaces
                      --output-file
                      /home/fishros/fishbot/build/fishbot_interfaces/rosidl_adapter/fishbot_interfaces.idls)
                      returned error code 1:

                      AttributeError processing template 'srv.idl.em'

                      Traceback (most recent call last):

                      File "/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_adapter/resource/__init__.py", line 48, in evaluate_template
                        _interpreter = em.Interpreter(
                      

                      AttributeError: module 'em' has no attribute 'Interpreter'

                      During handling of the above exception, another exception occurred:

                      Traceback (most recent call last):

                      File "/home/fishros/.x-cmd.root/local/data/pkg/sphere/X/tree.linux.x64.0/miniconda/v3.10.0+23.9.0-0/lib/python3.10/runpy.py", line 196, in _run_module_as_main
                        return _run_code(code, main_globals, None,
                      File "/home/fishros/.x-cmd.root/local/data/pkg/sphere/X/tree.linux.x64.0/miniconda/v3.10.0+23.9.0-0/lib/python3.10/runpy.py", line 86, in _run_code
                        exec(code, run_globals)
                      File "/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_adapter/__main__.py", line 19, in <module>
                        sys.exit(main())
                      File "/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_adapter/main.py", line 53, in main
                        abs_idl_file = convert_to_idl(
                      File "/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_adapter/__init__.py", line 24, in convert_to_idl
                        return convert_srv_to_idl(
                      File "/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_adapter/srv/__init__.py", line 39, in convert_srv_to_idl
                        expand_template('srv.idl.em', data, output_file, encoding='iso-8859-1')
                      File "/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_adapter/resource/__init__.py", line 23, in expand_template
                        content = evaluate_template(template_name, data)
                      File "/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_adapter/resource/__init__.py", line 69, in evaluate_template
                        _interpreter.shutdown()
                      

                      AttributeError: 'NoneType' object has no attribute 'shutdown'

                      Call Stack (most recent call first):
                      /opt/ros/humble/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:130 (rosidl_adapt_interfaces)
                      CMakeLists.txt:29 (rosidl_generate_interfaces)


                      Failed <<< fishbot_interfaces [0.89s, exited with code 1]
                      Aborted <<< fishbot_bringup [1.08s]

                      Summary: 3 packages finished [1.24s]
                      1 package failed: fishbot_interfaces
                      1 package aborted: fishbot_bringup
                      1 package had stderr output: fishbot_interfaces

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

                        @rex-chen80 在 [FishBot教程]7. FishBot-Nav2导航测试 中说:

                        fishbot_interfaces

                        删除下这个功能包试试

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

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

                          鱼哥,我在执行这段代码:ros2 launch fishbot_navigation2 navigation2.launch.py
                          发生报错:
                          raise InvalidLaunchFileError(extension, likely_errors=exceptions)
                          launch.invalid_launch_file_error.InvalidLaunchFileError: Caught exception when trying to load file of format [py]: "package 'nav2_bringup' not found, searching: ['/home/jws/fishbot/fishbot/install/fishbot_navigation2', '/home/jws/fishbot/fishbot/install/fishbot_interfaces', '/home/jws/fishbot/fishbot/install/fishbot_description', '/home/jws/fishbot/fishbot/install/fishbot_cartographer', '/home/jws/fishbot/fishbot/install/fishbot_bringup', '/opt/ros/foxy']"

                          好像是缺少一个功能包:nav2_bringup
                          后来我搜了GPT,执行了:sudo apt install ros-foxy-nav2-bt-navigator(运行成功了)
                          后来再回来执行:ros2 launch fishbot_navigation2 navigation2.launch.py
                          还是原来的找不到“nav2_bringup”包这个错误。
                          该怎么解决啊😭

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

                            @18296522393 建议用humble版本,另外需要单独装一下nav2_bringup,你可以看最新的视频或书,7.2章节有介绍命令。

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

                            1 条回复 最后回复 回复 引用 0
                            • 16347699901
                              西林街 @1683127550
                              最后由 编辑

                              @1683127550 请问解决了吗?

                              Y 1 条回复 最后回复 回复 引用 0
                              • 小鱼小 小鱼 在 中 引用了 这个主题
                              • Y
                                yongyong @1683127550
                                最后由 编辑

                                @1683127550 你这个解决了吗

                                1 条回复 最后回复 回复 引用 0
                                • Y
                                  yongyong
                                  最后由 编辑

                                  2d pose estimate 初始化不了怎么回事呢05ceebe3-1e2d-4014-a648-ad24dd79e2e1-image.png

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

                                    @yongyong 把终端日志拿出来看看

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

                                    1 条回复 最后回复 回复 引用 0
                                    • 2
                                      2075605318 年度VIP
                                      最后由 编辑

                                      lwb@Lwb:~/fishbot_nav$ colcon build
                                      Starting >>> fishbot_bringup
                                      Starting >>> fishbot_cartographer
                                      Starting >>> fishbot_description
                                      Starting >>> fishbot_interfaces
                                      Starting >>> fishbot_navigation2
                                      Finished <<< fishbot_cartographer [0.09s]
                                      Finished <<< fishbot_navigation2 [0.09s]
                                      Finished <<< fishbot_description [0.11s]
                                      Finished <<< fishbot_bringup [0.13s]
                                      --- stderr: fishbot_interfaces
                                      Traceback (most recent call last):
                                      File "/home/lwb/fishbot_nav/build/fishbot_interfaces/ament_cmake_python/fishbot_interfaces/setup.py", line 4, in <module>
                                      setup(
                                      File "/home/lwb/.local/lib/python3.10/site-packages/setuptools/init.py", line 117, in setup
                                      return distutils.core.setup(**attrs)
                                      File "/home/lwb/.local/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 186, in setup
                                      return run_commands(dist)
                                      File "/home/lwb/.local/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 202, in run_commands
                                      dist.run_commands()
                                      File "/home/lwb/.local/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 983, in run_commands
                                      self.run_command(cmd)
                                      File "/home/lwb/.local/lib/python3.10/site-packages/setuptools/dist.py", line 999, in run_command
                                      super().run_command(command)
                                      File "/home/lwb/.local/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 1002, in run_command
                                      cmd_obj.run()
                                      File "/home/lwb/.local/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 312, in run
                                      self.find_sources()
                                      File "/home/lwb/.local/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 320, in find_sources
                                      mm.run()
                                      File "/home/lwb/.local/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 548, in run
                                      self.prune_file_list()
                                      File "/home/lwb/.local/lib/python3.10/site-packages/setuptools/command/sdist.py", line 162, in prune_file_list
                                      super().prune_file_list()
                                      File "/home/lwb/.local/lib/python3.10/site-packages/setuptools/_distutils/command/sdist.py", line 380, in prune_file_list
                                      base_dir = self.distribution.get_fullname()
                                      File "/home/lwb/.local/lib/python3.10/site-packages/setuptools/_core_metadata.py", line 272, in get_fullname
                                      return _distribution_fullname(self.get_name(), self.get_version())
                                      File "/home/lwb/.local/lib/python3.10/site-packages/setuptools/_core_metadata.py", line 290, in _distribution_fullname
                                      canonicalize_version(version, strip_trailing_zero=False),
                                      TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'
                                      gmake[2]: *** [CMakeFiles/ament_cmake_python_build_fishbot_interfaces_egg.dir/build.make:70:CMakeFiles/ament_cmake_python_build_fishbot_interfaces_egg] 错误 1
                                      gmake[1]: *** [CMakeFiles/Makefile2:447:CMakeFiles/ament_cmake_python_build_fishbot_interfaces_egg.dir/all] 错误 2
                                      gmake[1]: *** 正在等待未完成的任务....
                                      gmake: *** [Makefile:146:all] 错误 2

                                      Failed <<< fishbot_interfaces [0.39s, exited with code 2]

                                      Summary: 4 packages finished [0.52s]
                                      1 package failed: fishbot_interfaces
                                      1 package had stderr output: fishbot_interfaces

                                      按照步骤来的这个interface一直编译不过是不是源代码有语法错误

                                      1 条回复 最后回复 回复 引用 0
                                      • A atjason 在 中 引用了 这个主题
                                      • Y
                                        yongyong
                                        最后由 编辑

                                        832e5f7a-31e8-4e32-b361-fd8e7f1c17db-image.png file:///home/lyy/%E5%9B%BE%E7%89%87/%E6%88%AA%E5%9B%BE/%E6%88%AA%E5%9B%BE%202025-03-29%2014-32-11.png

                                        这个出了什么问题啊

                                        1 条回复 最后回复 回复 引用 0
                                        • Y
                                          yongyong @1634769990
                                          最后由 编辑

                                          @1634769990 你解决了吗

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

                                            可以实现导航功能,但不准确。而且雷达会报error ,不知道有哪位大神可以指点如何解决。

                                            [ydlidar_node-2] [2025-04-05 01:04:07][error] Check Sum 0x59BC != 0x8FAA
                                            [ydlidar_node-2] [2025-04-05 01:04:07][error] Check Sum 0x0199 != 0x4A68
                                            [ydlidar_node-2] [2025-04-05 01:04:07][error] Check Sum 0x45A6 != 0x493D
                                            [ydlidar_node-2] [2025-04-05 01:04:55][error] Check Sum 0x73D6 != 0x5C76
                                            [ydlidar_node-2] [2025-04-05 01:05:30][error] Check Sum 0x0077 != 0x3023
                                            [ydlidar_node-2] [2025-04-05 01:05:51][error] Check Sum 0x6D00 != 0x7940
                                            [ydlidar_node-2] [2025-04-05 01:05:51][error] Check Sum 0x6874 != 0x64AF
                                            [ydlidar_node-2] [2025-04-05 01:05:59][error] Check Sum 0x75C8 != 0x6DCC
                                            [ydlidar_node-2] [2025-04-05 01:06:03][error] Check Sum 0x69BA != 0x6FB2
                                            [ydlidar_node-2] [2025-04-05 01:06:34][error] Check Sum 0x1C86 != 0x0D49
                                            [ydlidar_node-2] [2025-04-05 01:06:39][error] Check Sum 0x60F6 != 0x4492
                                            [ydlidar_node-2] [2025-04-05 01:06:56][error] Check Sum 0x01A6 != 0x2E11
                                            [ydlidar_node-2] [2025-04-05 01:06:56][error] Check Sum 0x6C28 != 0x0F78
                                            [ydlidar_node-2] [2025-04-05 01:07:02][error] Check Sum 0x6450 != 0x6A17
                                            [ydlidar_node-2] [2025-04-05 01:07:03][error] Check Sum 0x7495 != 0x4DBD
                                            [ydlidar_node-2] [2025-04-05 01:07:13][error] Check Sum 0x7516 != 0x71E2
                                            [ydlidar_node-2] [2025-04-05 01:07:22][error] Check Sum 0x1D3E != 0x5AEA

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