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

Clearing the obstacles form local costmap

asked 2020-05-14 03:02:48 -0500

Yehor gravatar image

updated 2020-05-14 04:57:15 -0500

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

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
0

answered 2021-03-08 07:58:36 -0500

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
edit flag offensive delete link more
0

answered 2020-05-14 20:48:11 -0500

942951641@qq.com gravatar image

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

edit flag offensive delete link more

Comments

No, The fov is 360 degree

Yehor gravatar image Yehor  ( 2020-05-15 01:06:13 -0500 )edit
0

answered 2020-05-14 04:09:34 -0500

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.

edit flag offensive delete link more

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  ( 2020-05-14 04:58:18 -0500 )edit

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

Yehor gravatar image Yehor  ( 2020-05-14 05:00:41 -0500 )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  ( 2020-05-14 07:20:53 -0500 )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  ( 2020-05-14 08:58:22 -0500 )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  ( 2020-05-14 11:29:19 -0500 )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  ( 2020-05-14 22:40:08 -0500 )edit

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

Yehor gravatar image Yehor  ( 2020-05-15 01:05:29 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2020-05-14 03:02:48 -0500

Seen: 1,742 times

Last updated: Mar 08 '21