Stop clearing recovery behaviour on some costmap layers

asked 2018-11-20 06:12:18 -0500

Andy West gravatar image

updated 2018-11-20 12:08:09 -0500


I am using move_base with a gazebo simulation of a Turtlebot3 with Kinetic. I have a custom costmap layer which assigns a cost (arbitrary but let us say 50) based on the footprint of a robot (to avoid the robot going over ground it has already covered). The custom layer uses a costmap_2d::Layer class.

The global costmap uses: a "static layer" - created on-the-fly with gmapping, "obstacle layer" (using a 2D lidar), and an "inflation layer". The custom layer comes after these three in the plugins list, and all works as expected. (The local layer only uses an "obstacle layer" and "inflation layer").

Each are defined earlier in the param yaml file.

- {name: static_layer,            type: "costmap_2d::StaticLayer"}
- {name: obstacle_layer,          type: "costmap_2d::VoxelLayer"}
- {name: inflation_layer,         type: "costmap_2d::InflationLayer"}
- {name: custom_layer,            type: "custom_layer::CustomLayer"}

The problem:

When the costmap resizes (as the robot travels out of current bounds), the clearing recovery removes all non-lethal costs when it reverts back to the static layer map (default behaviour). This completely removes any costs associated with the custom layer (unwanted behaviour!).

What I have tried - and did not work:

1) For both the global costmap and the move_base params trying to turn off recovery behaviours using recovery_behavior_enabled: false

2) Setting above back to true, and defining the conservative and aggressive clear radius to large values in the global cost params

recovery_behaviors: [
    {name: conservative_clear, type: clear_costmap_recovery/ClearCostmapRecovery},
    {name: aggressive_clear, type: clear_costmap_recovery/ClearCostmapRecovery}

    reset_distance: 10.00
    reset_distance: 10.00

3) Trying to specify which layers are effected by clearing behaviour

    reset_distance: 10.00
    layer_names: ["obstacle_layer"]
    reset_distance: 10.00
    layer_names: ["obstacle_layer"]

My question: Is there any way to stop the clearing behaviour from affecting a particular layer? I would still like to keep the clearing behaviours on in general (e.g. obstacle layer).

If this is not possible - Is there a method to store non-lethal costs on a global map in a permanent manner? For example, would building a map separately and passing it to move_base somehow work?

Best wishes,

Andy West

edit retag flag offensive close merge delete


David Lu gravatar image David Lu  ( 2018-11-24 10:46:48 -0500 )edit

Hi David, thanks for taking a look. After more investigation, I think it is an issue with the resizeMap function, rather than the clear_recovery_behaviour which is also invoked upon resizing. Is there no way to resizeMap and not delete the costmap information?

Andy West gravatar image Andy West  ( 2018-11-27 03:39:11 -0500 )edit