Local costmap has large drift, why?
I want to test out an exploration node and want to avoid errors in mapping and localization. Therefore I have replaced gmapping by the fake_localization node and a modified version of the map_server node. In the map_server I publish only the parts of the map where the robot has been. This computation is based on the localization of the fake_localization node and implements ray tracing to emulate a laser scanner.
EDIT: I did not experience the drift of the local map with gmapping!
Now I'm experiencing a large drift in the local costmap (see images). The first image was taken right after the start, the second just a minute later. Any Ideas what could be wrong here?
The costmap setup is as follows:
Common costmap parameters:
transform_tolerance: 10
obstacle_range: 2.5
raytrace_range: 4.0
inflation_radius: 0.8
footprint: [[-0.4, -0.4], [-0.4, 0.4], [0.4, 0.4],[0.4, -0.4]]
track_unknown_space: true
Global costmap parameters:
global_costmap:
update_frequency: 5
publish_frequency: 0
static_map: true
rolling_window: false
width: 150.0
height: 150.0
Local costmap parameters:
local_costmap:
update_frequency: 1
publish_frequency: 0
static_map: false
rolling_window: true
width: 8.0
height: 8.0
global_frame: /map
The TF transforms in RVIZ look completely wrong, maybe its just a displaying issue. It is static all the time, not moving together with the robot. At the lower end of the transform axis there is map and odom, on the upper end there is base_link, base_laser_link and base_footprint.
The frames look like this:
UPDATE: Using roswtf I figured out that the message types of the robot footprint publisher and subscriber in the costmap did not match. I fixed this in the costmap_2d_ros.cpp in the costmap_2d node. Luckily the tf transforms are now correctly displayed in rviz but I get strange errors now. All the frontier points are now way off and I don't know why.
Connecting the costmap with itself over the footprint topic was just wrong. Thats why it messed up so much.