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

    nav2导航失败

    已定时 已固定 已锁定 已移动
    Nav2
    navigation2 nav2bringup 导航失败
    3
    5
    519
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • 2
      2523301256
      最后由 编辑

      我在学习navigation2导航模块,跑了三个基本案例(鱼总的案例,nav2官网案例和另外一个案例),都在相同的地方出现了相同的问题:
      地图上可以显示出全局路径,但是机器人根本无法按照全局路径运动。

      我在其他同学的电脑上成功跑通了Navigation官网给出的案例(https://docs.nav2.org/getting_started/index.html#navigating),但是通过相同的步骤,我无法在我自己的电脑上跑通这个案例。

      楼下是报错日志和截图。希望有大佬能帮忙看看是什么问题,我初学ros2,能力有限,感觉确实想不到也查不到原因所在了。感激不尽!

      2 1 条回复 最后回复 回复 引用 0
      • 小伊小
        机器人小伊
        最后由 编辑

        在解决Navigation2(nav2)导航模块的问题时,首先需要确保几个关键的方面被正确配置和初始化。以下是一些可能的原因和排查步骤,帮助你定位并解决问题:

        1. 环境配置检查:

          • 确保你的ROS 2环境安装正确,包括所有依赖的库和包。
          • 检查你的工作空间(workspace)是否包含了所有必要的包,特别是nav2的相关包。
          • 确认你的ROS 2版本与nav2的版本兼容。
        2. 参数配置:

          • 检查amcl(如果使用的是AMCL定位)、move_base等节点的参数配置是否正确。
          • 查看global_costmap和local_costmap的配置,确保它们正确地映射了环境,并且参数如resolution、robot_radius等设置合理。
          • 验证controller配置是否正确,特别是controller_frequency和控制器类型。
        3. 传感器和定位:

          • 确认机器人的传感器(如激光雷达、里程计等)工作正常,并且数据能够正确被ROS 2系统接收。
          • 检查定位系统的输出,确保机器人能够准确地知道自己的位置。
        4. 日志和调试:

          • 仔细查看ROS 2的终端输出和日志文件,查找任何错误或警告信息。
          • 使用rviz2或其他可视化工具检查costmaps、全局路径和局部路径等信息是否正确显示。
          • 可以使用ros2 topic echo命令查看关键主题的实时数据,如/tf、/odom、/map等。
        5. 依赖的服务和节点:

          • 确保所有依赖的节点(如map_server、amcl、move_base等)都已正确启动并运行。
          • 检查网络问题,确保ROS 2的通信没有问题。
        6. 代码和版本问题:

          • 如果你的代码是从某个教程或GitHub仓库复制的,确保你已经更新到最新版本,并且代码适用于你的ROS 2版本。
          • 检查是否有任何代码错误或不一致,特别是关于配置文件的部分。
        7. 硬件问题:

          • 确认机器人硬件(如电机、驱动器、传感器等)没有问题,且连接正常。

        由于你提到在其他电脑上可以成功运行相同的案例,这排除了nav2和ROS 2版本问题的可能性,但可能是你的电脑环境配置或参数设置不同。建议按照上述步骤逐一排查,并特别关注那些可能与你的环境或硬件配置相关的部分。

        如果问题依旧无法解决,可以考虑在ROS 2或nav2的社区论坛发帖求助,或者寻求来自你老师、同学或同事的帮助。在求助时,提供详细的错误日志、配置文件内容和环境信息将有助于他人更快地定位问题。


        以上为生成回答,仅供参考~

        我是小伊,已接入ChatGpt,所有回复,仅供参考~

        1 条回复 最后回复 回复 引用 0
        • 2
          2523301256 @2523301256
          最后由 编辑

          fb62a503-e851-43e4-a61a-548979578269-image.png ```
          code_text

          如图,可以规划出一条全局路径。但是机器人不会沿着全局路径移动,它似乎有自己的想法,但是左转右转发现都没法到达最终目标,然后将停下来了。Navigation里面的feedback变更为aborted,导航终止。
          2 1 条回复 最后回复 回复 引用 0
          • 2
            2523301256 @2523301256
            最后由 编辑

            @2523301256

            [component_container_isolated-6] [ERROR] [1727243470.717021303] [tf_help]: Exception in transformPose: "[]" passed to lookupTransform argument target_frame does not exist. 
            [component_container_isolated-6] [ERROR] [1727243470.717043776] [tf_help]: Exception in transformPose: "[]" passed to lookupTransform argument target_frame does not exist. 
            [component_container_isolated-6] [ERROR] [1727243470.717065966] [tf_help]: Exception in transformPose: "[]" passed to lookupTransform argument target_frame does not exist. 
            [component_container_isolated-6] [ERROR] [1727243470.717087938] [tf_help]: Exception in transformPose: "[]" passed to lookupTransform argument target_frame does not exist. 
            [component_container_isolated-6] [ERROR] [1727243470.717109964] [tf_help]: Exception in transformPose: "[]" passed to lookupTransform argument target_frame does not exist. 
            [component_container_isolated-6] [ERROR] [1727243470.717142400] [tf_help]: Exception in transformPose: "[]" passed to lookupTransform argument target_frame does not exist. 
            [component_container_isolated-6] [ERROR] [1727243470.717166106] [GoalDistCritic]: None of the points of the global plan were in the local costmap.
            [component_container_isolated-6] [WARN] [1727243470.717176031] [DWBLocalPlanner]: A scoring function failed to prepare
            [component_container_isolated-6] [ERROR] [1727243470.717191142] [PathDistCritic]: None of the 64 first of 64 (64) points of the global plan were in the local costmap and free
            [component_container_isolated-6] [WARN] [1727243470.717201592] [DWBLocalPlanner]: A scoring function failed to prepare
            [component_container_isolated-6] [ERROR] [1727243470.717212937] [PathDistCritic]: None of the 64 first of 64 (64) points of the global plan were in the local costmap and free
            [component_container_isolated-6] [WARN] [1727243470.717219613] [DWBLocalPlanner]: A scoring function failed to prepare
            [component_container_isolated-6] [ERROR] [1727243470.717230239] [GoalDistCritic]: None of the points of the global plan were in the local costmap.
            [component_container_isolated-6] [WARN] [1727243470.717236340] [DWBLocalPlanner]: A scoring function failed to prepare
            [component_container_isolated-6] [ERROR] [1727243470.723820118] [DWBLocalPlanner]: No valid trajectories out of 419! 
            [component_container_isolated-6] [ERROR] [1727243470.723860851] [DWBLocalPlanner]: 0.59: BaseObstacle/Trajectory Hits Obstacle.
            [component_container_isolated-6] [ERROR] [1727243470.723876028] [DWBLocalPlanner]: 0.41:   PathDist/Trajectory Hits Unreachable Area.
            [component_container_isolated-6] [WARN] [1727243470.724106227] [controller_server]: No valid trajectories out of 419! 
            [component_container_isolated-6] [ERROR] [1727243470.724164787] [controller_server]: Controller patience exceeded
            [component_container_isolated-6] [WARN] [1727243470.724237343] [controller_server]: [follow_path] [ActionServer] Aborting handle.
            [component_container_isolated-6] [ERROR] [1727243470.752611675] [bt_navigator]: Goal failed
            

            这是部分报错日志。
            其中target_frame does not exist大篇幅出现
            随后就是None of the points of the global plan were in the local costmap

            这两个错误会循环交替好几次,最后导航失败,显示aborting handle,goal failed

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

              @2523301256 在 nav2导航失败 中说:

              _help]: Exception in transformPose: "[]" passed to lookupTransform argument target_frame does not exi

              tf 看看,大概率有问题

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

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