costmap 用layer的设置方法

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的先后顺序还有影响的啊。。

猜你喜欢

转载自blog.csdn.net/fly1ng_duck/article/details/83106123
今日推荐