ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

how to clear local cost map?

asked 2017-12-28 01:53:01 -0500

wings0728 gravatar image

I use sonar-layer in my local cost map, but I cant clear the layer.

  global_frame: /odom
  robot_base_frame: /base_footprint
  update_frequency: 10.0
  publish_frequency: 0.5
  static_map: false
  rolling_window: true
  width: 3.5
  height: 3.5
  resolution: 0.05
  transform_tolerance: 1.0

    - {name: static_map,      type: "costmap_2d::StaticLayer"}
#- {name: obstacles,       type: "costmap_2d::ObstacleLayer"}
    - {name: sonar,           type: "range_sensor_layer::RangeSensorLayer"}
    - {name: inflation_layer, type: "costmap_2d::InflationLayer"}
    topics: ['/sonar_0', '/sonar_1','/sonar_2', '/sonar_3', '/sonar_4', '/sonar_6', '/sonar_7', '/sonar_8', '/sonar_9', '/sonar_10', '/sonar_11']  
    no_readings_timeout: 0.0
    clear_threshold: 0.0
    inflation_radius: 0.10

when obstacle , sonar-layer cant clear the obstacle. My robot cant move.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-03-08 00:18:36 -0500

did you try

rosservice call /move_base/clear_costmaps "{}" ?

edit flag offensive delete link more



Hi, does this clear both costmaps? Or only the local costmap? I think even if it clears both, the global costmap upon reinflation would be identical to previous one, so effectively only the local costmap would be reset. Do you think this is true?

parzival gravatar image parzival  ( 2021-04-06 03:22:25 -0500 )edit

Question Tools

1 follower


Asked: 2017-12-28 01:53:01 -0500

Seen: 3,658 times

Last updated: Mar 08 '18