当前位置: 首页 > news >正文

Smac Planner与 NavFn Planner 的对比分析

Smac Planner与 NavFn Planner 的详细对比分析

  • 算法基础对比
    • NavFn Planner
    • Smac Planner 家族
  • 三种 Smac Planner 的详细对比
    • SmacPlanner2D (2D A*)
      • 优缺点
    • SmacPlannerHybrid (混合A*)
      • 优缺点
    • SmacPlannerLattice (状态格规划器)
      • 优缺点
  • 与 NavFn 的详细区别
    • 路径质量
    • 性能表现
    • 适用场景
  • 实际应用建议
    • 选择指南
    • 规划器调用
      • NavFn Planner
      • Smac 2D Planner
      • Smac Hybrid-A* Planner
      • Smac State Lattice Planner
    • 迁移注意事项
  • 总结
    • Smac Planner 相比 NavFn Planner 的主要优势:
    • NavFn 的适用场景:

参考链接:https://docs.nav2.org/index.html#

算法基础对比

NavFn Planner

  • 算法类型:基于Dijkstra算法的梯度下降法
  • 核心原理:构建代价势场,通过梯度下降找到最小代价路径
  • 搜索维度:纯2D网格搜索
  • 运动约束:不考虑机器人运动学约束

Smac Planner 家族

  • 算法基础:优化的模板化A*搜索算法
  • 搜索策略:启发式搜索 + 运动学约束
  • 三个变体:
    • SmacPlanner2D:传统2D A*的优化版本
    • SmacPlannerHybrid:混合A*,支持阿克曼模型
    • SmacPlannerLattice:状态格规划,支持任意机器人模型

三种 Smac Planner 的详细对比

SmacPlanner2D (2D A*)

优缺点

优点- 计算效率高:优化的A*实现,性能接近NavFn - 路径质量好:支持路径平滑和成本感知 - 通用性强:适合大多数差速驱动机器人- 配置简单:参数相对较少,易于调优缺点
- 无运动学约束:不考虑机器人转向半径等限制
- 路径可能不连续:生成的路径可能需要后处理平滑

SmacPlannerHybrid (混合A*)

优缺点

优点- 运动学可行:考虑阿克曼转向等运动约束 - 支持换向:允许倒车操作 - 适合汽车模型:专为类似汽车的机器人设计 - 路径平滑:生成的路径天然平滑缺点- 计算复杂度较高:搜索空间包含姿态(x,y,θ) - 参数配置复杂:需要调整运动学相关参数 - 内存占用较大:需要维护3D状态空间

SmacPlannerLattice (状态格规划器)

优缺点

优点- 最高灵活性:支持任意机器人形状和运动模型 - 控制感知:基于实际控制输入生成路径 - 高质量路径:路径既平滑又符合运动学- 可扩展性强:支持自定义控制集缺点
- 计算成本最高:状态空间维度最大
- 配置最复杂:需要定义控制集和运动模型
- 实时性挑战:在复杂环境中可能较慢

与 NavFn 的详细区别

路径质量

特性NavFn PlannerSmac Planner
运动学可行性❌ 不考虑✅ 支持(混合A*和状态格)
路径平滑度⚠️ 需要后处理✅ 内置平滑
连续性⚠️ 可能出现不连续✅ 连续平滑
成本感知✅ 良好✅ 优秀(可配置成本权重)

性能表现

指标NavFn PlannerSmac Planner
计算速度146ms(参考)113-243ms(更快)
内存效率✅ 较好⚠️ 中等(状态格较高)
实时性✅ 良好✅ 优秀(优化算法)
大规模地图✅ 适合✅ 更适合(优化启发式)

适用场景

场景推荐规划器理由
差速驱动机器人SmacPlanner2D性能优于NavFn,路径质量更好
阿克曼车辆SmacPlannerHybrid唯一支持运动学约束的选择
复杂形状机器人SmacPlannerLattice支持任意形状和运动模型
简单2D导航NavFn成熟稳定,配置简单
高动态环境Smac 系列更快重规划能力

实际应用建议

选择指南

  1. 差速驱动机器人 → 优先选择 SmacPlanner2D
    • 性能提升明显,路径质量更好
    • 从 NavFn 迁移成本低

  2. 汽车式机器人 → 必须选择 SmacPlannerHybrid
    • 唯一可行的运动学感知规划器
    • 支持倒车和复杂机动

  3. 特殊机器人 → 考虑 SmacPlannerLattice
    • 腿式机器人、全向移动平台等
    • 需要高度定制化控制

  4. 传统系统维护 → 可继续使用 NavFn
    • 系统稳定,无需重大修改
    • 简单场景下足够使用

