Rosanswers logo

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"}

Originally posted by notinuse on ROS Answers with karma: 48 on 2017-10-14

Post score: 0

Original comments

Comment by cheng1234567 on 2018-01-03:
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?

Comment by cheng1234567 on 2018-01-03:
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?

Comment by notinuse on 2018-01-04:
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.

Comment by notinuse on 2018-01-04:
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.


1 Answer 1


Rosanswers logo

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 http://wiki.ros.org/costmap_2d):

image description

Originally posted by Procópio with karma: 4402 on 2017-10-16

This answer was ACCEPTED on the original site

Post score: 3


Your Answer

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