Ask Your Question
0

Layered costmap performance

asked 2019-02-08 06:45:14 -0500

SleepyTurtle gravatar image

updated 2019-02-09 07:18:38 -0500

After switching to the plugin implementation of costmap_2d in order to be able to work with layers, the layers load extremely slowly and in chunks, it's a bit difficult to explain, so I've included pictures:

Using pre-hydro configuration:

image description

Using plugins:

image description

It's a problem since it also affects the planners.

Here are my config files:

costmap_common_params.yaml:

  obstacle_range: 3.5
  raytrace_range: 4.0
  robot_radius: 0.4
  inflation_radius: 0.7

  obstacle_layer:
    observation_sources: laser_scan_sensor
    laser_scan_sensor: {sensor_frame: /sensor_link, data_type: LaserScan, topic: /navbot/scan_data, marking: true, clearing: true}

global_costmap_params:

global_costmap:
  global_frame: /map
  robot_base_frame: /platform
  update_frequency: 5.0
  static_map: true
  plugins:
    - {name: inflation_layer,   type: "costmap_2d::InflationLayer", output: "screen"}
    - {name: static_map,        type: "costmap_2d::StaticLayer"}
    - {name: obstacle_layer,    type: "costmap_2d::ObstacleLayer", output: "screen"}

local_costmap_params.yaml:

local_costmap:
  global_frame: /map
  robot_base_frame: /platform
  update_frequency: 8.0
  publish_frequency: 4.0
  rolling_window: true
  static_map: false
  width: 6.0
  height: 6.0
  resolution: 0.05
  plugins:
    - {name: inflation_layer,        type: "costmap_2d::InflationLayer", output: "screen"}
    - {name: obstacle_layer,         type: "costmap_2d::ObstacleLayer", output: "screen"}

Thank you.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-02-08 11:52:42 -0500

David Lu gravatar image

The order of your layers is probably not what you intended. Move the inflation layer from the first position to the last position in each configuration.

edit flag offensive delete link more

Comments

Thank you, I'll try it out on Monday and update the question.

EDIT: That solved the problem, thank you again.

SleepyTurtle gravatar image SleepyTurtle  ( 2019-02-09 07:17:46 -0500 )edit

@david-lu so the order in which you add the layers makes a difference? Could you please provide a reference link where I can read more about it?

parzival gravatar image parzival  ( 2020-07-04 09:17:53 -0500 )edit

Thanks a lot for sharing the paper, helped me a lot to understand. So if I have laser scanner+sonar, what should be the order of my layers? Please tell me if this is correct: 1. Static 2. Obstacle 3. Sonar 4. Inflation Should inflation always be the last item? Thanks again

parzival gravatar image parzival  ( 2020-07-14 08:21:33 -0500 )edit

That looks fine. Whether you switch Obstacle and Sonar depends on what kind of obstacles you'll see. Inflation is very often the last item, but I won't say always.

David Lu gravatar image David Lu  ( 2020-07-16 15:55:38 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2019-02-08 06:45:14 -0500

Seen: 150 times

Last updated: Feb 09 '19