ROS Navigation-----global_planner简介

本文介绍了一个灵活的全局路径规划器global_planner,它为导航提供了快速且高效的解决方案。该规划器继承自nav_core::BaseGlobalPlanner接口,并通过不同的参数化实例展示了其多样化的应用场景,包括标准行为、珊格路径、简单势能计算、A*路径及旧式Navfn行为等。

    global_planner是一个路径规划器node。

1 概述

   这个package为导航提供了一种快速,内插值的全局规划器, 继承了nav_core包中nav_core::BaseGlobalPlanner接口,该实现相比navfn使用更加灵活。

2 不同参数化实例

2.1 标准行为示例

所有参数使用缺省值:GlobalPlanner.png

2.1 珊格路径示例

use_grid_path=True GridPath.pngPath follows the grid boundaries.

2.3 Simple Potential Calculation

use_quadratic=FalseNonquad.pngSlightly different calculation for the potential. Note that the original potential calculation fromnavfn is a quadratic approximation. Of what, the maintainer of this package has no idea.

2.4 A* Path

use_dijkstra=False AStar.png


Note that a lot less of the potential has been calculated (indicated by the colored areas). This is indeed faster than using Dijkstra's, but has the effect of not necessarily producing the same paths. Another thing to note is that in this implementation of A*, the potentials are computed using 4-connected grid squares, while the path found by tracing the potential gradient from the goal back to the start uses the same grid in an 8-connected fashion. Thus, the actual path found may not be fully optimal in an 8-connected sense. (Also, no visited-state set is tracked while computing potentials, as in a more typical A* implementation, because such is unnecessary for 4-connected grids). To see the differences between the behavior of Dijkstra's and the behavior of A*, consider the following example.

2.4.1 Dijkstra's

Dijkstra.png==== A* ===== AStar2.png

2.5 旧式Navfn行为示例

old_navfn_behavior=TrueFor reproducing paths just like NavFn did. OldNavFn.png

Note:

  • The start of the path does not match the actual start location.
  • The very end of the path moves along grid lines.
  • All of the coordinates are slightly shifted by half a grid cell

===

3 ROS API

3.1 Published Topics
~<name>/plan ( nav_msgs/Path)
  • 这里指的是上一次计算,发布的规划,每次规划器会计算一条新路径。 主要用于可视化的目的。
3.2 Parameters
~<name>/allow_unknown ( bool, default: true)
  • 指定是否允许规划器在unknown空间创建规划。 NOTE: if you are using a layered costmap_2d costmap witha voxel or obstacle layer, you must also set the track_unknown_space param for that layer to be true, or it will convert all your unknown space to free space (which planner will then happily go right through).
~<name>/default_tolerance ( double, default: 0.0)
  • 规划器目标点公差范围。 The planner will attempt to create a plan that is as close to the specified goal as possible but no further thandefault_tolerance away.
~<name>/visualize_potential ( bool, default: false)
  • 指定是否可视化PointCloud2计算的潜在区域
~<name>/use_dijkstra ( bool, default: true)
  • If true, use dijkstra's algorithm. Otherwise, A*.
~<name>/use_quadratic ( bool, default: true)
  • If true, use the quadratic approximation of the potential. Otherwise, use a simpler calculation.
~<name>/use_grid_path ( bool, default: false)
  • If true, create a path that follows the grid boundaries. Otherwise, use a gradient descent method.
