Robotics StackExchange | Archived questions

AMCL not using local costmap for path planning

My AMCL seems to only be using the global costmap for path planning. If I remove the obstacles_layer from the global costmap, it will not avoid obstacles in the local costmap.

If I include the obstacleslayer in globalcostmapparams or commoncostmap_params, then it works properly, but the obstacles from the local costmap get baked into the global costmap (I just restarted my terminal and for some reason, the local costmap is not getting baked into the global one anymore, but now it's not working properly and still only relies on the global costmap to path plan. I tried changing everything from including all plugins in the common, which used to work before, but now stopped working since I restarted my terminal. Very weird...).

I'm running ROS Melodic on a Turtlebot 2, but no 3d sensors just a YD-LiDAR.

Here are my costmaps:

costmapcommonparams:

obstacle_range: 2.5 #2.0
raytrace_range: 3.0 #3.0
robot_radius: 0.12 #.15 #.2 #.18
#inflation_radius: 0.6 #.48 #.25 #ADJUST DOWN BELOW

inflation_layer:
  enabled:              true
  inflation_radius:     0.5 #.48 #.25 

localcostmapparams:

local_costmap:

   global_frame: odom
   robot_base_frame: /base_footprint
   update_frequency: 5.0
   publish_frequency: 2.0
   rolling_window: true
   width: 5.0
   height: 5.0
   resolution: 0.04
   transform_tolerance: 0.5
   static_map: false
   plugins:
    - {name: obstacle_layer, type: "costmap_2d::ObstacleLayer"}
    - {name: inflation_layer, type: "costmap_2d::InflationLayer"}
   obstacle_layer:
     enabled: true
     observation_sources: scan bump #scan2 
     scan: {sensor_frame: laser_frame, data_type: LaserScan, topic: /scan_filtered, marking: true, clearing: true}
     bump: {data_type: PointCloud2, topic: /mobile_base/sensors/bumper_pointcloud, marking: true, clearing: true}

globalcostmapparams:

global_costmap:
   global_frame: /map
   robot_base_frame: /base_footprint
   update_frequency: 1.0
   publish_frequency: 0.5
   static_map: true
   plugins:
     - {name: static_layer, type: "costmap_2d::StaticLayer"}
     #- {name: obstacle_layer, type: "costmap_2d::ObstacleLayer"}
     - {name: inflation_layer, type: "costmap_2d::InflationLayer"}
   static_layer:
       enabled: true
       static_map: true
   transform_tolerance: 0.5

Asked by RedstoneTaken on 2022-06-30 12:54:45 UTC

Comments

Answers