Ask Your Question
0

Local Map (navigation stack) not showing obstacle

asked 2020-05-14 05:53:02 -0500

dpetrini gravatar image

updated 2020-05-14 05:55:51 -0500

Hi,

Can someone shed some light on how to display lasercan obstacles for use in Navigation Stack (AMCL+MOVE_BASE, ubuntu 18.04, Melodic)?

I spent lots of time changing configurations and searching for answers but I can't figure out how to consider obstacles detected by lasercan as in this image:

https://drive.google.com/open?id=1Wxa...

In the image there is an obstacle (pointed in RED) as detected by laserscan but is not marked as obstacle by local map.

However if I change common costmap file and remove "plugins" section going back to pre-Hidro parameters it is showed as image below.

https://drive.google.com/open?id=1rub...

Hera are my relevant config files:

costmap_common_params.yaml

obstacle_range: 2.5
raytrace_range: 3.0

footprint: [[-0.2,-0.2],[-0.2,0.2], [0.2, 0.2], [0.2,-0.2]]
inflation_radius: 0.30  # max. distance from an obstacle at which costs are incurred for planning paths.
cost_scaling_factor: 50  # exponential rate at which the obstacle cost drops off (default 10) 

observation_sources: scan

scan: {data_type: LaserScan, sensor_frame: base_link, topic: /zed/scan, marking: true, clearing: true, min_obstacle_height: 0.0, max_obstacle_height: 0.50}

plugins: 
- {name: static_map,               type: "costmap_2d::StaticLayer"}
- {name: obstacle_2d_layer,   type: "costmap_2d::ObstacleLayer"}
- {name: inflation,                   type: "costmap_2d::InflationLayer"}

global_costmap_params.yaml

global_costmap:
global_frame: map
robot_base_frame: base_link
update_frequency: 1.0
#static_map: true
publish_frequency: 0.5
transform_tolerance: 1.0 
#resolution: 0.010

local_costmap_params.xml

local_costmap:
global_frame: odom  # odom DGPP
robot_base_frame: base_link
update_frequency: 2.0
publish_frequency: 2.0
#static_map: false
rolling_window: true
width: 3.0
height: 3.0
resolution: 0.05
transform_tolerance: 1.0

As mentioned, if I just comment the plugin item with the three topics from costmap_common file it shows the obstacle. It also show some errors (not important) in terminal but shows the obstacle as second image above.

I am using TrajectoryPlannerROS (not DWA).

Can someone shed some light on how to display lasercan obstacle for use in Navigation Stack (AMCL+MOVE_BASE)?

Thank you,

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2020-05-14 13:03:10 -0500

dpetrini gravatar image

I will answer my own question:

After keep looking for answers and trying many combinations, I discover that is all about syntax.

It seems different versions (using directive "plugins:" or not) eventually requires proper manner to write files.

The solution of my issue above was to write the common_costmap_params.xml file as below:

obstacle_range: 2.5
raytrace_range: 3.0

footprint: [[-0.2,-0.2],[-0.2,0.2], [0.2, 0.2], [0.2,-0.2]]

inflation:
  inflation_radius: 0.3
  cost_scaling_factor: 50  # exponential rate at which the obstacle cost drops off (default 10)

obstacle_2d_layer:
    observation_sources: scan
    scan: {data_type: LaserScan, sensor_frame: zed_left_camera_frame, topic: /zed/scan, marking: true, clearing: true, min_obstacle_height: 0.0, max_obstacle_height: 0.5}

plugins: 
    - {name: static_map, type: "costmap_2d::StaticLayer"}
    - {name: obstacle_2d_layer, type: "costmap_2d::ObstacleLayer"}
    - {name: inflation, type: "costmap_2d::InflationLayer"}

As you can see the "inflation" and "obstacle_2d_layer" keywords (as pointed as "name" inside plugins) need to be exposed like that. Doing this obstacles showed up like a charm.

edit flag offensive delete link more
0

answered 2020-05-14 20:42:59 -0500

942951641@qq.com gravatar image

plugins param should be define in local_costmap file and global_costmap file

edit flag offensive delete link more

Comments

In my configuration, costmap_common_params.xml is previously loaded with proper namespaces in top level launch file. So its content is already valid for local_costmap and global_costmap. Anyway thanks for your observation.

dpetrini gravatar image dpetrini  ( 2020-05-15 06:48:29 -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

1 follower

Stats

Asked: 2020-05-14 05:53:02 -0500

Seen: 159 times

Last updated: May 14 '20