My costmap in mapping/navigation is filled with obstacles/inflated areas that don't exist. (especially in unknown space)

asked 2021-11-13 05:12:52 -0500

gabipirl gravatar image

Hello,

I have a problem that I can't figure out for the last few weeks. I am using the Tiago Robot, ROS melodic, and I am trying to use its navigation stack to map the environment autonomously using the explore_lite package. The problem is that the robot's global_costmap is filled with random inflated areas("obstacles" that don't exist). They mostly spawn outside the mapped area, but they also spawn inside the mapped area after a while.

What I usually do to remove the random inflated areas is to rotate the robot for a while to clean the map, but nothing changes outside the map. I tried clear_costmap service, but it didn't work. I want to navigate to unknown spaces in the map, but the unknown space is filled with inflated areas that the robot can't go to. The robot also doesn't navigate to unknown spaces where there are no inflated areas, even though I set the allow_unknown and "track_unknown_space" to true in the global_planner.yaml and global_costmap.yaml.

This limits my possibilities to implement a frontier_exploration algorithm unfortunately. I want to navigate to unknown space and even navigate autonomously inside the known space, but it's filled with the inexistant "obstacles".

global_costmap.yaml: *# Independent settings for the planner's costmap global_costmap: map_type: costmap

global_frame : odom robot_base_frame: base_footprint

update_frequency : 1.0 publish_frequency: 1.0

transform_tolerance: 0.2

static_map : false rolling_window: true width : 16.0 height : 16.0 resolution : 0.05

track_unknown_space: true unknown_cost_value : 255

robot_radius : 0.275

plugins: - name: obstacle_laser_layer type: 'costmap_2d::ObstacleLayer' - name: obstacle_sonar_layer type: 'costmap_2d::ObstacleLayer' - name: obstacle_ir_layer type: 'costmap_2d::ObstacleLayer' - name: obstacle_bumper_layer type: 'costmap_2d::ObstacleLayer' - name: obstacle_vo_layer type: 'costmap_2d::ObstacleLayer' - name: inflation_layer type: 'costmap_2d::InflationLayer'

obstacle_laser_layer: enabled: true observation_sources: base_scan combination_method: 0

base_scan:
  sensor_frame: base_laser_link
  data_type: LaserScan
  topic: /scan
  expected_update_rate: 0.3
  observation_persistence: 1.0
  inf_is_valid: true
  marking: true
  clearing: true
  raytrace_range: 5.5
  obstacle_range: 5.0
  min_obstacle_height: -0.1
  max_obstacle_height: 0.2

obstacle_sonar_layer: enabled: false observation_sources: sonar_cloud sonar_max_range_cloud combination_method: 0

sonar_cloud:
  sensor_frame: base_link
  data_type: PointCloud2
  topic: /sonar_cloud
  expected_update_rate: 1.0
  observation_persistence: 0.0
  marking: true
  clearing: true
  raytrace_range: 4.5
  obstacle_range: 3.0
  min_obstacle_height: 0.1
  max_obstacle_height: 1.8

sonar_max_range_cloud:
  sensor_frame: base_link
  data_type: PointCloud2
  topic: /sonar_max_range_cloud
  expected_update_rate: 1.0
  observation_persistence: 0.0
  marking: false
  clearing: true
  raytrace_range: 4.5
  obstacle_range: 3.0
  min_obstacle_height: 0.1
  max_obstacle_height: 1.8

obstacle_ir_layer: enabled: false observation_sources: ir_cloud combination_method: 0

ir_cloud:
  sensor_frame: base_link
  data_type: PointCloud2
  topic: /ir_cloud
  expected_update_rate: 1.0
  observation_persistence: 0.0
  marking: true
  clearing: true
  raytrace_range: 2.0
  obstacle_range: 1.7
  min_obstacle_height: 0.2
  max_obstacle_height: 1.8

obstacle_vo_layer: enabled: true observation_sources: vo_cloud combination_method: 0

vo_cloud:
  sensor_frame: map
  data_type: PointCloud
  topic: /vo_cloud
  expected_update_rate: 12.0
  observation_persistence: 0.0
  marking: true
  clearing: false
  raytrace_range: 1.0
  obstacle_range: 100.0
  min_obstacle_height: 0.0
  max_obstacle_height: 2.0

inflation_layer: enabled : true inflation_radius : 1.0 cost_scaling_factor: 2.0*

global_planner.yaml *base_global_planner: global_planner/GlobalPlanner

GlobalPlanner: allow_unknown: true default_tolerance: 0.5 visualize_potential: true use_dijkstra: true use_quadratic: true use_grid_path: false old_navfn_behavior: false neutral_cost: 100 cost_factor: 0.3 last_plan_if_blocked: true*

Also photos of the ... (more)

edit retag flag offensive close merge delete

Comments

1

What values of inflation radius have you tried?

It may be that inflation causes that area to be impassible - the frontier search only passes through completely clear cells. You can reduce the inflation radius to allow it to pass through narrower areas.

osilva gravatar image osilva  ( 2021-11-13 06:10:46 -0500 )edit
1

The inflation radius should be set to the maximum distance from obstacles at which a cost should be incurred. For example, setting the inflation radius at 0.55 meters means that the robot will treat all paths that stay 0.55 meters or more away from obstacles as having equal obstacle cost.

http://wiki.ros.org/navigation/Tutori...

osilva gravatar image osilva  ( 2021-11-13 06:24:35 -0500 )edit
1
  1. The 'clear costmap' service should work. Please show us the exact command line you are using.

  2. Do you have clearing enabled for both costmaps?

Mike Scheutzow gravatar image Mike Scheutzow  ( 2021-11-14 07:03:43 -0500 )edit

Hello! Thank you for your response @osilva, the inflation radius is 0.55 and the cost scaling function is 25.0. It indeed doesn't pass narrow areas like doors sometimes, but the biggest problem is that the area is fiiled with inflated circles almost everywhere, as you can see in the photos from the link I attached in my question . There seems that the global_costmap and map in rviz are of different sizes and don't allign perfectly, could this be one of the problems?

gabipirl gravatar image gabipirl  ( 2021-11-14 16:36:04 -0500 )edit

Hi @Mike-Scheutzow!! Thanks for your response. When I use rosservice call /move_base/clear_costmap "{}", almost nothing changes. Usually I rotate the robot for 2-3 seconds to clear the costmap inside the already built map, but the exterior of the already built map is still filled with inflated areas. The clearing is enabled for both costmaps, The move_base/global_costmap in rviz doesnt exactly match the map frame like in the simulation. Might this be part of the problem?

gabipirl gravatar image gabipirl  ( 2021-11-14 16:48:50 -0500 )edit

In the question you posted 1.0 for radius and 2.0 for scale. Have you changed them?

osilva gravatar image osilva  ( 2021-11-14 16:57:35 -0500 )edit

That is not the correct name of the service to clear the costmaps. You can do a rosservice list to see what services are currently available.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2021-11-14 19:51:27 -0500 )edit

@osilva, I have a configuration path for the tiago_2dnav_gazebo simulator and the real world implementation. I tried to copy as many of the parameters in the simulation to the 2dnav implementation too, because the simulation works perfectly. So yeah, I changed the inflation radius and cost, but they don't seem to change anything. I still think it's a little strange that my global_costmap doesn't overlay nicely over the map.

gabipirl gravatar image gabipirl  ( 2021-11-15 04:59:19 -0500 )edit