规划器调用

注意: yaml 中的小数写法不要使用1e-10这种写法,会有报错,SmacPlannerLattice 我没跑通

NavFn Planner

planner_server:ros__parameters:planner_plugins: ['GridBased']GridBased:plugin: 'nav2_navfn_planner/NavfnPlanner'use_astar: Trueallow_unknown: Truetolerance: 1.0

Smac 2D Planner

planner_server:ros__parameters:planner_plugins: ["GridBased"]use_sim_time: TrueGridBased:plugin: "nav2_smac_planner/SmacPlanner2D"tolerance: 0.125                      # tolerance for planning if unable to reach exact pose, in metersdownsample_costmap: false             # whether or not to downsample the mapdownsampling_factor: 1                # multiplier for the resolution of the costmap layer (e.g. 2 on a 5cm costmap would be 10cm)allow_unknown: true                   # allow traveling in unknown spacemax_iterations: 1000000               # maximum total iterations to search for before failing (in case unreachable), set to -1 to disablemax_on_approach_iterations: 1000      # maximum number of iterations to attempt to reach goal once in tolerancemax_planning_time: 2.0                # max time in s for planner to plan, smoothmotion_model_for_search: "MOORE"      # 2D Moore, Von Neumanncost_travel_multiplier: 2.0           # Cost multiplier to apply to search to steer away from high cost areas. Larger values will place in the center of aisles more exactly (if non-`FREE` cost potential field exists) but take slightly longer to compute. To optimize for speed, a value of 1.0 is reasonable. A reasonable tradeoff value is 2.0. A value of 0.0 effective disables steering away from obstacles and acts like a naive binary search A*.use_final_approach_orientation: false # Whether to set the final path pose at the goal's orientation to the requested orientation (false) or in line with the approach angle so the robot doesn't rotate to heading (true)smoother:max_iterations: 1000w_smooth: 0.3w_data: 0.2tolerance: 0.000000001 #1e-10

Smac Hybrid-A* Planner

planner_server:ros__parameters:planner_plugins: ["GridBased"]use_sim_time: TrueGridBased:plugin: "nav2_smac_planner/SmacPlannerHybrid"downsample_costmap: false           # whether or not to downsample the mapdownsampling_factor: 1              # multiplier for the resolution of the costmap layer (e.g. 2 on a 5cm costmap would be 10cm)allow_unknown: true                 # allow traveling in unknown spacemax_iterations: 1000000             # maximum total iterations to search for before failing (in case unreachable), set to -1 to disablemax_planning_time: 5.0              # max time in s for planner to plan, smoothmotion_model_for_search: "DUBIN"    # Hybrid-A* Dubin, Redds-Sheppangle_quantization_bins: 72         # Number of angle bins for searchanalytic_expansion_ratio: 3.5       # The ratio to attempt analytic expansions during search for final approach.analytic_expansion_max_length: 3.0  # For Hybrid/Lattice nodes: The maximum length of the analytic expansion to be considered valid to prevent unsafe shortcuttingminimum_turning_radius: 0.40        # minimum turning radius in m of path / vehiclereverse_penalty: 2.0                # Penalty to apply if motion is reversing, must be => 1change_penalty: 0.0                 # Penalty to apply if motion is changing directions (L to R), must be >= 0non_straight_penalty: 1.2           # Penalty to apply if motion is non-straight, must be => 1cost_penalty: 2.0                   # Penalty to apply to higher cost areas when adding into the obstacle map dynamic programming distance expansion heuristic. This drives the robot more towards the center of passages. A value between 1.3 - 3.5 is reasonable.retrospective_penalty: 0.015lookup_table_size: 20.0             # Size of the dubin/reeds-sheep distance window to cache, in meters.cache_obstacle_heuristic: false     # Cache the obstacle map dynamic programming distance expansion heuristic between subsiquent replannings of the same goal location. Dramatically speeds up replanning performance (40x) if costmap is largely static.smooth_path: True                   # If true, does a simple and quick smoothing post-processing to the pathsmoother:max_iterations: 1000w_smooth: 0.3w_data: 0.2tolerance: 0.000000001 #1e-10do_refinement: true

Smac State Lattice Planner

