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

How to configure local_costmap.yaml to use CostmapAdapter in DWB planner

asked 2020-01-11 07:18:29 -0600

Sgm gravatar image

updated 2020-01-24 14:17:47 -0600

David Lu gravatar image

Dear all,

I am trying to use Robot Navigation DWBLocalPlanner in Move_Base_Flex, but I am having troubles in configuring local_costmap.yaml. In order to use the costmap layers it is need to load the CostmapAdapter interface so the costmap layers are loaded in DWB namespace. Is this loaded as a layer-like plugin under local_costmap which will automatically point to DWB or shall it be configured a new namespace? Shall it be enhanced with costmap_queue?

Running under Ubuntu 18.04 ROS melodic.

Here is the configuration that I am following:

local_costmap:

  width: 9.0
  height: 9.0
  resolution: 0.05

  static_map: false
  rolling_window: true
  global_frame: map
  robot_base_frame: base_link

  update_frequency: 25.0
  publish_frequency: 5.0


  map_type: costmap
  obstacle_range: 4.5
  raytrace_range: 4.5

  publish_voxel_map: false
  transform_tolerance: 0.5
  meter_scoring: true

  footprint: [[-0.51, -0.52], [-0.51, 0.52], [0.79, 0.42], [0.79, -0.42]]
  footprint_padding: 0.15

  plugins:
    # - {name: static_layer, type: "costmap_2d::StaticLayer"}
    - {name: costmap_ros , type: "nav_core_adapter::CostmapAdapter"}
    - {name: laser_horizontal_layer, type: "costmap_2d::ObstacleLayer"}
    # - {name: rgbd_layer, type: "costmap_2d::ObstacleLayer"}
    - {name: laser_cliff_layer, type: "costmap_2d::VoxelLayer"}
    - {name: inflation_layer, type: "costmap_2d::InflationLayer"}

Thanks in advance.

edit retag flag offensive close merge delete

Comments

What's not working at the moment?

David Lu gravatar image David Lu  ( 2020-01-24 14:18:24 -0600 )edit

DWB planner is working fine. But is not able to load the local costmap, so dynamic obstacles in the path are not avoided. I am wondering how I am supposed to load the plugin. I think that for having that behavior I need to load the CostmapAdapter plugin, to have the local_costmap loaded in nav_core2 so it can be considered in the planner. Right? Whenever I try it I get the following error:

what():  According to the loaded plugin descriptions the class nav_core_adapter::CostmapAdapter with base class type costmap_2d::Layer does not exist. Declared types are  costmap_2d::InflationLayer costmap_2d::ObstacleLayer costmap_2d::StaticLayer costmap_2d::VoxelLayer range_sensor_layer::RangeSensorLayer social_navigation_layers::PassingLayer social_navigation_layers::ProxemicLayer

Since I am using the LocalPlannerAdapter I thought I did not need to use the CostmapAdapter, because everything was running on nav_core and the local_costmap would be loaded in DWB.

Hope this clarifies.

Sgm gravatar image Sgm  ( 2020-01-25 07:26:15 -0600 )edit

How are you loading the planner itself?

David Lu gravatar image David Lu  ( 2020-01-27 14:38:34 -0600 )edit

I have a configuration file for the local planners.Where I set the 'name' and 'type' of BaseLocalPlanner and using the nav_core_adapter::LocalPlannerAdapter. As it follows:

controllers:
  - name: 'BaseLocalPlanner'
    type: 'nav_core_adapter::LocalPlannerAdapter'

LocalPlannerAdapter:
  planner_name: dwb_local_planner::DWBLocalPlanner

DWBLocalPlanner:
  ###### DWB Configuration Parameters ######
  # The minimum x velocity for the robot in m/s
  min_vel_x: 0.0

I am able to avoid obstacles with other planners such as previous dwa versions or teb.

I see that the planner can work in two different ways:

1- Running on old nav_core : For that it is needed to use LocalPlannerAdapter interface to have DWB loaded in the old nav_stack. For this way the planner should use the local_costmap as it is in the old nav stack.

2- Running on nav_core2. Use directly the BasicCostmap or use CostmapAdapter interface to load Costmap2D

Sgm gravatar image Sgm  ( 2020-01-27 15:20:18 -0600 )edit

Hi, @Sgm, could you please explain how you got mbf and DWB_local_planner working together? I set my local planner the same way using Adapter, but still facing errors, while planning /move_base_simple/goal

artemiialessandrini gravatar image artemiialessandrini  ( 2020-05-19 04:30:37 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
3

answered 2020-01-28 15:59:55 -0600

David Lu gravatar image

Because you are already using the LocalPlannerAdapter, you do not need to manually use the CostmapAdapter. It does it automatically.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-01-11 07:18:29 -0600

Seen: 887 times

Last updated: Jan 28 '20