teb教程6

代价地图的转换

简介:本部分关于怎样把代价地图转换插件应用到转换占据栅格costmap2d到几何形状来优化(测试阶段)

teb_local_planner包支持costmap_converter插件,这些插件将占据栅格costmap_2d转换为几何形状的障碍物。

默认情况下,占据栅格为点装的障碍物。如果地图分辨率很高,则就需要大量的计算,这可能会在计算拓扑结构中系统不稳定性(取决于障碍物的数量)。另一方面,障碍的转换也需要花费时间。然而,转换时间非常依赖于选择的算法,可以在分开的线程执行。就目前而言,代价地图的转换是实验阶段,就有效性和导航质量的最好配置而言在将来决定。

通过设置参数costmap_converter_plugin插件来激活,可以通过下面代码查看可用的插件:

rospack plugins --attrib=plugin costmap_converter

也可以指定参数costmap_converter_spin_thread以及costmap_converter_rate。

必须在启动代码之前加载插件。障碍物的可视化使用teb_markers。

1.例子参数文件

以下文件costmap_converter_params.yaml描述了怎样设置参数根据机器人导航配置里面;

复制代码
TebLocalPlannerROS:

  ## Costmap converter plugin   
  costmap_converter_plugin: "costmap_converter::CostmapToPolygonsDBSMCCH"
  #costmap_converter_plugin: "costmap_converter::CostmapToLinesDBSRANSAC"
  #costmap_converter_plugin: "costmap_converter::CostmapToLinesDBSMCCH"
  #costmap_converter_plugin: "costmap_converter::CostmapToPolygonsDBSConcaveHull"
  #costmap_converter_plugin: "" # deactivate plugin
  costmap_converter_spin_thread: True
  costmap_converter_rate: 5
 
 
  ## Configure plugins (namespace move_base/TebLocalPlannerROS/PLUGINNAME)
  ## The parameters must be added for each plugin separately
  costmap_converter/CostmapToLinesDBSRANSAC:
    cluster_max_distance: 0.4
    cluster_min_pts: 2
    ransac_inlier_distance: 0.15
    ransac_min_inliers: 10
    ransac_no_iterations: 2000
    ransac_remainig_outliers: 3
    ransac_convert_outlier_pts: True
    ransac_filter_remaining_outlier_pts: False
    convex_hull_min_pt_separation: 0.1
View Code
复制代码

现在可以把参数加载到move base空间。将上面文件加载到导航launch文件里面

复制代码
<node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">

    <!-- Load all costmap_2d and planner parameters here -->

    <param name="base_local_planner" value="teb_local_planner/TebLocalPlannerROS" />


    <!-- LOAD COSTMAP_CONVERTER PARAMETERS HERE -->
    <rosparam file="$(find my_robot_name_2dnav)/costmap_converter_params.yaml" command="load" />

</node>
复制代码

2.完整例子

复制代码
You can find an example setup with the stage simulator in the teb_local_planner_tutorials package.

    Install the teb_local_planner_tutorials package
    Inspect the parameter/config files

    Launch the diff_drive setup: roslaunch teb_local_planner_tutorials robot_diff_drive_in_stage_costmap_conversion.launch

    Modify parameters using rosrun rqt_reconfigure rqt_reconfigure or by adapting the files.

    Switch different costmap conversion algorithms in costmap_converter_params.yaml
View Code
复制代码

 

posted on   gary_123  阅读(854)  评论(0编辑  收藏  举报

编辑推荐:
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
阅读排行:
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 提示词工程——AI应用必不可少的技术
· .NET周刊【3月第1期 2025-03-02】
历史上的今天:
2016-05-20 1、wei-d-s嵌入式与PC区别,LED等的点亮以及调用C函数
2016-05-20 NAND FLASH和LCD电路图

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示