Using a static costmap for local navigation
I want to use a static map provided by map_server
to populate the obstacles used for both global and local navigation by move_base
(Assuming a completely static environment, no dynamic obstacles). Using the exact same parameters for both the local and the global map produces different results. The global costmap behaves as expected, being populated with inflated obstacles, while the local costmap remains empty. As such global navigation plans look excellent while execution involves locally optimizing the route through walls.
local_costmap: # And also global_costmap
robot_radius: 0.2
inflation_radius: 0.2
global_frame: /odom_fused
robot_base_frame: base_link
update_frequency: 10.0
static_map: true
Asked by Zabot on 2017-06-27 04:07:56 UTC
Answers
You'll have to manually mix in the desired plugins to achieve what you need.
Place the following In your local_costmap_params.yaml
local_costmap:
plugins:
- {name: static_map, type: "costmap_2d::StaticLayer"}
- {name: obstacles, type: "costmap_2d::ObstacleLayer"}
- {name: inflation, type: "costmap_2d::InflationLayer"}
global_frame: odom
robot_base_frame: base_link
transform_tolerance: 5.0
update_frequency: 5.0
publish_frequency: 2.0
obstacles:
observation_sources: laser_scan_sensor
laser_scan_sensor: {sensor_frame: base_link, data_type: LaserScan, topic: scan, marking: true, clearing: true}
The costmap_2d::StaticLayer
plugin allows you to specify a static layer in your local_costmap
The costmap_2d::ObstacleLayer
and costmap_2d::InflationLayer
does what the original local costmap does, marking and clearing and inflating obstacles, note the similarity for the parameters.
More details can be found here: https://github.com/ros-planning/navigation/blob/melodic-devel/costmap_2d/src/costmap_2d_ros.cpp#L279
Asked by Rufus on 2020-04-23 05:09:36 UTC
Comments