costmap 用layer的设置方法

本文详细解析了ROS中Costmap的配置文件,包括全局和局部成本地图的设置,重点介绍了不同插件的作用及其配置参数,如StaticLayer、VoxelLayer、InflationLayer和RangeSensorLayer等,对于理解机器人路径规划中的障碍物检测与规避具有重要意义。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

plugins:
  - {name: static_layer, type: "costmap_2d::StaticLayer"}
  - {name: obstacle_layer, type: "costmap_2d::VoxelLayer"}
  - {name: inflation_layer, type: "costmap_2d::InflationLayer"}
  - {name: sonar_layer,   type: "range_sensor_layer::RangeSensorLayer"}

  #Configuration for the sensors that the costmap will use to update a map
  obstacle_layer:
    observation_sources: base_scan
    base_scan: {data_type: LaserScan, sensor_frame: /base_laser_link, topic: /base_scan, expected_update_rate: 0.4,
      observation_persistence: 0.0, marking: true, clearing: true, max_obstacle_height: 0.4, min_obstacle_height: 0.08}

  sonar_layer:
    topics: ["/sonar"]
    no_readings_timeout: 1.0

上面是global 下面是local 

plugins:
  - {name: obstacle_layer, type: "costmap_2d::VoxelLayer"}
  - {name: sonar_layer,   type: "range_sensor_layer::RangeSensorLayer"}
  - {name: inflation_layer, type: "costmap_2d::InflationLayer"}

  #Configuration for the sensors that the costmap will use to update a map   
  obstacle_layer:
    observation_sources: base_scan
    base_scan: {data_type: LaserScan, sensor_frame: /base_laser_link, topic: /base_scan, expected_update_rate: 0.4,
      observation_persistence: 0.0, marking: true, clearing: true, max_obstacle_height: 0.4, min_obstacle_height: 0.08}

  sonar_layer:
    topics: ["/sonar"]
    no_readings_timeout: 1.0

  

(Actually only wanted to comment, but that always disappears..)

Did you check your configuration with rosparam? It is not clear for me from your paste, because in local_costmap_params.yaml the sonar_layer is in the obstacle_layer namespace, in global_costmap_params.yaml it is not


move the sonar_layer before the inflation layer.

这个plugin的先后顺序还有影响的啊。。

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值