~<name>/old_navfn_behavior ( bool, default: false) If for some reason, you want global_planner to exactly mirror the behavior of navfn, set this to true (and use the defaults for the other boolean parameters)
shr@ubuntu:~$ sudo apt install ros-noetic-navigation 正在读取软件包列表... 完成 正在分析软件包的依赖关系树 正在读取状态信息... 完成 将会同时安装下列软件: ros-noetic-amcl ros-noetic-base-local-planner ros-noetic-carrot-planner ros-noetic-clear-costmap-recovery ros-noetic-costmap-2d ros-noetic-dwa-local-planner ros-noetic-fake-localization ros-noetic-global-planner ros-noetic-move-base ros-noetic-move-base-msgs ros-noetic-move-slow-and-clear ros-noetic-nav-core ros-noetic-navfn ros-noetic-rotate-recovery ros-noetic-voxel-grid 下列【新】软件包将被安装: ros-noetic-amcl ros-noetic-base-local-planner ros-noetic-carrot-planner ros-noetic-clear-costmap-recovery ros-noetic-costmap-2d ros-noetic-dwa-local-planner ros-noetic-fake-localization ros-noetic-global-planner ros-noetic-move-base ros-noetic-move-base-msgs ros-noetic-move-slow-and-clear ros-noetic-nav-core ros-noetic-navfn ros-noetic-navigation ros-noetic-rotate-recovery ros-noetic-voxel-grid 升级了 0 个软件包,新安装了 16 个软件包,要卸载 0 个软件包,有 64 个软件包未被升级。 需要下载 1,931 kB 的归档。 解压缩后会消耗 9,841 kB 的额外空间。 您希望继续执行吗? [Y/n] y 获取:1 http://packages.ros.org/ros/ubuntu focal/main amd64 ros-noetic-amcl amd64 1.17.3-1focal.20250521.001518 [268 kB] 获取:2 http://packages.ros.org/ros/ubuntu focal/main amd64 ros-noetic-voxel-grid amd64 1.17.3-1focal.20250519.231756 [16.7 kB] 获取:3 http://packages.ros.org/ros/ubuntu focal/main amd64 ros-noetic-costmap-2d amd64 1.17.3-1focal.20250521.001646 [449 kB] 获取:4 http://packages.ros.org/ros/ubuntu focal/main amd64 ros-noetic-nav-core amd64 1.17.3-1focal.20250521.004844 [8,784 B] 获取:5 http://packages.ros.org/ros/ubuntu focal/main amd64 ros-noetic-base-local-planner amd64 1.17.3-1focal.20250521.005206 [243 kB] 获取:6 http://packages.ros.org/ros/ubuntu focal/main amd64 ros-noetic-carrot-planner amd64 1.17.3-1focal.20250521.010103 [35.6 kB] 获取:7 http://packages.ros.org/ros/ubuntu focal/main amd64 ros-noetic-clear-costmap-recovery amd64 1.17.3-1focal.20250521.005210 [42.4 kB] 获取:8 http://packages.ros.org/ros/ubuntu focal/main amd64 ros-noetic-dwa-local-planner amd64 1.17.3-1focal.20250521.005823 [123 kB] 获取:9 http://packages.ros.org/ros/ubuntu focal/main amd64 ros-noetic-fake-localization amd64 1.17.3-1focal.20250520.001758 [104 kB] 获取:10 http://packages.ros.org/ros/ubuntu focal/main amd64 ros-noetic-navfn amd64 1.17.3-1focal.20250521.005304 [122 kB] 获取:11 http://packages.ros.org/ros/ubuntu focal/main amd64 ros-noetic-global-planner amd64 1.17.3-1focal.20250521.005728 [145 kB] 获取:12 http://packages.ros.org/ros/ubuntu focal/main amd64 ros-noetic-move-base-msgs amd64 1.14.2-1focal.20250516.000952 [32.9 kB] 获取:13 http://packages.ros.org/ros/ubuntu focal/main amd64 ros-noetic-rotate-recovery amd64 1.17.3-1focal.20250521.010109 [39.4 kB] 获取:14 http://packages.ros.org/ros/ubuntu focal/main amd64 ros-noetic-move-base amd64 1.17.3-1focal.20250521.010519 [249 kB] 获取:15 http://packages.ros.org/ros/ubuntu focal/main amd64 ros-noetic-move-slow-and-clear amd64 1.17.3-1focal.20250521.005242 [49.3 kB] 获取:16 http://packages.ros.org/ros/ubuntu focal/main amd64 ros-noetic-navigation amd64 1.17.3-1focal.20250521.011054 [3,064 B] 已下载 1,931 kB,耗时 50秒 (38.6 kB/s) 正在选中未选择的软件包 ros-noetic-amcl。 (正在读取数据库 ... 系统当前共安装有 250290 个文件和目录。) 准备解压 .../00-ros-noetic-amcl_1.17.3-1focal.20250521.001518_amd64.deb ... 正在解压 ros-noetic-amcl (1.17.3-1focal.20250521.001518) ... 正在选中未选择的软件包 ros-noetic-voxel-grid。 准备解压 .../01-ros-noetic-voxel-grid_1.17.3-1focal.20250519.231756_amd64.deb . .. 正在解压 ros-noetic-voxel-grid (1.17.3-1focal.20250519.231756) ... 正在选中未选择的软件包 ros-noetic-costmap-2d。 准备解压 .../02-ros-noetic-costmap-2d_1.17.3-1focal.20250521.001646_amd64.deb . .. 正在解压 ros-noetic-costmap-2d (1.17.3-1focal.20250521.001646) ... 正在选中未选择的软件包 ros-noetic-nav-core。 准备解压 .../03-ros-noetic-nav-core_1.17.3-1focal.20250521.004844_amd64.deb ... 正在解压 ros-noetic-nav-core (1.17.3-1focal.20250521.004844) ... 正在选中未选择的软件包 ros-noetic-base-local-planner。 准备解压 .../04-ros-noetic-base-local-planner_1.17.3-1focal.20250521.005206_amd6 4.deb ... 正在解压 ros-noetic-base-local-planner (1.17.3-1focal.20250521.005206) ... 正在选中未选择的软件包 ros-noetic-carrot-planner。 准备解压 .../05-ros-noetic-carrot-planner_1.17.3-1focal.20250521.010103_amd64.de b ... 正在解压 ros-noetic-carrot-planner (1.17.3-1focal.20250521.010103) ... 正在选中未选择的软件包 ros-noetic-clear-costmap-recovery。 准备解压 .../06-ros-noetic-clear-costmap-recovery_1.17.3-1focal.20250521.005210_ amd64.deb ... 正在解压 ros-noetic-clear-costmap-recovery (1.17.3-1focal.20250521.005210) ... 正在选中未选择的软件包 ros-noetic-dwa-local-planner。 准备解压 .../07-ros-noetic-dwa-local-planner_1.17.3-1focal.20250521.005823_amd64 .deb ... 正在解压 ros-noetic-dwa-local-planner (1.17.3-1focal.20250521.005823) ... 正在选中未选择的软件包 ros-noetic-fake-localization。 准备解压 .../08-ros-noetic-fake-localization_1.17.3-1focal.20250520.001758_amd64 .deb ... 正在解压 ros-noetic-fake-localization (1.17.3-1focal.20250520.001758) ... 正在选中未选择的软件包 ros-noetic-navfn。 准备解压 .../09-ros-noetic-navfn_1.17.3-1focal.20250521.005304_amd64.deb ... 正在解压 ros-noetic-navfn (1.17.3-1focal.20250521.005304) ... 正在选中未选择的软件包 ros-noetic-global-planner。 准备解压 .../10-ros-noetic-global-planner_1.17.3-1focal.20250521.005728_amd64.de b ... 正在解压 ros-noetic-global-planner (1.17.3-1focal.20250521.005728) ... 正在选中未选择的软件包 ros-noetic-move-base-msgs。 准备解压 .../11-ros-noetic-move-base-msgs_1.14.2-1focal.20250516.000952_amd64.de b ... 正在解压 ros-noetic-move-base-msgs (1.14.2-1focal.20250516.000952) ... 正在选中未选择的软件包 ros-noetic-rotate-recovery。 准备解压 .../12-ros-noetic-rotate-recovery_1.17.3-1focal.20250521.010109_amd64.d eb ... 正在解压 ros-noetic-rotate-recovery (1.17.3-1focal.20250521.010109) ... 正在选中未选择的软件包 ros-noetic-move-base。 准备解压 .../13-ros-noetic-move-base_1.17.3-1focal.20250521.010519_amd64.deb .. . 正在解压 ros-noetic-move-base (1.17.3-1focal.20250521.010519) ... 正在选中未选择的软件包 ros-noetic-move-slow-and-clear。 准备解压 .../14-ros-noetic-move-slow-and-clear_1.17.3-1focal.20250521.005242_amd 64.deb ... 正在解压 ros-noetic-move-slow-and-clear (1.17.3-1focal.20250521.005242) ... 正在选中未选择的软件包 ros-noetic-navigation。 准备解压 .../15-ros-noetic-navigation_1.17.3-1focal.20250521.011054_amd64.deb . .. 正在解压 ros-noetic-navigation (1.17.3-1focal.20250521.011054) ... 正在设置 ros-noetic-amcl (1.17.3-1focal.20250521.001518) ... 正在设置 ros-noetic-voxel-grid (1.17.3-1focal.20250519.231756) ... 正在设置 ros-noetic-move-base-msgs (1.14.2-1focal.20250516.000952) ... 正在设置 ros-noetic-costmap-2d (1.17.3-1focal.20250521.001646) ... 正在设置 ros-noetic-fake-localization (1.17.3-1focal.20250520.001758) ... 正在设置 ros-noetic-nav-core (1.17.3-1focal.20250521.004844) ... 正在设置 ros-noetic-clear-costmap-recovery (1.17.3-1focal.20250521.005210) ... 正在设置 ros-noetic-move-slow-and-clear (1.17.3-1focal.20250521.005242) ... 正在设置 ros-noetic-rotate-recovery (1.17.3-1focal.20250521.010109) ... 正在设置 ros-noetic-navfn (1.17.3-1focal.20250521.005304) ... 正在设置 ros-noetic-base-local-planner (1.17.3-1focal.20250521.005206) ... 正在设置 ros-noetic-carrot-planner (1.17.3-1focal.20250521.010103) ... 正在设置 ros-noetic-move-base (1.17.3-1focal.20250521.010519) ... 正在设置 ros-noetic-global-planner (1.17.3-1focal.20250521.005728) ... 正在设置 ros-noetic-dwa-local-planner (1.17.3-1focal.20250521.005823) ... 正在设置 ros-noetic-navigation (1.17.3-1focal.20250521.011054) ... shr@ubuntu:~$ rospack find gmapping /opt/ros/noetic/share/gmapping shr@ubuntu:~$ rospack find map_server /opt/ros/noetic/share/map_server shr@ubuntu:~$ rospack find navigation [rospack] Error: package 'navigation' not found shr@ubuntu:~$ rospack find navigation [rospack] Error: package 'navigation' not found shr@ubuntu:~$
07-29
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值