0
$\begingroup$

Rosanswers logo

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.


Originally posted by Sgm on ROS Answers with karma: 11 on 2020-01-11

Post score: 1


Original comments

Comment by David Lu on 2020-01-24:
What's not working at the moment?

Comment by Sgm on 2020-01-25:
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.

Comment by David Lu on 2020-01-27:
How are you loading the planner itself?

Comment by Sgm on 2020-01-27:
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

Comment by artemiialessandrini on 2020-05-19:
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

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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


Originally posted by David Lu with karma: 10932 on 2020-01-28

This answer was ACCEPTED on the original site

Post score: 3

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.