Obstacle avoidance in move_base package
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 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:
<launch>
<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"/>
</node>
</launch>
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
obstacle_layer:
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}
inflation_layer:
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_costmap:
global_frame: /map
robot_base_frame: base_footprint
update_frequency: 3.0
static_map: true
transform_tolerance: 5.0
plugins:
- {name: static_layer, type: "costmap_2d::StaticLayer"}
- {name: obstacle_layer, type: "costmap_2d::VoxelLayer"}
- {name: inflation_layer, type: "costmap_2d::InflationLayer"}
local costmap yaml:
local_costmap:
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
plugins:
- {name: obstacle_layer, type: "costmap_2d::VoxelLayer"}
- {name: inflation_layer, type: "costmap_2d::InflationLayer"}
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?
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?
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.
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.