First time here? Check out the FAQ!


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

Clearing the obstacles form local costmap

asked May 14 '20

Yehor gravatar image

updated May 14 '20

Hello,

I want to ask, is it possible to specify somewhere in the move_base parameter how often clear the local costmap. I want to do that because I face the problem when the local costmap add a dynamic obstacles buy after the are disappeared the costmap do not clear the space too long.

On the image below I have marked the obstacles which have already gone but they are still persist on the local costmap.

image description

EDIT 1

local costmap parameters:

local_costmap: global_frame: odom robot_base_frame: base_footprint update_frequency: 5.0 publish_frequency: 1.0 static_map: false rolling_window: true width: 4.0 height: 4.0 resolution: 0.05

common costmap:

obstacle_range: 2.5 raytrace_range: 3.0 footprint: [[-0.2, -0.2], [-0.2, 0.2], [0.2, 0.2], [0.2, -0.2]] inflation_radius: 0.1 transform_tolerance: 1.0 observation_sources: laser_scan_sensor laser_scan_sensor: sensor_frame: laser_frame data_type: LaserScan topic: filtered_scan clearing: true marking: true min_obstacle_height: 0.1 max_obstacle_height: 0.4

Preview: (hide)

3 Answers

Sort by » oldest newest most voted
0

answered Mar 8 '21

ParkerRobert gravatar image

In order for the costmap to be able to clear obstacles, your observation source needs to "see" a distance greater than the distance from the observation source to the obstacle, this is part of the raytrace algorithm in the ROS Navigation stack.

Based on your parameters, it seems you have set all the right variables correctly:

  • obstacle_range: 2.5 < raytrace_range: 3.0 (raytrace_range should be more than obstacle_range)
  • marking and clearing are set to true
  • you can also try adding observation_persistence: 0.0 to ensure that obstacles are immediately cleared
  • check if your laser_scan_sensor has a maximum range value instead of inf or nan values. You can check this by doing a rostopic echo filtered_scan and inspecting the data (if you observe inf or nan values, you can use the http://wiki.ros.org/laser_filters package and use the LaserScanRangeFilter. Set the upper threshold to the max_range of your lidar and upper_replacement_value to max_range of your lidar
Preview: (hide)
0

answered May 15 '20

942951641@qq.com gravatar image

maybe it is caused by a lidar which fov is less than 2pi

Preview: (hide)

Comments

No, The fov is 360 degree

Yehor gravatar image Yehor  ( May 15 '20 )edit
0

answered May 14 '20

You'd better post your local costmap param configuration.

On your image, seems the robot cannot detect the obstacles behind. When there are no new sensor readings, the costmap will not be updated.

Try to increase the update_frequency and publish_frequency, also make sure that in the Observation sources, clearing is set to true.

I think this could solve your problem.

Preview: (hide)

Comments

@tianb03 I have updated the post with local and common costmap parameters. The update frequency is 5 Hz which should be enough.

Yehor gravatar image Yehor  ( May 14 '20 )edit

@tianb03 Do the costmap treat the value from LaserScan 0.0 as a free area?

Yehor gravatar image Yehor  ( May 14 '20 )edit

You can try to set the update frequecy as high as the laser scan frequency. Obstacle is calculated based on probability, so it wont disappear asap after the obastacle moves away. I cannot tell wether the laser can cover the obstacle area. But a 0.0 value can only assume it is unknown and wont update the costmap.

tianb03 gravatar image tianb03  ( May 14 '20 )edit

@tianb03 What does it means: Obstacle is calculated based on probability? Could you explain please? And this: I cannot tell whether the laser can cover the obstacle area

Yehor gravatar image Yehor  ( May 14 '20 )edit
1

Obstacles are generally NOT calculated based on probability. They disappear when you get laser readings behind them.

David Lu gravatar image David Lu  ( May 14 '20 )edit

Thanks David for explaining. I just take for grant that the costmap occupancy is the same as the final map.

tianb03 gravatar image tianb03  ( May 15 '20 )edit

@David Lu So will the costmap clear space if the value from LaserScan will be 0.0?

Yehor gravatar image Yehor  ( May 15 '20 )edit

Question Tools

2 followers

Stats

Asked: May 14 '20

Seen: 1,931 times

Last updated: Mar 08 '21