My costmap in mapping/navigation is filled with obstacles/inflated areas that don't exist. (especially in unknown space)
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 clearcostmap 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 *allowunknown* and "trackunknownspace" to true in the globalplanner.yaml and globalcostmap.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".
globalcostmap.yaml: *# Independent settings for the planner's costmap globalcostmap: map_type: costmap
globalframe : odom robotbaseframe: basefootprint
updatefrequency : 1.0 publishfrequency: 1.0
transform_tolerance: 0.2
staticmap : false rollingwindow: true width : 16.0 height : 16.0 resolution : 0.05
trackunknownspace: true unknowncostvalue : 255
robot_radius : 0.275
plugins: - name: obstaclelaserlayer type: 'costmap2d::ObstacleLayer' - name: obstaclesonarlayer type: 'costmap2d::ObstacleLayer' - name: obstacleirlayer type: 'costmap2d::ObstacleLayer' - name: obstaclebumperlayer type: 'costmap2d::ObstacleLayer' - name: obstaclevolayer type: 'costmap2d::ObstacleLayer' - name: inflationlayer type: 'costmap_2d::InflationLayer'
obstaclelaserlayer: enabled: true observationsources: basescan 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
obstaclesonarlayer: enabled: false observationsources: sonarcloud sonarmaxrangecloud combinationmethod: 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
obstacleirlayer: enabled: false observationsources: ircloud 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
obstaclevolayer: enabled: true observationsources: vocloud 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
inflationlayer: enabled : true inflationradius : 1.0 costscalingfactor: 2.0*
globalplanner.yaml *baseglobalplanner: globalplanner/GlobalPlanner
GlobalPlanner: allowunknown: true defaulttolerance: 0.5 visualizepotential: true usedijkstra: true usequadratic: true usegridpath: false oldnavfnbehavior: false neutralcost: 100 costfactor: 0.3 lastplanifblocked: true*
Also photos of the navigation stack rviz: https://files.fm/u/vyq64wqcz
Asked by gabipirl on 2021-11-13 06:12:52 UTC
Comments
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.
Asked by osilva on 2021-11-13 07:10:46 UTC
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/Tutorials/RobotSetup
Asked by osilva on 2021-11-13 07:24:35 UTC
The 'clear costmap' service should work. Please show us the exact command line you are using.
Do you have clearing enabled for both costmaps?
Asked by Mike Scheutzow on 2021-11-14 08:03:43 UTC
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?
Asked by gabipirl on 2021-11-14 17:36:04 UTC
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?
Asked by gabipirl on 2021-11-14 17:48:50 UTC
In the question you posted 1.0 for radius and 2.0 for scale. Have you changed them?
Asked by osilva on 2021-11-14 17:57:35 UTC
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.Asked by Mike Scheutzow on 2021-11-14 20:51:27 UTC
@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.
Asked by gabipirl on 2021-11-15 05:59:19 UTC
@gabipirl Have you succeeded at clearing the costmaps?
Asked by Mike Scheutzow on 2021-11-16 08:17:33 UTC
Hey Mike, unfortunately no. The costmap is still the same no matter what parameters I change. I looked on other forums and it might be a problem with the version of NavigationStack. I will add a link here to the issue opened by somebody with a similar problem: https://github.com/ros-planning/navigation/issues/959 I didn't understand how this person solved the issue unfortunately. BR, Gabi
Asked by gabipirl on 2021-11-18 15:11:08 UTC