I am trying to understand how Costmaps Works. I have Costmap with params:
costmap params
base_scan: {clearing: true, data_type: LaserScan, expected_update_rate: 0.4, marking: true,
max_obstacle_height: 2.4, min_obstacle_height: 0.08, observation_persistence: 5.0}
cost_scaling_factor: 13.0
footprint: '[[-0.375,-0.375],[-0.375,0.375],[0.375,0.375],[0.375,-0.375]]'
footprint_padding: 0.05
global_frame: /odom
height: 6
inflation_radius: 0.5
lethal_cost_threshold: 100
map_topic: map
map_type: voxel
mark_threshold: 0
max_obstacle_height: 2.0
max_obstacle_range: 2.5
observation_sources: base_scan
obstacle_range: 2.5
origin_x: 0.0
origin_y: 0.0
origin_z: 0.0
publish_frequency: 5.0
publish_voxel_map: false
raytrace_range: 3.0
resolution: 0.05
restore_defaults: false
robot_base_frame: /base_link
robot_radius: 0.46
rolling_window: true
static_map: false
track_unknown_space: false
transform_tolerance: 0.3
unknown_cost_value: 0
unknown_threshold: 9
update_frequency: 5.0
width: 6
z_resolution: 0.05
z_voxels: 10
rviz(OcupancyGrid with topic: /test_node/local_costmap/infalted_obstacles: rviz(OcupancyGrid with topic: /test_node/local_costmap/infalted_obstacles http://imageshack.com/a/img46/971/wf7w.png
How Costmap really looks like(openCV):
How Costmap really looks like(openCV) http://imageshack.com/a/img571/8012/n7mm.png
(I assume that black is obstacle and white is free because when I put robot in free space I get white costmap with black square(robot footprint)).
this assumption was wrong
This can be not true as @ahendrix mentioned. The Costmap picture is flipped vertically to OccupancyGrid
and my questions:
Why the costmap is consisted only of 0 or 255 values ( I thought there should be a gradient 0-255)?
I printed values in console and there are values between 0-255 (but not a lot of them - I suppose it depends on inflation radius). But still I don't get it why costmap looks like this and sends correct OccupancyGrid topics.
2.i was wrong with the values(black is 0-free)
3.i was wrong with the values- footprint is free, but why when i put robot in free space, costmap has only footprint spotted as free?
Thanks in advance
Originally posted by BP on ROS Answers with karma: 176 on 2014-04-02
Post score: 1
Original comments
Comment by Marcus on 2015-02-25:
Hey BP,
I am trying to get the costmap_2d into any kind of image format:
see here
It seems like you were able to do this. Could you give me a short explanation?
Thanks,
Marcus