cannot clear obstacles in costmap
I am quite a beginner in ros, and when I used the turtlebot to test the ros nav stack, the bot often stucked though some recovery behaviors(the default behaviors of ros nav stack) were operated, and the error is "Aborting because a valid plan could not be found. Even after executing all recovery behaviors". It seemed that there were lots of obstales around the turtlebot in the costmap of rviz, but in fact it was not the case. The costmap cannot clear the old or sudden obstacles(like people walking by). I have tried to change some parameters(such as the robot radius), but it didn't work. Also I have tried to call the ~clear_costmaps services, and still made no sense. So if anybody can tell me what should i do to solve the problem, and how can I improve the performance of ros nav stack?Thanks
Update the costmap_common_params.yaml
max_obstacle_height: 0.60 # assume something like an arm is mounted on top of the robot
robot_radius: 0.26 # distance a circular robot should be clear of the obstacle (kobuki: 0.18)
map_type: voxel
obstacle_layer:
enabled: true
max_obstacle_height: 0.6
origin_z: 0.0
z_resolution: 0.2
z_voxels: 2
unknown_threshold: 15
mark_threshold: 0
combination_method: 1
track_unknown_space: true
obstacle_range: 2.5
raytrace_range: 3.0
origin_z: 0.0
z_resolution: 0.2
z_voxels: 2
publish_voxel_map: false
observation_sources: scan bump
scan:
data_type: LaserScan
topic: scan
marking: true
clearing: true
min_obstacle_height: 0.05
max_obstacle_height: 0.45
bump:
data_type: PointCloud2
topic: mobile_base/sensors/bumper_pointcloud
marking: true
clearing: false
min_obstacle_height: 0.0
max_obstacle_height: 0.35
inflation_layer:
enabled: true
cost_scaling_factor: 10.0 # exponential rate at which the obstacle cost drops off (default: 10)
inflation_radius: 0.28 # max. distance from an obstacle at which costs are incurred for planning paths.
static_layer:
enabled: true
Update the global_costmap_params.yaml
global_costmap:
global_frame: /map
robot_base_frame: /base_footprint
update_frequency: 1.0
publish_frequency: 0.5
static_map: true
transform_tolerance: 0.5
plugins:
- {name: static_layer, type: "costmap_2d::StaticLayer"}
- {name: obstacle_layer, type: "costmap_2d::VoxelLayer"}
- {name: inflation_layer, type: "costmap_2d::InflationLayer"}
Update the local_cosmtap_params.yaml
local_costmap:
global_frame: odom
robot_base_frame: /base_footprint
update_frequency: 5.0
publish_frequency: 2.0
static_map: false
rolling_window: true
width: 4.0
height: 4.0
resolution: 0.05
transform_tolerance: 0.5
plugins:
- {name: obstacle_layer, type: "costmap_2d::VoxelLayer"}
- {name: inflation_layer, type: "costmap_2d::InflationLayer"}