# parameters for local and global costmaps for move_base package

Hello, I have completed the mapping with my laser sensors and now want to make a path planning for my robot. The map I have made is static (no dynamic objects, just for the initial testing) and here are my map parameters:

 resolution: 0.050000
origin: [-100.000000, -100.000000, 0.000000]
negate: 0
occupied_thresh: 0.65
free_thresh: 0.196


The map is 4000x4000 px and with resolution of 0.05 I get 200x200 meters size.

Now, in order for the path planning, I need a local and global costmap params, and here I need your help. Here are my local costmap params:

local_costmap:
update_frequency: 5
publish_frequency: 5
transform_tolerance: 0.25 # 0.25 seconds of latency, if greater than this, planner will stop
static_map: true
rolling_window: true # Follow robot while navigating
width: 3
height: 3
origin_x: -1.5
origin_y: -1.5
resolution: 0.05


And my global params:

global_costmap:
update_frequency: 5
publish_frequency: 5
transform_tolerance: 0.25 # 0.25 seconds of latency, if greater than this, planner will stop
static_map: true
rolling_window: true # Follow robot while navigating
width: 200
height: 200
origin_x: -100
origin_y: -100
resolution: 0.05


Did I choose ok values for my params? I have included the params of my map into global costmap and chose my own smaller values for my local_costmap Also, I will not need any sensor readings as the map is static, can I just ignore the cosmtap_common_params, which I have defined like this but want to exclude when running a path planing using move_base package?

obstacle_range: 6.0
raytrace_range: 8.5
footprint: [[0.12, 0.14], [0.12, -0.14], [-0.12, -0.14], [-0.12, 0.14]]
map_topic: /map
observation_sources: laser_scan_sensor
laser_scan_sensor: {sensor_frame: laser_frame, data_type: LaserScan, topic: scan, marking: true, clearing: true}
global_frame: map
always_send_full_costmap: true

edit retag close merge delete

Sort by » oldest newest most voted

the inflation_radius and cost_saling_factor parameters should go under the inflater_layer in both global and local costmap params files like this:

  inflater_layer:
cost_scaling_factor: 1.0


You should have this in each global and local costmap param files only if you want different inflation for them.

You should still use the cosmtap_common_params file since it is there that you usually put the frame, footprint and plugins params. For example in your cosmtap_common_params you should have something like this:

global_frame: map

footprint: [[0.12, 0.14], [0.12, -0.14], [-0.12, -0.14], [-0.12, 0.14]]

plugins:
- {name: static_layer, type: "costmap_2d::StaticLayer"}
# - {name: obstacles_layer, type: "costmap_2d::ObstacleLayer"}
- {name: inflater_layer, type: "costmap_2d::InflationLayer"}

static_layer:
map_topic: /map

# obstacles_layer:
#   observation_sources: laser_scan_sensor
#   laser_scan_sensor: {sensor_frame: laser_frame, data_type: LaserScan, topic: scan, marking: true, clearing: true,  obstacle_range: 6.0, raytrace_range: 8.5}

inflater_layer:
cost_scaling_factor: 1.0


If you want to have the same inflation for both global and local costmap then you put the params in the common_costmap file like it is shown above.

more

Thank you for the answer. Am I correct with the global costmap parameters to follow my map yaml parameters and local one I can choose which suits me best?

( 2018-10-17 02:46:10 -0600 )edit

I dont know your full setup. I updated the answer with all of the parameters that should be in your common_costmap file with regards to your global and local files. For reference you can always check out the husky configuration.

( 2018-10-17 03:03:41 -0600 )edit

@pavel92 Thank you, it worked good but sometimes the robot does not go to the desired destination and stops. The terminal states this warning:

[ WARN] [1539771436.939121236, 41.659000000]: Map update loop missed its desired rate of 5.0000Hz... the loop actually took 0.2290 seconds

( 2018-10-17 05:21:14 -0600 )edit

Im glad it helped. You can mark the answer as correct now as it solved your initial problem. As for the new warning check this question. It comes down to tuning the update parameters.

( 2018-10-17 06:07:10 -0600 )edit