planner_server:ros__parameters:planner_plugins: ["GridBased"]use_sim_time: TrueGridBased:plugin: "nav2_smac_planner/SmacPlannerLattice"allow_unknown: true                 # Allow traveling in unknown spacemax_iterations: 1000000             # Maximum total iterations to search for before failing (in case unreachable), set to -1 to disablemax_planning_time: 5.0              # Max time in s for planner to plan, smoothanalytic_expansion_ratio: 3.5       # The ratio to attempt analytic expansions during search for final approach.analytic_expansion_max_length: 3.0  # For Hybrid/Lattice nodes: The maximum length of the analytic expansion to be considered valid to prevent unsafe shortcuttingreverse_penalty: 2.0                # Penalty to apply if motion is reversing, must be => 1change_penalty: 0.05                # Penalty to apply if motion is changing directions (L to R), must be >= 0non_straight_penalty: 1.05          # Penalty to apply if motion is non-straight, must be => 1cost_penalty: 2.0                   # Penalty to apply to higher cost areas when adding into the obstacle map dynamic programming distance expansion heuristic. This drives the robot more towards the center of passages. A value between 1.3 - 3.5 is reasonable.rotation_penalty: 5.0               # Penalty to apply to in-place rotations, if minimum control set contains themretrospective_penalty: 0.015lattice_filepath: ""                # The filepath to the state lattice graphlookup_table_size: 20.0             # Size of the dubin/reeds-sheep distance window to cache, in meters.cache_obstacle_heuristic: false     # Cache the obstacle map dynamic programming distance expansion heuristic between subsiquent replannings of the same goal location. Dramatically speeds up replanning performance (40x) if costmap is largely static.allow_reverse_expansion: false      # If true, allows the robot to use the primitives to expand in the mirrored opposite direction of the current robot's orientation (to reverse).smooth_path: True                   # If true, does a simple and quick smoothing post-processing to the pathsmoother:max_iterations: 1000w_smooth: 0.3w_data: 0.2tolerance: 0.000000001 #1e-10do_refinement: true

迁移注意事项

  1. 参数调整:Smac Planner 参数更丰富,需要仔细调优
  2. 性能测试:在实际环境中进行充分测试
  3. 回退方案:保留 NavFn Planner 作为备选方案
  4. 监控指标:关注规划时间、路径质量、成功率等关键指标

总结

Smac Planner 相比 NavFn Planner 的主要优势:

  • 算法更现代:基于优化的A*算法,性能更好
  • 功能更丰富:支持运动学约束、路径平滑等
  • 适用性更广:覆盖从简单差速到复杂阿克曼的各种机器人
  • 路径质量更高:内置平滑,路径更自然可行

NavFn 的适用场景:

  • 现有系统稳定运行,无需升级
  • 简单差速机器人,对路径质量要求不高
  • 计算资源极其有限的环境

推荐策略:新项目优先选择 Smac Planner,现有项目根据实际需求评估迁移价值。

http://www.dtcms.com/a/454465.html

相关文章:

  • 傅里叶变换·思考
  • 南部县网站建设怎样建单位的网站
  • 虹桥做网站WordPress的主题制作教程
  • 太仓高端网站制作甘肃省建设银行校园招聘网站
  • 人力资源网站建设方案安装wordpress中文包
  • 江苏省建设厅网站建造师强制注销有哪些网站的搜索引擎
  • wordpress 多语言网站网站配图尺寸
  • 站长工具在线免费观看网络营销推广网站
  • tdk标签影响网站权重广州现在算什么风险地区
  • AssemblyScript 入门教程(9):直接内存管理
  • 新的南宁网站建设公司WordPress中文空格
  • 手机网站设计小程序wordpress用什么系统
  • STIP开源股票技术指标回测分析平台产品深度分析
  • 什么网站可以接室内设计做建设人力资源网
  • 图文详解Transformer模型——解码器输入(shifted input)详解
  • 网站推广方案策划书2000杭州g20网站建设公司
  • 网站导航栏图标js 访问wordpress
  • 品牌宣传网站建设网站开发软件和工具ide和编辑器
  • 自创网站怎么赚钱自己制作网站该怎么做
  • 怎么做网站导航栏哈尔滨网站建设报价价格
  • 没有显卡,浏览器如何免费调用本地大模型智能体
  • 阿里云电影网站建设教程丹阳网站建设机构
  • 关于Verilog和FPGA的自学笔记1
  • 网站怎么做ipfs郴州 网站建设
  • Linux 串口 dmesg lsusb
  • 哈尔滨网站建设赚钱么青岛手机网站建设电话
  • 益阳高端网站建设企业信息系统案例
  • 北京公司网站优化新吴区推荐做网站价格
  • 网站优化排名875网站建设怎么样
  • 第二章 预备知识(数据操作、数据预处理)