ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

parameters for local and global costmaps for move_base package

asked 2018-10-17 00:34:13 -0500

stevemartin gravatar image

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
  inflation_radius: 0.2

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
  inflation_radius: 0.2

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
subscribe_to_updates: true
observation_sources: laser_scan_sensor
laser_scan_sensor: {sensor_frame: laser_frame, data_type: LaserScan, topic: scan, marking: true, clearing: true}
global_frame: map
robot_base_frame: base_link
always_send_full_costmap: true
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-10-17 02:17:58 -0500

pavel92 gravatar image

updated 2018-10-17 02:48:39 -0500

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:
    inflation_radius: 0.2
    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
robot_base_frame: base_link

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

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
  subscribe_to_updates: true

# 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:
  inflation_radius: 0.2
  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.

edit flag offensive delete link more

Comments

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?

stevemartin gravatar image stevemartin  ( 2018-10-17 02:46:10 -0500 )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.

pavel92 gravatar image pavel92  ( 2018-10-17 03:03:41 -0500 )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
stevemartin gravatar image stevemartin  ( 2018-10-17 05:21:14 -0500 )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.

pavel92 gravatar image pavel92  ( 2018-10-17 06:07:10 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2018-10-17 00:34:13 -0500

Seen: 7,538 times

Last updated: Oct 17 '18