ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Obstacle avoidance in move_base package

asked 2017-10-14 03:48:51 -0600

notinuse gravatar image

I am using DWAPlannerRos and GlobalPlanner for move_base navigation package. It is able to navigate to goal. I have set the inflation radius of obstacle layer and inflation layer of costmap to be 1.0. I suppose when the robot footprint enter the obstacle region, the navigation stack should stop the robot to prevent collision but it didn't happen. Whyy?

image description

Image above shows my local costmap (/move_base/local_costmap/costmap). Green color polygon is the robot footprint. I define the robot footprint larger than the robot's model for testing and visualizing purpose.

my movebase launch file:

  <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
    <param name="base_global_planner" value="global_planner/GlobalPlanner"/>
    <param name="base_local_planner" value="dwa_local_planner/DWAPlannerROS"/>
    <param name="controller_frequency" value="10"/>
    <rosparam file="$(find erobot)/config/common_costmap_params.yaml" command="load" ns="local_costmap"/>
    <rosparam file="$(find erobot)/config/common_costmap_params.yaml" command="load" ns="global_costmap"/>
    <rosparam file="$(find erobot)/config/local_costmap_params.yaml" command="load" />
    <rosparam file="$(find erobot)/config/global_costmap_params.yaml" command="load" />
    <rosparam file="$(find erobot)/config/custom_planner_params.yaml" command="load" />
    <remap from="cmd_vel" to="erobot_controller/cmd_vel"/>
    <remap from="odom" to="erobot_controller/odom"/>


common costmap yaml:

#footprint: [[0.275, 0.375], [-0.275, 0.375], [-0.275, -0.375], [0.275, -0.375]]
footprint: [[0.5, 0.5], [-0.5, 0.5], [-0.5, -0.5], [0.5, -0.5]]
robot_radius: 0.5

transform_tolerance: 0.4

  enabled: true
  obstacle_range: 2.5
  raytrace_range: 3.0
  max_obstacle_height: 2.0
  min_obstacle_height: -2.0
  inflation_radius: 1.00
  observation_sources: laser_scan_sensor
  laser_scan_sensor: {sensor_frame: front_laser_frame, data_type: LaserScan, topic: front_scan, marking: true, clearing: true}

  enabled:              true
  cost_scaling_factor:  5.0  # exponential rate at which the obstacle cost drops off (default: 10)
  inflation_radius:     1.0  # max. distance from an obstacle at which costs are incurred for planning paths.

global costmap yaml:

  global_frame: /map
  robot_base_frame: base_footprint
  update_frequency: 3.0
  static_map: true
  transform_tolerance: 5.0
     - {name: static_layer,            type: "costmap_2d::StaticLayer"}
     - {name: obstacle_layer,          type: "costmap_2d::VoxelLayer"}
     - {name: inflation_layer,         type: "costmap_2d::InflationLayer"}

local costmap yaml:

  global_frame: /odom
  robot_base_frame: base_footprint
  update_frequency: 3.0
  publish_frequency: 2.0
  static_map: false
  rolling_window: true
  width: 6.0
  height: 6.0
  resolution: 0.05
  transform_tolerance: 5.0
    - {name: obstacle_layer,      type: "costmap_2d::VoxelLayer"}
    - {name: inflation_layer,     type: "costmap_2d::InflationLayer"}
edit retag flag offensive close merge delete


Hi so have you found a way to solve this issue? What do you have to change such that the the robot won't collide with the obstacles? Is it playing with the inscribed_radius and circumscribed_radius?

cheng1234567 gravatar image cheng1234567  ( 2018-01-03 00:31:15 -0600 )edit

The answer below did help to give a better understanding on this, but I still don't know what to do to solve this problem. any idea?

cheng1234567 gravatar image cheng1234567  ( 2018-01-03 00:32:00 -0600 )edit

No I still haven't figure out a proper way to prevent the collision, except setting fake huge footprint which eventually increased the inscribed_radius that is automatically calculated by the function in footprint.cpp. This causes a lot of problem when my robot navigating through narrow corridor.

notinuse gravatar image notinuse  ( 2018-01-03 23:49:14 -0600 )edit

I'm looking into the global & local planner code to check whether they take robot model and robot orientation into account when generating/following the path. Collision always happen when robot near to obstacle and do inplace rotation when there is new goal. Please share if you have any idea too.

notinuse gravatar image notinuse  ( 2018-01-03 23:58:36 -0600 )edit

1 Answer

Sort by » oldest newest most voted

answered 2017-10-16 07:49:02 -0600

Procópio gravatar image

I suppose when the robot footprint enter the obstacle region, the navigation stack should stop the robot to prevent collision but it didn't happen. Why?

No, that is the CENTER of the robot that must not enter the lethal costmap (colored in cyan). If you have an asymmetric footprint, the cyan region you see in the first image is the obstacles + inscribed region (which is the smallest distance from the robot's center to the footprint). If the center of the robot is inside the lethal region, it is certainly in collision.

Then there is the circumscribed region, which would envelope your whole footprint and that may or may not be in collision, depending on the orientation of your robot.

Check this image for better understanding (from ):

image description

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools



Asked: 2017-10-14 03:48:51 -0600

Seen: 4,205 times

Last updated: Oct 16 '17