Robotics StackExchange | Archived questions

Obstacle showing up in global costmap and not inflating

Hey, I have setup costmap parameters using the tutorial and answers from the forum but I still can't get it to work right. The local cost map doesn't show the obstacle, the obstacle shows up in the global cost map but it is not inflated. I did try putting the inflation and obstacle layer in the local costmap with static and inflation layer in the global one but it didn't change much. Here are the params, how should I got about correcting this?


common params

robot_base_frame: dbot/base_link

max_obstacle_height: 4.0
robot_radius: 0.25

plugins:
  - {name: static_layer, type: "costmap_2d::StaticLayer"}
  - {name: obstacle_layer, type: "costmap_2d::ObstacleLayer"}
  - {name: inflated_layer, type: "costmap_2d::InflationLayer"}


static_layer:
  map_topic: /map
  subscribe_to_updates: true

obstacle_layer:
  observation_sources: laser depth

  laser:
    topic: /dbot/scan
    sensor_frame: dbot/sensor_laser
    observation_persistence: 10.0
    expected_update_rate: 10.0
    data_type: LaserScan
    clearing: true
    marking: true
    max_obstacle_height: 3.0
    min_obstacle_height: 0.05
    obstacle_range: 4.0
    raytrace_range: 6.0

  depth:
    topic: /dbot/kinect/depth/points
    sensor_frame: dbot/kinect
    observation_persistence: 10.0 
    expected_update_rate: 10.0
    data_type: PointCloud2
    clearing: true
    marking: true
    max_obstacle_height: 3.0
    min_obstacle_height: 0.05
    obstacle_range: 3.0
    raytrace_range: 3.0

inflated_layer:
  inflation_radius: 1.0
  cost_scaling_factor: 10.0    

global params

global_costmap:
  global_frame: map
  robot_base_frame: dbot/base_link

  # update_frequency: 10.0 -> 5.0 # Changed
  # publish_frequency: 10.0 -> 2.0 # Changed
  transform_tolerance: 0.5

  static_map: true
  height: 50
  widht: 50

local params

local_costmap:
  global_frame: dbot/odom
  robot_base_frame: dbot/base_link
  # update_frequency: 10.0 -> 5.0 # Changed
  # publish_frequency: 10.0 -> 2.0  # Changed
  transform_tolerance: 0.5

  static_map: false
  rolling_window: true
  width: 6
  height: 6
  resoultion: 0.05

Asked by shlock on 2021-02-17 15:44:48 UTC

Comments

Could you please try moving the static_layer and obstacle_layer plugins from the common_params.yaml file to global_params.yaml and local_params.yaml respectively. Also, add inflated_layer plugins to both the files (global_params.yaml and local_params.yaml) and remove it from common_params.yaml file.

Asked by skpro19 on 2021-02-17 16:26:50 UTC

Just so as to be clear, I am asking you to try removing this part from your common_params.yaml file -

plugins:
  - {name: static_layer, type: "costmap_2d::StaticLayer"}
  - {name: obstacle_layer, type: "costmap_2d::ObstacleLayer"}
  - {name: inflated_layer, type: "costmap_2d::InflationLayer"}

Asked by skpro19 on 2021-02-17 16:29:42 UTC

edit: I moved the plugins and reduced the sensor update rates and it seems to be working for now. I'll test a bit more tomorrow and let you know. Thanks.

I did try that before it didn't change much. Actually after restarting (and some minor changes) it is actually showing and inflation the obstacle but as soon as i give it a goal it freezes and fps drops to 0. I have a decent pc and don't think this should be happening. I'll update the post with the new parameters.

Asked by shlock on 2021-02-17 16:36:05 UTC

Did your changes successfully work? If so, can you post the solution on how you got it working? I'm having the same problem i.e, the local_costmap/obstacles and local_costmap/inflated_obstacles are not showing up for me in RViz

Asked by pk99 on 2021-04-24 01:44:17 UTC

I posted the parameter files in the answer. Hope it helps.

Asked by shlock on 2021-04-24 02:01:34 UTC

Answers

Here are the parameters which I am using working after following skpro19's advice. I actually dropped the depth source for the obstacle layer.


common params

robot_base_frame: dbot/base_link

max_obstacle_height: 20.0
robot_radius: 0.2 

static_layer:
  map_topic: /map
  subscribe_to_updates: true

obstacle_layer:
  observation_sources: laser #depth

  laser:
    topic: /dbot/scan
    sensor_frame: dbot/sensor_laser
    observation_persistence: 0.0
    expected_update_rate: 5.0
    data_type: LaserScan
    clearing: true
    marking: true
    max_obstacle_height: 20.0
    min_obstacle_height: -20.0
    obstacle_range: 4.0
    raytrace_range: 6.0

inflated_layer:
  inflation_radius: 4.0
  cost_scaling_factor: 3.0

global params

global_costmap:
  global_frame: map
  robot_base_frame: dbot/base_link

  update_frequency: 1.0
  publish_frequency: 2.0
  transform_tolerance: 0.5

  static_map: true
  height: 50
  widht: 50

  plugins:
    - {name: static_layer, type: "costmap_2d::StaticLayer"}
    - {name: inflated_layer, type: "costmap_2d::InflationLayer"}

local params

local_costmap:
  global_frame: dbot/odom
  robot_base_frame: dbot/base_link
  update_frequency: 1.0 
  publish_frequency: 2.0
  transform_tolerance: 0.5

  static_map: false
  rolling_window: true
  width: 6
  height: 6
  resoultion: 0.05


  plugins:
    - {name: obstacle_layer, type: "costmap_2d::ObstacleLayer"}
    - {name: inflated_layer, type: "costmap_2d::InflationLayer"}

Asked by shlock on 2021-04-24 02:00:35 UTC

Comments