Ask Your Question
1

Obstacle showing up in global costmap and not inflating

asked 2021-02-17 15:03:58 -0600

shlock gravatar image

updated 2021-02-17 15:45:52 -0600

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
edit retag flag offensive close merge delete

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.

skpro19 gravatar image skpro19  ( 2021-02-17 15:26:50 -0600 )edit
1

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"}
skpro19 gravatar image skpro19  ( 2021-02-17 15:29:42 -0600 )edit

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.

shlock gravatar image shlock  ( 2021-02-17 15:36:05 -0600 )edit

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

pk99 gravatar image pk99  ( 2021-04-24 01:44:17 -0600 )edit

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

shlock gravatar image shlock  ( 2021-04-24 02:01:34 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-04-24 02:00:35 -0600

shlock gravatar image

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"}
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-02-17 14:44:48 -0600

Seen: 114 times

Last updated: Apr 24