ROS Navigation. Global Costmap clears obstacles behind robot.
Hello!
So I am starting out in ROS 2D navigation (with RTABMap), and I have managed to create a database, saving it, and then have the turtlebot navigate on it (following the RTABMap navigation demo). I am using an Astra camera (following the 3dsensor.launch with the Astra SDK), and using the depthimage_to_laserscan to produce a scan topic.
Now, when I add a new obstacle in front of the camera, the global costmap updates and shows the area as an obstacle, wherever I place them, this is working fine. The problem is, that when I rotate the robot and it can no longer see the obstacle, the global costmap immediately updates and clears the obstacle from the map.
I have tried reading the navigation stack documentation, and I thought that raytracing only clears obstacles if the laserscanner sees that there's an unblocked view on where the obstacle used to be. It seems that it is just clearing any obstacle that is no longer in the laser scanner field of view.
I also tried going through the forum, but all the questions I could find were referring to actually clearing the obstacle (while my problem is that they are clearing when they shouldn't). Seems that the problem for most people is that the obstacles do not clear.
The problem I am having is:
- The global costmap clears any obstacle that it cannot see, even if the obstacle is outside of the field of view of the laser scanner.
Could someone provide me with some pointers to fix this? I tried changing the costmap_params (common, global), but the obstacles keep clearing.
This is my costmap_common_params.yaml
max_obstacle_height: 0.60 # assume something like an arm is mounted on top of the robot
# Obstacle Cost Shaping (http://wiki.ros.org/costmap_2d/hydro/inflation)
robot_radius: 0.20 # distance a circular robot should be clear of the obstacle (kobuki: 0.18)
# footprint: [[x0, y0], [x1, y1], ... [xn, yn]] # if the robot is not circular
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 #true needed for disabling global path planning through unknown space
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: bump
bump:
data_type: PointCloud2
topic: mobile_base/sensors/bumper_pointcloud
marking: true
clearing: false
min_obstacle_height: 0.0
max_obstacle_height: 0.15
# for debugging only, let's you see the entire voxel grid
#cost_scaling_factor and inflation_radius were now moved to the inflation_layer ns
inflation_layer:
enabled: true
cost_scaling_factor: 5.0 # exponential rate at which the obstacle cost drops off (default: 10)
inflation_radius: 0.5 # max. distance from an obstacle at which costs are incurred for planning paths.
static_layer:
enabled: true
Thank you!
EDIT1: So one of the problems was that I had not added the obstacle layer definition in the global_costmap_params.yaml. I changed it to this and it is now partly working:
global_costmap:
global_frame: /map
robot_base_frame: /base_footprint
update_frequency: 1.0
publish_frequency: 0.5 ...
The problem seems to be on rtabmap side. Can you update your question with which version are you using (Indigo/Kinetic/source)? Can you show a screenshot of the map? Without the obstacle_layer, the obstacle should also stay in the global map. Maybe related to https://goo.gl/1VMX5A
Dear matlabbe,
I am using Ubuntu 16.04 with ros kinetic. Rtabmap (and rtabmap ros) was compiled from source from the github code. Unfortunately, I will not have access to screenshots until next week. It looks like a perfectly normal map (no weird arc behind like in the link).
Except that obstacles disappear when the robot is facing the opposite way from the obstacle. The screenshot would be similar to my previous [fixed] question here: http://official-rtab-map-forum.67519....
It may be worth noting that this happens during localization mode. When I just want to navigate the map, and create new obstacles as I navigate a known map.
I will check next week by trying the flip_scan parameter set to true!
Also worth noting: without the obstacle layer added on the first EDIT, NULL laser scan topic values would clear any obstacles. E.g., an obstacle is added, costmap shows, I block the camera with my hand (without moving the robot) causing the topic to be null, and the costmap would clear the obstacle.